protected function popState() { if (0 === count($this->states)) { throw new Exception('Cannot pop state without a previous state'); } $this->state = array_pop($this->states); }