@param string   $name
@param array    $args
@param Resource $resource

@return ResultInterface|Batch|Resource
421341
public function performAction($name, array $args, Resource $resource)
    {
        if (isset($args[0]) && is_array($args[0])) {
            $args = $args[0];
        }

        $action = $this->model->search('action', $resource->getType(), $name);

        $command = $this->prepareCommand($action['request'], $resource, $args);
        $result = $this->apiClient->execute($command);

        if (isset($action['resource'])) {
            $id = $this->createIdentityForRelatedResource(
                $action['resource']['identifiers'],
                function (array $param) use ($resource, $command, $result) {
                    return $this->resolveValue($param, $resource, $command, $result);
                }
            );

            return $this->createResources($action['resource'], $result, $id);
        } else {
            return $result;
        }
    }
1292629
protected function getResults(string $name, array $args)
    {
        if (method_exists($this->scope, $name)) {
            return call_user_func_array([$this->scope, $name], $args);
        }

        return $this->scope->__call($name, $args);
    }
952496
public static function get(string $name, array $args = [], $persistant = false)
    {
        if (!is_array(static::$classes)) {
            throw new ArchException('A static property $classes with an array of classes must be declared in class [' . __CLASS__ . ']');
        }
        if (!array_key_exists($name, static::$classes)) {
            throw new ArchException('Unknown object [' . $name . ']');
        }
        return self::buildClass(static::$classes[$name], $args, $persistant);
    }
39590
public static function init ($name = null, ...$args) {
		$name = implode('<>', (array) ($name ?? static::$multitonDefaultName));
		$instance = (static::$multitonInstances[static::class][$name] ?? static::$multitonInstances[static::class][$name] = new static(...$args));
		$instance->multitonName = $name;
		return $instance;
	}
1337756
public function resolveStatic(string $name, string $method, ...$args)
    {
        return $this->resolve($name . '::' . $method, ...$args);
    }
459720
public static function tryGetResource(string $name)
    {
        $resource = static::getInstance($name)->tryGetResource();
        if(!$resource)
        {
            static::pushResourceToRequestContext($resource);
        }
        return $resource;
    }
100672
protected function executeMethod($name, $args)
    {
        // Send request, retry one time when using persistent connections on the first request only
        if ($this->persistent && $this->requests === 0) {
            $this->requests = 1;
            try {
                $response = $this->redis->$name(...$args);
            } catch (\RedisException $e) {
                if ($e->getMessage() === 'read error on connection') {
                    $this->close(true);
                    $this->connect();
                    $response = $this->redis->$name(...$args);
                } else {
                    throw $e;
                }
            }
        } else {
            $response = $this->redis->$name(...$args);
        }

        // Proxy pipeline mode to the phpredis library
        if ($name === 'pipeline' || $name === 'multi') {
            $this->redisMulti = $response;

            return $this;
        }

        if ($name === 'exec' || $name === 'discard') {
            $this->redisMulti = null;

            return $response;
        }

        if ($this->redisMulti !== null) { // Multi and pipeline return self for chaining
            return $this;
        }

        return $response;
    }
714085
public function __callResolver(string $name, array $args)
    {
        //get the handler
        $handler = $this->getResolverHandler();

        //can it be resolved?
        if ($handler->canResolve($name)) {
            //is it shared ?
            if ($handler->isShared($name)) {
                //resolve the shared
                return $this->resolveShared($name, ...$args);
            }

            //resolve it the regular way
            return $this->resolve($name, ...$args);
        }

        //oops ?
        throw ResolverException::forMethodNotFound(get_class($this), $name);
    }
199821
private function execute($name, array $arguments)
    {
        return $this->functions[$name]->call($this->mapper, $this->connection, $this->strategies, $this->environment, $arguments, []);
    }
379599
public function shared(string $name, ...$args)
    {
        if (!isset(self::$share[$name])) {
            self::$share[$name] = $this->resolve($name, ...$args);
        }

        return self::$share[$name];
    }
