mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
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:
parent
2234a81ee7
commit
b3f8379a15
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user