| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 63.64% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class Identifier { |
||
| 18 | private $parts; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Identifier constructor. |
||
| 22 | * @param string ...$identifier |
||
| 23 | */ |
||
| 24 | 6 | public function __construct(...$identifier) { |
|
| 25 | 6 | if (empty($identifier) || empty($identifier[0])) { |
|
| 26 | throw new \InvalidArgumentException("The identifier is empty.", 500); |
||
| 27 | } |
||
| 28 | 6 | if (count($identifier) === 1) { |
|
| 29 | 6 | $this->parts = explode('.', $identifier[0]); |
|
| 30 | } else { |
||
| 31 | $this->parts = $identifier; |
||
| 32 | } |
||
| 33 | 6 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Convert the identifier to a simple string. |
||
| 37 | * |
||
| 38 | * @return string Returns the identifier as a string. |
||
| 39 | */ |
||
| 40 | public function __toString() { |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Escape the identifier. |
||
| 46 | * |
||
| 47 | * @param Db $db The database used to escape the identifier. |
||
| 48 | * @return string Returns the full escaped identifier. |
||
| 49 | */ |
||
| 50 | 6 | public function escape(Db $db) { |
|
| 54 |