3
3
namespace Illuminate \Console ;
4
4
5
5
use Illuminate \Console \Concerns \CreatesMatchingTest ;
6
- use Illuminate \Contracts \Container \BindingResolutionException ;
7
6
use Illuminate \Filesystem \Filesystem ;
8
7
use Illuminate \Support \Str ;
9
8
use Symfony \Component \Console \Input \InputArgument ;
@@ -138,7 +137,7 @@ abstract protected function getStub();
138
137
/**
139
138
* Execute the console command.
140
139
*
141
- * @return int|void
140
+ * @return bool|null
142
141
*
143
142
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
144
143
*/
@@ -150,7 +149,7 @@ public function handle()
150
149
if ($ this ->isReservedName ($ this ->getNameInput ())) {
151
150
$ this ->components ->error ('The name " ' .$ this ->getNameInput ().'" is reserved by PHP. ' );
152
151
153
- return self :: FAILURE ;
152
+ return false ;
154
153
}
155
154
156
155
$ name = $ this ->qualifyClass ($ this ->getNameInput ());
@@ -165,7 +164,7 @@ public function handle()
165
164
$ this ->alreadyExists ($ this ->getNameInput ())) {
166
165
$ this ->components ->error ($ this ->type .' already exists. ' );
167
166
168
- return self :: FAILURE ;
167
+ return false ;
169
168
}
170
169
171
170
// Next, we will generate the path to the location where this class' file should get
@@ -184,8 +183,6 @@ public function handle()
184
183
}
185
184
186
185
$ this ->components ->info ($ info .' created successfully. ' );
187
-
188
- return self ::SUCCESS ;
189
186
}
190
187
191
188
/**
@@ -261,14 +258,12 @@ protected function alreadyExists($rawName)
261
258
*
262
259
* @param string $name
263
260
* @return string
264
- *
265
- * @throws BindingResolutionException
266
261
*/
267
262
protected function getPath ($ name )
268
263
{
269
264
$ name = Str::replaceFirst ($ this ->rootNamespace (), '' , $ name );
270
265
271
- return $ this ->laravel -> make ( 'path ' ) .'/ ' .str_replace ('\\' , '/ ' , $ name ).'.php ' ;
266
+ return $ this ->laravel [ 'path ' ] .'/ ' .str_replace ('\\' , '/ ' , $ name ).'.php ' ;
272
267
}
273
268
274
269
/**
@@ -395,12 +390,10 @@ protected function rootNamespace()
395
390
* Get the model for the default guard's user provider.
396
391
*
397
392
* @return string|null
398
- *
399
- * @throws BindingResolutionException
400
393
*/
401
394
protected function userProviderModel ()
402
395
{
403
- $ config = $ this ->laravel -> make ( 'config ' ) ;
396
+ $ config = $ this ->laravel [ 'config ' ] ;
404
397
405
398
$ provider = $ config ->get ('auth.guards. ' .$ config ->get ('auth.defaults.guard ' ).'.provider ' );
406
399
0 commit comments