1 | <?php |
||
35 | class ModulePublishCommand extends Command |
||
36 | { |
||
37 | /** @var string */ |
||
38 | protected $name = 'ytake:aspect-module-publish'; |
||
39 | |||
40 | /** @var string */ |
||
41 | protected $description = 'Publish any aspect modules from ytake/laravel-aspect'; |
||
42 | |||
43 | /** @var Filesystem */ |
||
44 | protected $filesystem; |
||
45 | |||
46 | /** @var string */ |
||
47 | protected $classPath = 'Modules'; |
||
48 | |||
49 | /** @var array package modules */ |
||
50 | protected $modules = [ |
||
51 | 'CacheableModule' => 'Ytake\LaravelAspect\Modules\CacheableModule', |
||
52 | 'CacheEvictModule' => 'Ytake\LaravelAspect\Modules\CacheEvictModule', |
||
53 | 'CachePutModule' => 'Ytake\LaravelAspect\Modules\CachePutModule', |
||
54 | 'TransactionalModule' => 'Ytake\LaravelAspect\Modules\TransactionalModule', |
||
55 | 'LoggableModule' => 'Ytake\LaravelAspect\Modules\LoggableModule', |
||
56 | 'LogExceptionsModule' => 'Ytake\LaravelAspect\Modules\LogExceptionsModule', |
||
57 | 'PostConstructModule' => 'Ytake\LaravelAspect\Modules\PostConstructModule', |
||
58 | 'RetryOnFailureModule' => 'Ytake\LaravelAspect\Modules\RetryOnFailureModule', |
||
59 | 'MessageDrivenModule' => 'Ytake\LaravelAspect\Modules\MessageDrivenModule', |
||
60 | 'QueryLogModule' => 'Ytake\LaravelAspect\Modules\QueryLogModule', |
||
61 | ]; |
||
62 | |||
63 | /** |
||
64 | * @param Filesystem $filesystem |
||
65 | */ |
||
66 | public function __construct(Filesystem $filesystem) |
||
71 | |||
72 | /** |
||
73 | * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException |
||
74 | * @throws \ReflectionException |
||
75 | */ |
||
76 | public function handle(): void |
||
106 | |||
107 | /** |
||
108 | * @return array |
||
109 | */ |
||
110 | protected function getArguments() |
||
116 | |||
117 | /** |
||
118 | * @param string $name |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | protected function getPath(string $name): string |
||
128 | |||
129 | /** |
||
130 | * Parse the name and format according to the root namespace. |
||
131 | * |
||
132 | * @param string $name |
||
133 | * @param string|null $moduleDirectory |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | protected function parseClassName(string $name, string $moduleDirectory = null): string |
||
153 | |||
154 | /** |
||
155 | * added custom aspect module, override package modules |
||
156 | * |
||
157 | * @param string $module |
||
158 | * |
||
159 | * @return ModulePublishCommand |
||
160 | */ |
||
161 | protected function addModule(string $module): self |
||
167 | |||
168 | /** |
||
169 | * Build the directory for the class if necessary. |
||
170 | * |
||
171 | * @param string $path |
||
172 | */ |
||
173 | protected function makeDirectory(string $path): void |
||
179 | |||
180 | /** |
||
181 | * @param string $module |
||
182 | * |
||
183 | * @return string |
||
184 | * @throws \ReflectionException |
||
185 | */ |
||
186 | protected function getExtendsClassName(string $module): string |
||
193 | |||
194 | /** |
||
195 | * @return string |
||
196 | */ |
||
197 | protected function stub(): string |
||
202 | } |
||
203 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.