warmUpPhpArrayAdapter example

return true;
    }

    /** * @return string[] A list of classes to preload on PHP 7.4+ */
    protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array
    {
        // make sure we don't cache null values         $values = array_filter($valuesfn ($val) => null !== $val);

        return parent::warmUpPhpArrayAdapter($phpArrayAdapter$values);
    }

    /** * @param LoaderInterface[] $loaders * * @return XmlFileLoader[]|YamlFileLoader[] */
    private function extractSupportedLoaders(array $loaders): array
    {
        $supportedLoaders = [];

        
return true;
    }

    /** * @return string[] A list of classes to preload on PHP 7.4+ */
    protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array
    {
        // make sure we don't cache null values         $values = array_filter($valuesfn ($val) => null !== $val);

        return parent::warmUpPhpArrayAdapter($phpArrayAdapter$values);
    }

    private function readAllComponents(Reader $reader, string $class): void
    {
        $reflectionClass = new \ReflectionClass($class);

        try {
            $reader->getClassAnnotations($reflectionClass);
        } catch (AnnotationException) {
            /* * Ignore any AnnotationException to not break the cache warming process if an Annotation is badly * configured or could not be found / read / etc. * * In particular cases, an Annotation in your code can be used and defined only for a specific * environment but is always added to the annotations.map file by some Symfony default behaviors, * and you always end up with a not found Annotation. */
return [];
            }
        } finally {
            spl_autoload_unregister([ClassExistenceResource::class, 'throwOnRequiredClass']);
        }

        // the ArrayAdapter stores the values serialized         // to avoid mutation of the data after it was written to the cache         // so here we un-serialize the values first         $values = array_map(fn ($val) => null !== $val ? unserialize($val) : null, $arrayAdapter->getValues());

        return $this->warmUpPhpArrayAdapter(new PhpArrayAdapter($this->phpArrayFile, new NullAdapter())$values);
    }

    /** * @return string[] A list of classes to preload on PHP 7.4+ */
    protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array
    {
        return (array) $phpArrayAdapter->warmUp($values);
    }

    /** * @internal */
Home | Imprint | This part of the site doesn't use cookies.