File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 11
11
*/
12
12
class MakeService extends GeneratorCommand
13
13
{
14
+ /**
15
+ * STUB_PATH
16
+ */
17
+ const STUB_PATH = __DIR__ . ' /Stubs/ ' ;
18
+
14
19
/**
15
20
* The name and signature of the console command.
16
21
*
@@ -40,19 +45,16 @@ protected function getStub() { }
40
45
*/
41
46
protected function getServiceStub (bool $ isContract ): string
42
47
{
43
- if ($ isContract ) {
44
- return __DIR__ . '/Stubs/service.stub ' ;
45
- }
46
-
47
- return __DIR__ . '/Stubs/service.origin.stub ' ;
48
+ return self ::STUB_PATH .
49
+ $ isContract ? 'service.origin.stub ' : 'service.stub ' ;
48
50
}
49
51
50
52
/**
51
53
* @return string
52
54
*/
53
55
protected function getServiceContractStub (): string
54
56
{
55
- return __DIR__ . '/Stubs/ service.contract.stub ' ;
57
+ return self :: STUB_PATH . 'service.contract.stub ' ;
56
58
}
57
59
58
60
/**
@@ -95,7 +97,7 @@ public function handle()
95
97
if ($ isContract ) {
96
98
$ contractName = $ this ->getNameInput () . 'Contract.php ' ;
97
99
$ contractPath = str_replace ($ this ->getNameInput () . '.php ' , 'Contracts/ ' , $ path );
98
-
100
+
99
101
$ this ->makeDirectory ($ contractPath . $ contractName );
100
102
101
103
$ this ->files ->put ($ contractPath . $ contractName ,
You can’t perform that action at this time.
0 commit comments