Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 18, 2022
2 parents 9598024 + b722497 commit 2428d1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Illuminate/Console/Scheduling/ScheduleTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Illuminate\Console\Scheduling;

use Illuminate\Console\Application;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'schedule:test')]
Expand Down Expand Up @@ -55,7 +55,11 @@ public function handle(Schedule $schedule)
}

if (! empty($name = $this->option('name'))) {
$matches = array_filter($commandNames, fn ($commandName) => Str::endsWith($commandName, $name));
$commandBinary = Application::phpBinary().' '.Application::artisanBinary();

$matches = array_filter($commandNames, function ($commandName) use ($commandBinary, $name) {
return trim(str_replace($commandBinary, '', $commandName)) === $name;
});

if (count($matches) !== 1) {
return $this->error('No matching scheduled command found.');
Expand Down

0 comments on commit 2428d1d

Please sign in to comment.