Allow a single extender to be returned (#1469)

Casting an object to an array does not have the intended effect of
wrapping the object in an array. Instead we need to explicitly check
if the returned value is an array or not.
This commit is contained in:
Toby Zerner 2018-06-22 18:10:54 +09:30 committed by GitHub
parent 3bcfdd83d3
commit a825a7d115

View File

@ -119,7 +119,13 @@ class Extension implements Arrayable
return;
}
$extenders = array_flatten((array) require $bootstrapper);
$extenders = require $bootstrapper;
if (! is_array($extenders)) {
$extenders = [$extenders];
}
$extenders = array_flatten($extenders);
foreach ($extenders as $extender) {
// If an extension has not yet switched to the new bootstrap.php