Prefer passing an array to ServiceProvider::extend

This commit is contained in:
Toby Zerner 2015-06-15 08:59:33 +09:30
parent 435880733d
commit da461b1be7

View File

@ -22,8 +22,14 @@ class ServiceProvider extends IlluminateServiceProvider
public function extend()
{
foreach (func_get_args() as $extender) {
$extender->extend($this->app);
// @todo don't support func_get_args
foreach (func_get_args() as $extenders) {
if (! is_array($extenders)) {
$extenders = [$extenders];
}
foreach ($extenders as $extender) {
$extender->extend($this->app);
}
}
}
}