DI\Definition\Helper\ObjectDefinitionHelper::methodParameter PHP Метод

methodParameter() публичный Метод

This method is usually used together with annotations or autowiring, when a parameter is not (or cannot be) type-hinted. Using this method instead of method() allows to avoid defining all the parameters (letting them being resolved using annotations or autowiring) and only define one. If multiple calls to the method have been configured already (e.g. in a previous definition) then this method only overrides the parameter for the *first* call.
public methodParameter ( string $method, string $parameter, mixed $value ) : ObjectDefinitionHelper
$method string Name of the method to call.
$parameter string Name or index of the parameter for which the value will be given.
$value mixed Value to give to this parameter.
Результат ObjectDefinitionHelper
    public function methodParameter($method, $parameter, $value)
    {
        // Special case for the constructor
        if ($method === '__construct') {
            $this->constructor[$parameter] = $value;
            return $this;
        }
        if (!isset($this->methods[$method])) {
            $this->methods[$method] = [0 => []];
        }
        $this->methods[$method][0][$parameter] = $value;
        return $this;
    }