src/Player.php
public function move($move)
    {
        $last_move = $this->getLastMoveIndex();
        
        if (is_array($last_move) && array_shift($last_move) === false)
        {
            throw new RockPaperScissorsSpockLizardException('Cannot set another move until the previous move has been played');
        }
        
        if (empty($move)) {
            throw new RockPaperScissorsSpockLizardException('Move cannot be empty');
        }
        
        $this->moves[] = [$move => false];
        
        return $this;
    }
public function move($move)
    {
        $last_move = $this->getLastMoveIndex();
        
        if (is_array($last_move) && array_shift($last_move) === false)
        {
            throw new RockPaperScissorsSpockLizardException('Cannot set another move until the previous move has been played');
        }
        
        if (empty($move)) {
            throw new RockPaperScissorsSpockLizardException('Move cannot be empty');
        }
        
        $this->moves[] = [$move => false];
        
        return $this;
    }
public function move ( $ move ) { $ last_move = $ this -> getLastMoveIndex ( ) ; if ( is_array ( $ last_move ) && array_shift ( $ last_move ) === false ) { throw new RockPaperScissorsSpockLizardException ( 'Cannot set another move until the previous move has been played' ) ; } if ( empty ( $ move ) ) { throw new RockPaperScissorsSpockLizardException ( 'Move cannot be empty' ) ; } $ this -> moves [ ] = [ $ move => false ] ; return $ this ; }
Queue a play
@param $move
@return $this
@throws RockPaperScissorsSpockLizardException
Queue a play