Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NumberFormatException.php

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\Exception

Code

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));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal