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

Breadcrumb

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

function PrettyPrinterAbstract::initializeLabelCharMap

Lazily initializes label char map.

The label char map determines whether a certain character may occur in a label.

1 call to PrettyPrinterAbstract::initializeLabelCharMap()
PrettyPrinterAbstract::printFormatPreserving in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Perform a format-preserving pretty print of an AST.

File

vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php, line 1276

Class

PrettyPrinterAbstract

Namespace

PhpParser

Code

protected function initializeLabelCharMap() : void {
    if (isset($this->labelCharMap)) {
        return;
    }
    $this->labelCharMap = [];
    for ($i = 0; $i < 256; $i++) {
        $chr = chr($i);
        $this->labelCharMap[$chr] = $i >= 0x80 || ctype_alnum($chr);
    }
    if ($this->phpVersion
        ->allowsDelInIdentifiers()) {
        $this->labelCharMap[""] = true;
    }
}

API Navigation

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