Esempio n. 1
0
 /**
  * @param string $notation
  *
  * @return string
  */
 private function extractPieceType($notation)
 {
     if (strlen($notation) === 2) {
         return PieceInterface::TYPE_PAWN;
     }
     if (strlen($notation) === 4 && ctype_lower(substr($notation, 0, 1)) === true) {
         return PieceInterface::TYPE_PAWN;
     }
     $firstCharacter = substr($notation, 0, 1);
     return PieceDecorator::getTypeFromLetter($firstCharacter);
 }