From b3f8379a155bbbe2dfc3371e8a47bfe72524cd4f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 22 Jun 2018 18:10:54 +0930 Subject: [PATCH] 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. --- src/Extension/Extension.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index 52fb73363..21600ffda 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -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