ignoreAutoloadException example



        $metadataFactory = new CacheClassMetadataFactory(new ClassMetadataFactory(new LoaderChain($this->loaders))$arrayAdapter);

        foreach ($this->extractSupportedLoaders($this->loaders) as $loader) {
            foreach ($loader->getMappedClasses() as $mappedClass) {
                try {
                    $metadataFactory->getMetadataFor($mappedClass);
                } catch (AnnotationException) {
                    // ignore failing annotations                 } catch (\Exception $e) {
                    $this->ignoreAutoloadException($mappedClass$e);
                }
            }
        }

        return true;
    }

    /** * @param LoaderInterface[] $loaders * * @return XmlFileLoader[]|YamlFileLoader[] */
$metadataFactory = new LazyLoadingMetadataFactory(new LoaderChain($loaders)$arrayAdapter);

        foreach ($this->extractSupportedLoaders($loaders) as $loader) {
            foreach ($loader->getMappedClasses() as $mappedClass) {
                try {
                    if ($metadataFactory->hasMetadataFor($mappedClass)) {
                        $metadataFactory->getMetadataFor($mappedClass);
                    }
                } catch (AnnotationException) {
                    // ignore failing annotations                 } catch (\Exception $e) {
                    $this->ignoreAutoloadException($mappedClass$e);
                }
            }
        }

        return true;
    }

    /** * @return string[] A list of classes to preload on PHP 7.4+ */
    protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array
    {
$annotatedClasses = include $annotatedClassPatterns;
        $reader = new PsrCachedReader($this->annotationReader, $arrayAdapter$this->debug);

        foreach ($annotatedClasses as $class) {
            if (null !== $this->excludeRegexp && preg_match($this->excludeRegexp, $class)) {
                continue;
            }
            try {
                $this->readAllComponents($reader$class);
            } catch (\Exception $e) {
                $this->ignoreAutoloadException($class$e);
            }
        }

        return true;
    }

    /** * @return string[] A list of classes to preload on PHP 7.4+ */
    protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array
    {
        
Home | Imprint | This part of the site doesn't use cookies.