| Total Complexity | 5 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class DefinitionNamespace |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $bundle; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | protected $node; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * DefinitionNamespace constructor. |
||
| 30 | * |
||
| 31 | * @param string $bundle |
||
| 32 | * @param string $node |
||
| 33 | */ |
||
| 34 | public function __construct(?string $bundle, ?string $node) |
||
| 35 | { |
||
| 36 | if (!$bundle && !$node) { |
||
| 37 | throw new \InvalidArgumentException('Must define a bundle or node name to create a valid definition namespace'); |
||
| 38 | } |
||
| 39 | $this->bundle = $bundle; |
||
| 40 | $this->node = $node; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function getBundle(): ?string |
||
| 47 | { |
||
| 48 | return $this->bundle; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function getNode(): ?string |
||
| 57 | } |
||
| 58 | } |
||
| 59 |