| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class SimpleProvider implements DataProviderInterface |
||
| 9 | { |
||
| 10 | use BaseNameTrait; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $entityClassName; |
||
| 16 | |||
| 17 | 13 | public function __construct(string $entityClassName) |
|
| 20 | 13 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * @return array |
||
| 24 | * @throws \ReflectionException |
||
| 25 | */ |
||
| 26 | 8 | public function provide(): array |
|
| 27 | { |
||
| 28 | return [ |
||
| 29 | 8 | 'ns' => $this->getNs(), |
|
| 30 | 8 | 'useStatement' => ltrim($this->entityClassName, '\\'), |
|
| 31 | 8 | 'entityName' => $this->getBaseName(), |
|
| 32 | ]; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $type |
||
| 37 | * @return string |
||
| 38 | * @throws \ReflectionException |
||
| 39 | */ |
||
| 40 | 5 | public function getClassName(string $type): string |
|
| 49 | } |
||
| 50 | |||
| 51 | 13 | private function getNs(): string |
|
| 59 | } |
||
| 60 | } |
||
| 61 |