Skip to content

Data types are not strict #19867

Closed
Closed
@ofttryaj

Description

@ofttryaj

Symfony\Component\HttpKernel\Kernel

// this container's type is ContainerInterface
protected function getContainerLoader(ContainerInterface $container)
    {
        $locator = new FileLocator($this);
        $resolver = new LoaderResolver(array(
            new XmlFileLoader($container, $locator),
            new YamlFileLoader($container, $locator),
            new IniFileLoader($container, $locator),
            new PhpFileLoader($container, $locator),
            new DirectoryLoader($container, $locator),
            new ClosureLoader($container),
        ));

        return new DelegatingLoader($resolver);
    }

Symfony\Component\DependencyInjection\Loader\FileLoader

// this container's type is ContainerBuilder, but the above, 
// this construct function is called, params type is ContainerInterface

public function __construct(ContainerBuilder $container, FileLocatorInterface $locator)
    {
        $this->container = $container;

        parent::__construct($locator);
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions