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);
 }
Exemple #2
0
 /** @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;
 }