Skip to content

Commit a3c3ed5

Browse files
authored
Revert "[9.x] Return exit status instead of booleans from GeneratorCommand::handle() (#43915)" (#43921)
This reverts commit 3a89f6f.
1 parent 3a89f6f commit a3c3ed5

File tree

2 files changed

+5
-125
lines changed

2 files changed

+5
-125
lines changed

src/Illuminate/Console/GeneratorCommand.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Illuminate\Console;
44

55
use Illuminate\Console\Concerns\CreatesMatchingTest;
6-
use Illuminate\Contracts\Container\BindingResolutionException;
76
use Illuminate\Filesystem\Filesystem;
87
use Illuminate\Support\Str;
98
use Symfony\Component\Console\Input\InputArgument;
@@ -138,7 +137,7 @@ abstract protected function getStub();
138137
/**
139138
* Execute the console command.
140139
*
141-
* @return int|void
140+
* @return bool|null
142141
*
143142
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
144143
*/
@@ -150,7 +149,7 @@ public function handle()
150149
if ($this->isReservedName($this->getNameInput())) {
151150
$this->components->error('The name "'.$this->getNameInput().'" is reserved by PHP.');
152151

153-
return self::FAILURE;
152+
return false;
154153
}
155154

156155
$name = $this->qualifyClass($this->getNameInput());
@@ -165,7 +164,7 @@ public function handle()
165164
$this->alreadyExists($this->getNameInput())) {
166165
$this->components->error($this->type.' already exists.');
167166

168-
return self::FAILURE;
167+
return false;
169168
}
170169

171170
// Next, we will generate the path to the location where this class' file should get
@@ -184,8 +183,6 @@ public function handle()
184183
}
185184

186185
$this->components->info($info.' created successfully.');
187-
188-
return self::SUCCESS;
189186
}
190187

191188
/**
@@ -261,14 +258,12 @@ protected function alreadyExists($rawName)
261258
*
262259
* @param string $name
263260
* @return string
264-
*
265-
* @throws BindingResolutionException
266261
*/
267262
protected function getPath($name)
268263
{
269264
$name = Str::replaceFirst($this->rootNamespace(), '', $name);
270265

271-
return $this->laravel->make('path').'/'.str_replace('\\', '/', $name).'.php';
266+
return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
272267
}
273268

274269
/**
@@ -395,12 +390,10 @@ protected function rootNamespace()
395390
* Get the model for the default guard's user provider.
396391
*
397392
* @return string|null
398-
*
399-
* @throws BindingResolutionException
400393
*/
401394
protected function userProviderModel()
402395
{
403-
$config = $this->laravel->make('config');
396+
$config = $this->laravel['config'];
404397

405398
$provider = $config->get('auth.guards.'.$config->get('auth.defaults.guard').'.provider');
406399

tests/Console/GeneratorCommandTest.php

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)