public function segment($id) { if (in_array($id, array_keys($this->segments))) { return $this->segments[$id]; } else { throw new OutOfRangeException("Invalid argument provided, no segment is present with id: {$id}!"); } }
/** * @Test */ public function testRemoveWithReorder() { $this->bread->append('one'); $this->bread->append('two'); $this->bread->remove(0, true); $this->assertEquals('two', $this->bread->segment(0)->get('raw')); }