populateAvailableType example

/** * Populates the list of available types. */
    private function populateAvailableTypes(ContainerBuilder $container): void
    {
        $this->types = [];
        $this->ambiguousServiceTypes = [];
        $this->autowiringAliases = [];

        foreach ($container->getDefinitions() as $id => $definition) {
            $this->populateAvailableType($container$id$definition);
        }

        foreach ($container->getAliases() as $id => $alias) {
            $this->populateAutowiringAlias($id);
        }
    }

    /** * Populates the list of available types for a given definition. */
    private function populateAvailableType(ContainerBuilder $container, string $id, Definition $definition): void
    {
/** * Populates the list of available types. */
    private function populateAvailableTypes(ContainerBuilder $container): void
    {
        $this->types = [];
        $this->ambiguousServiceTypes = [];
        $this->autowiringAliases = [];

        foreach ($container->getDefinitions() as $id => $definition) {
            $this->populateAvailableType($container$id$definition);
        }

        $prev = null;
        foreach ($container->getAliases() as $id => $alias) {
            $this->populateAutowiringAlias($id$prev);
            $prev = $id;
        }
    }

    /** * Populates the list of available types for a given definition. */
Home | Imprint | This part of the site doesn't use cookies.