src/GameOfLife/Inputs/BoardEditor/BoardEditor.php
/**
     * Reads an input coordinate.
     *
     * @param String $_coordinateAxisName The name of the coordinate axis ("X" or "Y")
     * @param String $_coordinateDescription The description of the coordinate
     * @param int $_minValue The minimum value of the coordinate
     * @param int $_maxValue The maximum value of the coordinate
     *
     * @return int The read coordinate
     *
     * @throws \Exception The exception when the input value is invalid
     */
Reads an input coordinate.
@param String $_coordinateAxisName The name of the coordinate axis ("X" or "Y")
@param String $_coordinateDescription The description of the coordinate
@param int $_minValue The minimum value of the coordinate
@param int $_maxValue The maximum value of the coordinate

@return int The read coordinate

@throws \Exception The exception when the input value is invalid
Reads an input coordinate . @param String $_coordinateAxisName The name of the coordinate axis ( " X " or " Y " ) @param String $_coordinateDescription The description of the coordinate @param int $_minValue The minimum value of the coordinate @param int $_maxValue The maximum value of the coordinate @return int The read coordinate @throws \ Exception The exception when the input value is invalid
public function readCoordinate(String $_coordinateAxisName, String $_coordinateDescription, int $_minValue, int $_maxValue): int
    {
        $userInput = $this->readInput($_coordinateAxisName . "-Coordinate of the " . $_coordinateDescription . ": ");
        if (! is_numeric($userInput)) throw new \Exception("The input value is no number.");
        else
        {
            $coordinate = (int)$userInput;
            $this->checkCoordinate($coordinate, $_coordinateAxisName, $_minValue, $_maxValue);
        }
        return $coordinate;
    }
public function readCoordinate ( String $ _coordinateAxisName , String $ _coordinateDescription , int $ _minValue , int $ _maxValue ) : int { $ userInput = $ this -> readInput ( $ _coordinateAxisName . " -Coordinate of the  " . $ _coordinateDescription . " :  " ) ; if ( ! is_numeric ( $ userInput ) ) throw new \ Exception ( " The input value is no number. " ) ; else { $ coordinate = ( int ) $ userInput ; $ this -> checkCoordinate ( $ coordinate , $ _coordinateAxisName , $ _minValue , $ _maxValue ) ; } return $ coordinate ; }
Reads an input coordinate.
Reads an input coordinate .