| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class SimpleProvider implements DataProviderInterface |
||
| 9 | { |
||
| 10 | use NamingTrait, ControllerNamingTrait { |
||
| 11 | NamingTrait::getBaseName insteadof ControllerNamingTrait; |
||
| 12 | NamingTrait::getNs insteadof ControllerNamingTrait; |
||
| 13 | ControllerNamingTrait::getNs as getControllerNs; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $entityClassName; |
||
| 20 | |||
| 21 | 2 | public function __construct(string $entityClassName) |
|
| 22 | { |
||
| 23 | 2 | $this->entityClassName = $entityClassName; |
|
| 24 | 2 | } |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @return array |
||
| 28 | * @throws \ReflectionException |
||
| 29 | */ |
||
| 30 | 1 | public function provide(): array |
|
| 31 | { |
||
| 32 | return [ |
||
| 33 | 1 | 'ns' => $this->getNs($this->entityClassName), |
|
| 34 | 1 | 'controllerNs' => $this->getControllerNs($this->entityClassName), |
|
| 35 | 1 | 'entityName' => $this->getBaseName($this->entityClassName), |
|
| 36 | ]; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return string |
||
| 41 | * @throws \ReflectionException |
||
| 42 | */ |
||
| 43 | 1 | public function getClassName(): string |
|
| 46 | } |
||
| 47 | } |
||
| 48 |