/** * Return the expressions being echoed. * * @return NodeCollection|ExpressionNode[] */ public function getExpressions() { return $this->expressions->getItems(); }
public function testToArrayNode() { $list = new CommaListNode(); $list->appendItem(Node::fromValue('foo')); $list->appendItem(Node::fromValue('baz')); $list->appendItem(Node::fromValue(30)); $array = $list->toArrayNode(); $this->assertInstanceOf('\\Pharborist\\Types\\ArrayNode', $array); /** @var \PHarborist\Types\ScalarNode[] $elements */ $elements = $array->getElements(); $this->assertCount(3, $elements); $this->assertInstanceOf('\\Pharborist\\Types\\StringNode', $elements[0]); $this->assertEquals('foo', $elements[0]->toValue()); $this->assertInstanceOf('\\Pharborist\\Types\\StringNode', $elements[1]); $this->assertEquals('baz', $elements[1]->toValue()); $this->assertInstanceOf('\\Pharborist\\Types\\IntegerNode', $elements[2]); $this->assertEquals(30, $elements[2]->toValue()); $this->assertEquals("['foo', 'baz', 30]", $array->getText()); }