Skip to content

[DependencyInjection] Don't pass null to trim() #41557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,9 @@ private function getClasses(Definition $definition): array
$classes = [];

while ($definition instanceof Definition) {
$classes[] = trim($definition->getClass(), '\\');
if ($class = $definition->getClass()) {
$classes[] = trim($class, '\\');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can now remove array_filter($classes) at line 2169?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array_filter would still remove empty strings. I don't know if that's a thing here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed in 40992f0 as I don't think the empty can get in (or if it does, that's because of a broken factory definition anyway)

}
$factory = $definition->getFactory();

if (!\is_array($factory)) {
Expand Down