| 1 | <?php |
||
| 9 | abstract class BaseExtension |
||
| 10 | { |
||
| 11 | protected const IDENTIFIERS_SEPARATOR = '.'; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | private $identifiers; |
||
| 17 | |||
| 18 | 90 | protected function __construct(string ...$identifiers) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $identifier |
||
| 29 | * @throws InvalidIdentifierException |
||
| 30 | * @return void |
||
| 31 | */ |
||
| 32 | abstract protected function validate(string $identifier) : void; |
||
| 33 | |||
| 34 | 8 | public static function fromIdentifiers(string $firstIdentifier, string ...$identifiers) |
|
| 38 | |||
| 39 | 33 | public static function fromIdentifiersString(string $identifiers) |
|
| 43 | |||
| 44 | 35 | public function getIdentifiers() : array |
|
| 48 | |||
| 49 | 53 | public function isEmpty() : bool |
|
| 53 | |||
| 54 | 16 | public function __toString() : string |
|
| 58 | } |
||
| 59 |