<?phpdeclare(strict_types=1);namespaceBrick\Math\Exception;/** * Exception thrown when attempting to create a number from a string with an invalid format. */classNumberFormatExceptionextendsMathException{/** * @param string $char The failing character. * * @return NumberFormatException * * @psalm-pure */publicstaticfunctioncharNotInAlphabet(string$char):self{$ord=\ord($char);if($ord<32||$ord>126){$char=\strtoupper(\dechex($ord));if($ord<10){$char='0'.$char;}}else{$char='"'.$char.'"';}returnnewself(sprintf('Char %s is not a valid character in the given alphabet.',$char));}}