Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | final class ConstantStringType extends GenericStringType implements ConstantScalarType |
||
16 | { |
||
17 | /** @var string */ |
||
18 | private $value; |
||
19 | |||
20 | 5 | public function __construct(string $value) |
|
21 | { |
||
22 | 5 | $this->value = $value; |
|
23 | 5 | } |
|
24 | |||
25 | 1 | public function getValue() : string |
|
26 | { |
||
27 | 1 | return $this->value; |
|
28 | } |
||
29 | |||
30 | 3 | public function describe() : string |
|
31 | { |
||
32 | 3 | return sprintf('"%s"', addcslashes($this->value, '\"')); |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param mixed $value |
||
37 | */ |
||
38 | 3 | public function validate($value) : bool |
|
41 | } |
||
42 | } |
||
43 |