| Total Complexity | 3 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class Primitive implements Type |
||
| 12 | { |
||
| 13 | private $function; |
||
| 14 | |||
| 15 | 9 | public function __construct(string $primitive) |
|
| 16 | { |
||
| 17 | 9 | if (!function_exists('is_'.$primitive)) { |
|
| 18 | 1 | throw new NotAPrimitiveType($primitive); |
|
| 19 | } |
||
| 20 | |||
| 21 | 8 | $this->function = 'is_'.$primitive; |
|
| 22 | 8 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | 6 | public function accepts($value): bool |
|
| 30 | } |
||
| 31 | } |
||
| 32 |