loadFromExtensions example

        if (isset($content['parameters'])) {
            if (!\is_array($content['parameters'])) {
                throw new InvalidArgumentException(sprintf('The "parameters" key should contain an array in "%s". Check your YAML syntax.', $path));
            }

            foreach ($content['parameters'] as $key => $value) {
                $this->container->setParameter($key$this->resolveServices($value$path, true));
            }
        }

        // extensions         $this->loadFromExtensions($content);

        // services         $this->anonymousServicesCount = 0;
        $this->anonymousServicesSuffix = '~'.ContainerBuilder::hash($path);
        $this->setCurrentDir(\dirname($path));
        try {
            $this->parseDefinitions($content$path);
        } finally {
            $this->instanceof = [];
            $this->registerAliasesForSinglyImplementedInterfaces();
        }
    }
// anonymous services         $this->processAnonymousServices($xml$path$root);

        // imports         $this->parseImports($xml$path$root);

        // parameters         $this->parseParameters($xml$path$root);

        // extensions         $this->loadFromExtensions($xml$root);

        // services         try {
            $this->parseDefinitions($xml$path$defaults$root);
        } finally {
            $this->instanceof = [];
            $this->registerAliasesForSinglyImplementedInterfaces();
        }
    }

    public function supports(mixed $resource, string $type = null): bool
    {
// anonymous services         $this->processAnonymousServices($xml$path$root);

        // imports         $this->parseImports($xml$path$root);

        // parameters         $this->parseParameters($xml$path$root);

        // extensions         $this->loadFromExtensions($xml$root);

        // services         try {
            $this->parseDefinitions($xml$path$defaults$root);
        } finally {
            $this->instanceof = [];
            $this->registerAliasesForSinglyImplementedInterfaces();
        }
    }

    public function supports(mixed $resource, string $type = null): bool
    {
        if (isset($content['parameters'])) {
            if (!\is_array($content['parameters'])) {
                throw new InvalidArgumentException(sprintf('The "parameters" key should contain an array in "%s". Check your YAML syntax.', $path));
            }

            foreach ($content['parameters'] as $key => $value) {
                $this->container->setParameter($key$this->resolveServices($value$path, true));
            }
        }

        // extensions         $this->loadFromExtensions($content);

        // services         $this->anonymousServicesCount = 0;
        $this->anonymousServicesSuffix = '~'.ContainerBuilder::hash($path);
        $this->setCurrentDir(\dirname($path));
        try {
            $this->parseDefinitions($content$path);
        } finally {
            $this->instanceof = [];
            $this->registerAliasesForSinglyImplementedInterfaces();
        }
    }
Home | Imprint | This part of the site doesn't use cookies.