| 1 | <?php namespace GenericCollections; |
||
| 7 | class Map extends AbstractMap |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var TypeProperty |
||
| 11 | */ |
||
| 12 | private $valueType; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var TypeKeyProperty |
||
| 16 | */ |
||
| 17 | private $keyType; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Comparison types |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | private $comparisonIdentical; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Generic map |
||
| 27 | * |
||
| 28 | * example: |
||
| 29 | * ```php |
||
| 30 | * new Map('string', Foo::class, [ |
||
| 31 | * 'one' => new Foo(), |
||
| 32 | * 'two' => new Foo(), |
||
| 33 | * ]; |
||
| 34 | * ``` |
||
| 35 | * |
||
| 36 | * @param string $keyType |
||
| 37 | * @param string $valueType |
||
| 38 | * @param array $values |
||
| 39 | * @param bool $comparisonIdentical |
||
| 40 | */ |
||
| 41 | public function __construct($keyType, $valueType, array $values = [], $comparisonIdentical = true) |
||
| 48 | |||
| 49 | // implements MapInterface::getKeyType : bool |
||
| 50 | public function getKeyType() |
||
| 54 | |||
| 55 | // implements MapInterface::getValueType : bool |
||
| 56 | public function getValueType() |
||
| 60 | |||
| 61 | // implements MapInterface::comparisonMethodIsIdentical : bool |
||
| 62 | public function comparisonMethodIsIdentical() |
||
| 66 | } |
||
| 67 |