function NumberFormatException::charNotInAlphabet
@psalm-pure
Parameters
string $char The failing character.:
1 call to NumberFormatException::charNotInAlphabet()
- BigInteger::fromArbitraryBase in vendor/
brick/ math/ src/ BigInteger.php - Parses a string containing an integer in an arbitrary base, using a custom alphabet.
File
-
vendor/
brick/ math/ src/ Exception/ NumberFormatException.php, line 25
Class
- NumberFormatException
- Exception thrown when attempting to create a number from a string with an invalid format.
Namespace
Brick\Math\ExceptionCode
public static function charNotInAlphabet(string $char) : self {
$ord = \ord($char);
if ($ord < 32 || $ord > 126) {
$char = \strtoupper(\dechex($ord));
if ($ord < 10) {
$char = '0' . $char;
}
}
else {
$char = '"' . $char . '"';
}
return new self(\sprintf('Char %s is not a valid character in the given alphabet.', $char));
}