GraphQL\Utils::printCharCode PHP Метод

printCharCode() публичный статический Метод

public static printCharCode ( $code ) : string
$code
Результат string
    public static function printCharCode($code)
    {
        if (null === $code) {
            return '<EOF>';
        }
        return $code < 0x7f ? json_encode(Utils::chr($code)) : '"\\u' . dechex($code) . '"';
    }

Usage Example

Пример #1
0
 private function assertValidStringCharacterCode($code, $position)
 {
     // SourceCharacter
     if ($code < 0x20 && $code !== 0x9) {
         throw new SyntaxError($this->source, $position, "Invalid character within String: " . Utils::printCharCode($code));
     }
 }