Skip to content

Commit

Permalink
Catch filemtime warning thrown as ErrorException
Browse files Browse the repository at this point in the history
When ReflectionClass->getFileName() returns a filename with eval()'d in it, filemtime emits a warning which is thrown as an Error Exception in Symfony by default.

- Related to this issue in doctrineannotations: doctrine/annotations#186
  • Loading branch information
maxime-aknin authored Mar 14, 2022
1 parent 8e8207b commit 074f8ae
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private function readAllComponents(Reader $reader, string $class)

try {
$reader->getClassAnnotations($reflectionClass);
} catch (AnnotationException $e) {
} catch (AnnotationException | \ErrorException $e) {
/*
* Ignore any AnnotationException to not break the cache warming process if an Annotation is badly
* configured or could not be found / read / etc.
Expand All @@ -99,14 +99,14 @@ private function readAllComponents(Reader $reader, string $class)
foreach ($reflectionClass->getMethods() as $reflectionMethod) {
try {
$reader->getMethodAnnotations($reflectionMethod);
} catch (AnnotationException $e) {
} catch (AnnotationException | \ErrorException $e) {
}
}

foreach ($reflectionClass->getProperties() as $reflectionProperty) {
try {
$reader->getPropertyAnnotations($reflectionProperty);
} catch (AnnotationException $e) {
} catch (AnnotationException | \ErrorException $e) {
}
}
}
Expand Down

0 comments on commit 074f8ae

Please sign in to comment.