public function emitState($e, $state, $currentState) { if ($currentState === $state && $this->lastState !== $state) { $this->emit($e, []); } }