コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 public function testGetReturnsDefault()
 {
     $leaf = new RecursiveLeaf();
     $this->assertSame('bar', $leaf->get('foo', 'bar'));
 }