Creates an instance for a missing argument.

@param object $target
@param string $method
@param int    $index

@return self
543962
public static function missingArgument($target, string $method, int $index): self
    {
        return new self(sprintf(
            'Missing argument %d for method %s::%s().',
            $index,
            get_class($target),
            $method
        ));
    }
535828
public static function setMethod($method = 'auto')
    {
        if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
            $method = 'auto';
        }

        self::$method = $method;

        return new self();
    }
732903
public function returnsArgument(int $index = 0): Stub
    {
        return $this->doesWith(
            function ($arguments) use ($index) {
                return $arguments->get($index);
            },
            [],
            false,
            true,
            false
        );
    }
21803
protected function addMethodsFrom($property, $index = null)
    {
        $class = static::class;
        $extension = ($index !== null) ? $this->{$property}[$index] : $this->$property;

        if (!$extension) {
            throw new InvalidArgumentException(
                "Object->addMethodsFrom(): could not add methods from {$class}->{$property}[$index]"
            );
        }

        $methods = $this->findMethodsFromExtension($extension);
        if ($methods) {
            if ($extension instanceof Extension) {
                Deprecation::notice(
                    '5.0',
                    'Register custom methods from extensions with addCallbackMethod.'
                    . ' callSetOwnerFirst will be removed in 5.0'
                );
            }
            $methodInfo = array(
                'property' => $property,
                'index' => $index,
                'callSetOwnerFirst' => $extension instanceof Extension,
            );

            $newMethods = array_fill_keys($methods, $methodInfo);

            if (isset(self::$extra_methods[$class])) {
                self::$extra_methods[$class] =
                    array_merge(self::$extra_methods[$class], $newMethods);
            } else {
                self::$extra_methods[$class] = $newMethods;
            }
        }
    }
111553
protected function setAjaxTarget($target)
    {
        if (!empty($this->ajax_cmd)) {
            $this->ajax_cmd->setSelector($target);
        }

        return $this;
    }
536722
public static function addRoute($path, $target, $method = 'GET')
    {
        $router = Router::getInstance();
        $router->altoRouter->map($method, $path, $target);
    }
314210
private Object invokeTarget(Object target, Method method, Object[] args) throws Throwable {
        Object returnValue;
        try {
            returnValue = method.invoke(target, args);
        } catch(InvocationTargetException ite) {
            throw ite.getTargetException();
        }
        return returnValue;
    }
328615
public static function create($source, $target)
    {
        $message = sprintf('Dependency `%s` not found, required by `%s`', $target, $source);
        $exception = new static($message, 0, null, $source, $target);

        return $exception;
    }
550188
public static function create(string $method): self
    {
        $self = new self();
        $self->method = $method;

        return $self;
    }
495803
public function execute($method, $location)
    {
        curl_setopt_array($this->curl, array(
            CURLOPT_URL => $location,
            CURLOPT_COOKIE => $this->getRequestCookies(),
            CURLOPT_CUSTOMREQUEST => $method,
        ));

        if (!$response = curl_exec($this->curl)) {
            $this->restart();
            throw new EmptyResponseException($this, $location);
        }

        $response = new CurlClientResponse($response);
        $this->cookies = array_merge($this->cookies, $response->getCookies());

        if ($this->restart == true) {
            $this->restart();
        }

        return $response;
    }
1090065
public function invoke($method, $parameters)
    {
        /* @var Aop $aop */
        $aop = \bean(Aop::class);

        return $aop->execute($this->target, $method, $parameters);
    }
85750
public function addRule($index, $method = null, ...$params)
    {
        $this->rules[$index] = [$method, $params];
        return $this;
    }
794044
public function setActionIndex(int $index = null) : self
    {
        if ($index) {
            return $this->addAttribute('data-action-index', (string) $index);
        } else {
            return $this->removeAttribute('data-index-action');
        }
    }
1013219
public function moveBefore(string $id, $target)
    {
        if ($element = $this->find($id)) {
            $this->without($id);
            $targetPosition = $this->position($target);

            if ($targetPosition >= 0) {
                $this->insert($element, $targetPosition)->all();
            }
        }

        return $this;
    }
358397
public final function setMethodArguments(string $method, array $methodArguments): self
    {
        $this->methodArguments[$method] = $methodArguments;

        return $this;
    }
292749
def method_missing(m, *args)
      res = @targets.inject([]) { |res, t| res << t.send(m, *args) }
      res[0]
    end
689013
protected function postExecuteAction($key, $index, $args)
    {
        switch ($key) {
            case self::ADD:
                $this->addCounter++;
                $this->item->initialize($args[0]);
                $this->registry->updateLayout($args[0], $this, $this->item);
                break;
            case self::ADD_ALIAS:
                $this->item->initialize($this->rawLayoutBuilder->resolveId($args[1]), $args[0]);
                $this->registry->updateLayout($args[0], $this, $this->item);
                break;
            case self::MOVE:
                $this->addCounter++;
                break;
            case self::REMOVE:
                $this->removeLink($key, $index, $args[0]);
                break;
        }

        return 0;
    }