Nelmio\Alice\Definition\Value\DynamicArrayValue::getValue PHP Method

getValue() public method

public getValue ( ) : array
return array The first element is the quantifier and the second the element.
    public function getValue() : array
    {
        return [$this->getQuantifier(), $this->getElement()];
    }

Usage Example

Example #1
0
 public function testIsImmutable()
 {
     $quantifier = new MutableValue('q0');
     $elementValue = new MutableValue('e0');
     $value = new DynamicArrayValue($quantifier, $elementValue);
     // Mutate injected values
     $quantifier->setValue('q1');
     $elementValue->setValue('e1');
     // Mutate returned values
     $value->getQuantifier()->setValue('q2');
     $value->getElement()->setValue('e2');
     $this->assertEquals(new MutableValue('q0'), $value->getQuantifier());
     $this->assertEquals(new MutableValue('e0'), $value->getElement());
     $this->assertEquals([new MutableValue('q0'), new MutableValue('e0')], $value->getValue());
 }