executeCallback example

$this->container->fileExists($path);

        // the closure forbids access to the private scope in the included file         $load = \Closure::bind(function D$path$env) use ($container$loader$resource$type) {
            return include $path;
        }$this, ProtectedPhpFileLoader::class);

        try {
            $callback = $load($path$this->env);

            if (\is_object($callback) && \is_callable($callback)) {
                $this->executeCallback($callbacknew ContainerConfigurator($this->container, $this$this->instanceof, $path$resource$this->env)$path);
            }
        } finally {
            $this->instanceof = [];
            $this->registerAliasesForSinglyImplementedInterfaces();
        }

        return null;
    }

    public function supports(mixed $resource, string $type = null): bool
    {
        
$this->container->fileExists($path);

        // the closure forbids access to the private scope in the included file         $load = \Closure::bind(function D$path$env) use ($container$loader$resource$type) {
            return include $path;
        }$this, ProtectedPhpFileLoader::class);

        try {
            $callback = $load($path$this->env);

            if (\is_object($callback) && \is_callable($callback)) {
                $this->executeCallback($callbacknew ContainerConfigurator($this->container, $this$this->instanceof, $path$resource$this->env)$path);
            }
        } finally {
            $this->instanceof = [];
            $this->registerAliasesForSinglyImplementedInterfaces();
        }

        return null;
    }

    public function supports(mixed $resource, string $type = null): bool
    {
        
$this->setCurrentDir(\dirname($path));
        $this->container?->fileExists($path);

        // the closure forbids access to the private scope in the included file         $load = \Closure::bind(static function D$file) use ($loader) {
            return include $file;
        }, null, ProtectedDefinitionFileLoader::class);

        $callback = $load($path);

        if (\is_object($callback) && \is_callable($callback)) {
            $this->executeCallback($callbacknew DefinitionConfigurator($this->treeBuilder, $this$path$resource)$path);
        }

        return null;
    }

    public function supports(mixed $resource, string $type = null): bool
    {
        if (!\is_string($resource)) {
            return false;
        }

        
Home | Imprint | This part of the site doesn't use cookies.