Exemplo n.º 1
0
 /**
  * @param Io|null $fillFromIo
  * @return State
  * @return static
  */
 public static function createState(Io $fillFromIo = null)
 {
     $commandClass = get_called_class();
     /** @var State $state */
     $state = null;
     if ($fillFromIo !== null) {
         $state = $fillFromIo->getRequestState($commandClass);
         if (!$state) {
             $state = new State();
         }
         $state->setIo($fillFromIo);
     } else {
         $state = new State();
     }
     $state->commandClass = $commandClass;
     return $state;
 }