public final function delegate(Elevator $elevator, $signal) { if (is_null($this->nextProcessor)) { throw new Exception("Unrecognized signal received: " . print_r($signal)); } return $this->nextProcessor->handleSignal($elevator, $signal); }
/** @return Elevator */ public function sendSignal($signal) { $this->process(); $state = $this->signalProcessor->handleSignal($this, $signal); if (!is_null($state)) { $this->state = $state; $this->resetTimeStamp(); } return $this; }