src/GameOfLife/Field.php
/**
     * Returns the number of neighbor border fields.
     * If the board has no border this function will return 0.
     *
     * @return int The number of neighbor border fields
     */
Returns the number of neighbor border fields.
If the board has no border this function will return 0.

@return int The number of neighbor border fields
Returns the number of neighbor border fields . If the board has no border this function will return 0 . @return int The number of neighbor border fields
public function numberOfNeighborBorderFields(): int
    {
        if ($this->parentBoard->hasBorder())
        {
            $neighbors = $this->parentBoard->getNeighborsOfField($this);
            $numberOfNeighbors = count($neighbors);
            return 8 - $numberOfNeighbors;
        }
        else return 0;
    }
public function numberOfNeighborBorderFields ( ) : int { if ( $ this -> parentBoard -> hasBorder ( ) ) { $ neighbors = $ this -> parentBoard -> getNeighborsOfField ( $ this ) ; $ numberOfNeighbors = count ( $ neighbors ) ; return 8 - $ numberOfNeighbors ; } else return 0 ; }
Returns the number of neighbor border fields.
Returns the number of neighbor border fields .