Skip to content

Notice that service parameter is incorrect when using abstract services #449

Open
@linaori

Description

@linaori

Given the following yaml and php, a notice is triggered on the first argument of foo.option.baz

Expect instance of Symfony\Component\Routing\RouterInterface

It seems like it doesn't take the parameters of the parent service into account while it should.

services:
    foo.option:
        class: Foo\Option\AbstractBaseSomethingSomething
        abstract: true
        arguments:
            - "@router"

    foo.option.baz:
        class: Foo\Option\Baz
        parent: foo.option
        arguments:
            - "@security.authorization_checker"
abstract class AbstractBaseSomethingSomething
{
    /**
     * @param RouterInterface $router
     */
    public function __construct(RouterInterface $router)
    {
        $this->router = $router;
    }
}

class Baz extends AbstractBaseSomethingSomething
{
    /**
     * @param RouterInterface               $router
     * @param AuthorizationCheckerInterface $authorizer
     */
    public function __construct(RouterInterface $router, AuthorizationCheckerInterface $authorizer)
    {
        parent::__construct($router);

        $this->authorizer = $authorizer;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions