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

Breadcrumb

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

function Standard::pStmt_Else

File

vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php, line 907

Class

Standard

Namespace

PhpParser\PrettyPrinter

Code

protected function pStmt_Else(Stmt\Else_ $node) : string {
    if (\count($node->stmts) === 1 && $node->stmts[0] instanceof Stmt\If_) {
        // Print as "else if" rather than "else { if }"
        return 'else ' . $this->p($node->stmts[0]);
    }
    return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}';
}

API Navigation

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