| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 12 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | protected function isOK() |
||
| 29 | { |
||
| 30 | $this->checkLength($this->value); |
||
| 31 | $lengthOfValue = strlen($this->value); |
||
| 32 | if ($lengthOfValue % 2 != 0) { |
||
| 33 | throw new \InvalidArgumentException('the value ' . $this->value . 'is not valid; characters must appear' . |
||
| 34 | 'in pairs'); |
||
| 35 | } |
||
| 36 | if (!ctype_xdigit($this->value)) { |
||
| 37 | throw new \InvalidArgumentException('the value ' . $this->value . 'contains invalid characters'); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 |