Skip to content

Commit

Permalink
Handle class_parents returning false in class_uses_recursive (#48902
Browse files Browse the repository at this point in the history
)

This will now take into account that `class_parents` can return false on error which would result in a boolean passed into `array_reverse`.
  • Loading branch information
RoflCopter24 committed Nov 3, 2023
1 parent 8378ab2 commit 0ca0d32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function class_uses_recursive($class)

$results = [];

foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
foreach (array_reverse(class_parents($class) ?: []) + [$class => $class] as $class) {
$results += trait_uses_recursive($class);
}

Expand Down

0 comments on commit 0ca0d32

Please sign in to comment.