From 587660eb39f54dd5b8261d7d475d5ed28d97c5f3 Mon Sep 17 00:00:00 2001 From: Damilare Anjorin Date: Wed, 21 Jun 2023 02:07:41 +0100 Subject: [PATCH 1/2] [10.x] fix ListenerMakeCommand depreciations --- src/Illuminate/Foundation/Console/ListenerMakeCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php index 6d815bbd7d31..f8e425aa8476 100644 --- a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php @@ -46,12 +46,12 @@ protected function buildClass($name) { $event = $this->option('event'); - if (! Str::startsWith($event, [ + if (! Str::startsWith($event ?? '', [ $this->laravel->getNamespace(), 'Illuminate', '\\', ])) { - $event = $this->laravel->getNamespace().'Events\\'.str_replace('/', '\\', $event); + $event = $this->laravel->getNamespace().'Events\\'.str_replace('/', '\\', $event ?? ''); } $stub = str_replace( From 5930f211bdb9fa7c835a79d5c19ed2bf58718953 Mon Sep 17 00:00:00 2001 From: Damilare Anjorin Date: Wed, 21 Jun 2023 11:57:20 +0100 Subject: [PATCH 2/2] chore: update --- src/Illuminate/Foundation/Console/ListenerMakeCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php index f8e425aa8476..6e549fd6d042 100644 --- a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php @@ -44,14 +44,14 @@ class ListenerMakeCommand extends GeneratorCommand */ protected function buildClass($name) { - $event = $this->option('event'); + $event = $this->option('event') ?? ''; - if (! Str::startsWith($event ?? '', [ + if (! Str::startsWith($event, [ $this->laravel->getNamespace(), 'Illuminate', '\\', ])) { - $event = $this->laravel->getNamespace().'Events\\'.str_replace('/', '\\', $event ?? ''); + $event = $this->laravel->getNamespace().'Events\\'.str_replace('/', '\\', $event); } $stub = str_replace(