| Total Complexity | 6 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | trait NamespaceTrait |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * @var string[] $namespace A string[] describing a namespace. |
||
| 29 | */ |
||
| 30 | protected $namespace = []; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string[] $namespace The new namespace to be set. |
||
| 34 | */ |
||
| 35 | public function setNamespace(array $namespace): void |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return string[] The current namespace. |
||
| 42 | */ |
||
| 43 | public function getNamespace(): array |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return string|null The concat namespace parts. |
||
| 50 | */ |
||
| 51 | public function getNamespaceString(): ?string |
||
| 52 | { |
||
| 53 | return Validator::notEmpty()->validate($this->namespace)? |
||
| 54 | implode('\\', $this->namespace) : |
||
| 55 | null; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return string|null The last namespace part. |
||
| 60 | */ |
||
| 61 | public function getNamespaceLast(): ?string |
||
| 66 | } |
||
| 67 | } |
||
| 68 |