| 1 | <?php |
||
| 7 | final class ImmutableKeyValuePair implements KeyValuePairInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The key in the key/value pair. |
||
| 11 | * |
||
| 12 | * @var mixed |
||
| 13 | */ |
||
| 14 | private $key; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The value in the key/value pair. |
||
| 18 | * |
||
| 19 | * @var mixed |
||
| 20 | */ |
||
| 21 | private $value; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Construct a new KeyValuePair. |
||
| 25 | * |
||
| 26 | * @param mixed $key The key of the pair. |
||
| 27 | * @param mixed $value The value of the pair. |
||
| 28 | */ |
||
| 29 | public function __construct($key, $value) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Gets the key in the key/value pair. |
||
| 37 | * |
||
| 38 | * @return mixed |
||
| 39 | */ |
||
| 40 | public function getKey() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Gets the value in the key/value pair. |
||
| 47 | * |
||
| 48 | * @return mixed |
||
| 49 | */ |
||
| 50 | public function getValue() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Ensures deep copy when cloning. |
||
| 57 | * |
||
| 58 | * @return void |
||
| 59 | */ |
||
| 60 | public function __clone() |
||
| 65 | } |
||
| 66 |