mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +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
3bcfdd83d3
commit
a825a7d115
|
@ -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