File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
src/Illuminate/Foundation/Console Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,21 @@ protected function getStub()
4040 return __DIR__ .'/stubs/interface.stub ' ;
4141 }
4242
43+ /**
44+ * Get the default namespace for the class.
45+ *
46+ * @param string $rootNamespace
47+ * @return string
48+ */
49+ protected function getDefaultNamespace ($ rootNamespace )
50+ {
51+ return match (true ) {
52+ is_dir (app_path ('Contracts ' )) => $ rootNamespace .'\\Contracts ' ,
53+ is_dir (app_path ('Interfaces ' )) => $ rootNamespace .'\\Interfaces ' ,
54+ default => $ rootNamespace ,
55+ };
56+ }
57+
4358 /**
4459 * Get the console command arguments.
4560 *
Original file line number Diff line number Diff line change @@ -53,6 +53,21 @@ protected function resolveStubPath($stub)
5353 : __DIR__ .$ stub ;
5454 }
5555
56+ /**
57+ * Get the default namespace for the class.
58+ *
59+ * @param string $rootNamespace
60+ * @return string
61+ */
62+ protected function getDefaultNamespace ($ rootNamespace )
63+ {
64+ return match (true ) {
65+ is_dir (app_path ('Concerns ' )) => $ rootNamespace .'\\Concerns ' ,
66+ is_dir (app_path ('Traits ' )) => $ rootNamespace .'\\Traits ' ,
67+ default => $ rootNamespace ,
68+ };
69+ }
70+
5671 /**
5772 * Get the console command arguments.
5873 *
You can’t perform that action at this time.
0 commit comments