| Total Complexity | 5 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | trait ModuleTrait |
||
| 20 | { |
||
| 21 | protected string $name; |
||
| 22 | protected string $basePath; |
||
| 23 | protected string $namespace; |
||
| 24 | |||
| 25 | public function boot(): void |
||
| 26 | { |
||
| 27 | $inflector = InflectorFactory::create()->build(); |
||
| 28 | $r = new ReflectionClass(__CLASS__); |
||
| 29 | |||
| 30 | $className = str_replace('Module', '', $r->getShortName()); |
||
| 31 | $this->name = $inflector->tableize($className); |
||
| 32 | $this->basePath = \dirname($r->getFileName()); |
||
| 33 | $this->namespace = $r->getNamespaceName(); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getName(): string |
||
| 37 | { |
||
| 38 | return $this->name; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getBasePath(): string |
||
| 42 | { |
||
| 43 | return $this->basePath; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getNamespace(): string |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return array<array-key,string|class-string> |
||
|
|
|||
| 53 | * @codeCoverageIgnore |
||
| 54 | */ |
||
| 55 | public function getResolveTargetEntities(): array |
||
| 60 |