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 2234a81ee7
commit b3f8379a15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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