8000 bug #45258 [DependencyInjection] Don't dump polyfilled classes in pre… · symfony/symfony@c112bf1 · GitHub
[go: up one dir, main page]

Skip to content

Commit c112bf1

Browse files
committed
bug #45258 [DependencyInjection] Don't dump polyfilled classes in preload script (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] Don't dump polyfilled classes in preload script | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44866 | License | MIT | Doc PR | - Commits ------- c11d664 [DependencyInjection] Don't dump polyfilled classes in preload script
2 parents 5c67f40 + c11d664 commit c112bf1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function dump(array $options = [])
316316
if (!$class || str_contains($class, '$')) {
317317
continue;
318318
}
319-
if (!(class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false)) || (new \ReflectionClass($class))->isUserDefined()) {
319+
if (!(class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false)) || ((new \ReflectionClass($class))->isUserDefined() && !\in_array($class, ['Attribute', 'JsonException', 'ReturnTypeWillChange', 'Stringable', 'UnhandledMatchError', 'ValueError'], true))) {
320320
$code[$options['class'].'.preload.php'] .= sprintf("\$classes[] = '%s';\n", $class);
321321
}
322322
}

0 commit comments

Comments
 (0)
0