| Total Complexity | 8 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | final class NamedEntry implements Entry |
||
| 18 | { |
||
| 19 | /** @var StringScalar|IntegerScalar|ConstantFetch|ClassConstantFetch */ |
||
| 20 | private $key; |
||
| 21 | |||
| 22 | /** @var ValuableNode */ |
||
| 23 | private $value; |
||
| 24 | |||
| 25 | public function __construct(Value $key, ValuableNode $value) |
||
| 26 | { |
||
| 27 | assert( |
||
| 28 | $key instanceof StringScalar |
||
| 29 | || $key instanceof IntegerScalar |
||
| 30 | || $key instanceof Identifier |
||
| 31 | || $key instanceof ConstantFetch |
||
| 32 | || $key instanceof ClassConstantFetch |
||
| 33 | ); |
||
| 34 | |||
| 35 | $this->key = $key; |
||
| 36 | $this->value = $value; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return ClassConstantFetch|ConstantFetch|IntegerScalar|StringScalar|null |
||
| 41 | */ |
||
| 42 | public function getKey() : ?Value |
||
| 43 | { |
||
| 44 | return $this->key; |
||
|
|
|||
| 45 | } |
||
| 46 | |||
| 47 | public function getValue() : ValuableNode |
||
| 50 | } |
||
| 51 | |||
| 52 | public function dispatch(Visitor $visitor) : void |
||
| 57 |