1348578
protected function cutArgument($name, &$args)
    {
        if (isset($args[$name])) {
            $result = $args[$name];
            unset($args[$name]);
            return $result;
        }

        return null;
    }
101041
public function handler($name, Args $args)
    {
        if (
            !$this->checkLevel($args->get('level')) ||
            !$this->checkSource($args->get('source'))
        ) {
            return;
        }

        switch ($name) {
            /*
            case ':log:':
                $this->log($args);
                break; // case 'log'

            */
            case ':onAddHandler:':
                $args->set('message', sprintf(
                    "Adding handler %s, %s",
                    $this->handlerToString(
                        $args->get('handler'), $args->get('name')
                    ),
                    $args->get('added', false)
                        ? "successfully" :
                        "failed (duplicate handler)"
                ));
                break; // case ':onAddHandler:'

            case ':onEventStart:':
                $args->set('message', sprintf(
                    "{ '%s' (%s), args [%s]",
                    $args->get('name'),
                    $args->get('uid'),
                    implode(', ', array_keys($args->get()))
                ));
                break; // case ':onEventStart:'

            case ':onHandlerFound:':
                $args->set('message', sprintf(
                    "Handler %s found",
                    $this->handlerToString($args->get('handler'))
                ));
                break; // case ':onAddHandler:'

            case ':onEventEnd:':
                $args->set('message', sprintf(
                    "} '%s' (%s), args [%s]",
                    $args->get('name'),
                    $args->get('uid'),
                    implode(', ', array_keys($args->get()))
                ));
                break; // case ':onEventEnd:'

            case ':onDropHandlers:':
                $args->set('message', sprintf(
                    "Dropping handler %s",
                    $this->handlerToString(
                        $args->get('handler'), $args->get('name')
                    )
                ));
                break; // case ':onDropHandlers:'

            case ':onDisableHandler:':
                $args->set('message', sprintf(
                    "Disabling handler %s",
                    $this->handlerToString(
                        $args->get('handler'), $args->get('name')
                    )
                ));
                break; // case ':onDropHandlers:'

            case ':onEnableHandler:':
                $args->set('message', sprintf(
                    "Enabling handler %s",
                    $this->handlerToString(
                        $args->get('handler'), $args->get('name')
                    )
                ));
                break; // case ':onDropHandlers:'
        }
        $this->log($args);
    }
1064844
private static function getProxy(string $name, array $arguments): ProxyInterface
    {
        self::ensurePluginLoad($name);

        $fqcnOrAlias = $arguments[0];
        $alias = $arguments[1] ?? null;

        return ProxyBuilderFactory::get(self::$mockingStrategies[$name])
            ->getProxy($fqcnOrAlias, $alias);
    }
563842
public static function getInstance($name, $args = [], $forceNew = false)
    {
        $key = strtolower($name);

        $called = get_called_class();

        if (empty(static::$instances[$called][$key]) || $forceNew) {
            static::$instances[$called][$key] = static::create($name, ...$args);
        }

        return static::$instances[$called][$key];
    }
610118
public function getCommand($name, array $args = [])
    {
        if (!$this->description->hasOperation($name)) {
            $name = ucfirst($name);
            if (!$this->description->hasOperation($name)) {
                throw new \InvalidArgumentException(
                    "No operation found named {$name}"
                );
            }
        }

        // Merge in default command options
        $args += $this->getConfig('defaults');

        return parent::getCommand($name, $args);
    }
385139
public function addResource(ResourceInterface $resource, $name = null) {
		if ($name === null) {
			$this->resources[] = $resource;
			
			return $this;
		}
		
		$this->resources[$name] = $resource;
		
		return $this;
	}
420031
protected function executeCommand($name, array $arguments)
    {
        $command = $this->client->createCommand($name, $arguments);

        return $this->client->executeCommand($command);
    }