diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 89f9c99408fe..da41361a6bc3 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -4,6 +4,7 @@ use Closure; use Cron\CronExpression; +use Illuminate\Support\Arr; use Illuminate\Support\Carbon; use GuzzleHttp\Client as HttpClient; use Illuminate\Contracts\Mail\Mailer; @@ -377,7 +378,7 @@ public function emailOutputTo($addresses, $onlyIfOutputExists = false) { $this->ensureOutputIsBeingCapturedForEmail(); - $addresses = is_array($addresses) ? $addresses : [$addresses]; + $addresses = Arr::wrap($addresses); return $this->then(function (Mailer $mailer) use ($addresses, $onlyIfOutputExists) { $this->emailOutput($mailer, $addresses, $onlyIfOutputExists); diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php index fd3925373fd3..4d933a280d6a 100644 --- a/src/Illuminate/Foundation/Console/Kernel.php +++ b/src/Illuminate/Foundation/Console/Kernel.php @@ -6,6 +6,7 @@ use Exception; use Throwable; use ReflectionClass; +use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Console\Command; use Symfony\Component\Finder\Finder; @@ -195,7 +196,7 @@ public function command($signature, Closure $callback) */ protected function load($paths) { - $paths = array_unique(is_array($paths) ? $paths : (array) $paths); + $paths = array_unique(Arr::wrap($paths)); $paths = array_filter($paths, function ($path) { return is_dir($path); diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index eb1d94e7d0de..0bfc93efde99 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -153,7 +153,7 @@ public static function finish($value, $cap) */ public static function is($pattern, $value) { - $patterns = is_array($pattern) ? $pattern : (array) $pattern; + $patterns = Arr::wrap($pattern); if (empty($patterns)) { return false;