Skip to content

Commit

Permalink
Revert "[10.x] Update Kernel::load() to use same classFromFile logi…
Browse files Browse the repository at this point in the history
…c as events (#47327)"

This reverts commit 2b174d5.
  • Loading branch information
taylorotwell authored Jun 8, 2023
1 parent 56ad777 commit 3d05667
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,12 @@ protected function load($paths)
}

$namespace = $this->app->getNamespace();
$basePath = $this->app->basePath();

foreach ((new Finder())->in($paths)->files() as $file) {
$class = trim(Str::replaceFirst($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);

$command = str_replace(
[DIRECTORY_SEPARATOR, ucfirst(basename($this->app->path())).'\\'],
['\\', $namespace],
ucfirst(Str::replaceLast('.php', '', $class)),
foreach ((new Finder)->in($paths)->files() as $command) {
$command = $namespace.str_replace(
['/', '.php'],
['\\', ''],
Str::after($command->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR)
);

if (is_subclass_of($command, Command::class) &&
Expand Down

0 comments on commit 3d05667

Please sign in to comment.