/** * Checks if current position is valid. * * @return bool Returns true on success, false otherwise */ public function valid() { if (is_null($this->current)) { return !empty($this->branch); } if ($this->current instanceof RecursiveLeafInterface) { return $this->current->valid(); } return false; }
public function testGetReturnsDefault() { $leaf = new RecursiveLeaf(); $this->assertSame('bar', $leaf->get('foo', 'bar')); }