Total Complexity | 11 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
14 | class MapType implements Type |
||
15 | { |
||
16 | /** @var ScalarType|UnionType */ |
||
17 | private $keyType; |
||
18 | |||
19 | /** @var Type */ |
||
20 | private $valueType; |
||
21 | |||
22 | public function __construct(Type $keyType, Type $valueType) |
||
31 | } |
||
32 | |||
33 | public function getKeyType() : ScalarType |
||
34 | { |
||
35 | return $this->keyType; |
||
|
|||
36 | } |
||
37 | |||
38 | public function getValueType() : Type |
||
39 | { |
||
40 | return $this->valueType; |
||
41 | } |
||
42 | |||
43 | public function describe() : string |
||
44 | { |
||
45 | return sprintf('array<%s, %s>', $this->keyType->describe(), $this->valueType->describe()); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param mixed $value |
||
50 | */ |
||
51 | public function validate($value) : bool |
||
68 | } |
||
69 | |||
70 | public function acceptsNull() : bool |
||
73 | } |
||
74 | } |
||
75 |