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

Breadcrumb

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

function PrettyPrinterAbstract::handleMagicTokens

Handles (and removes) doc-string-end tokens.

3 calls to PrettyPrinterAbstract::handleMagicTokens()
PrettyPrinterAbstract::prettyPrint in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Pretty prints an array of statements.
PrettyPrinterAbstract::prettyPrintExpr in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Pretty prints an expression.
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 327

Class

PrettyPrinterAbstract

Namespace

PhpParser

Code

protected function handleMagicTokens(string $str) : string {
    if ($this->docStringEndToken !== null) {
        // Replace doc-string-end tokens with nothing or a newline
        $str = str_replace($this->docStringEndToken . ';' . $this->newline, ';' . $this->newline, $str);
        $str = str_replace($this->docStringEndToken, $this->newline, $str);
    }
    return $str;
}

API Navigation

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