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

Breadcrumb

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

function Standard::pExpr_Yield

File

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

Class

Standard

Namespace

PhpParser\PrettyPrinter

Code

protected function pExpr_Yield(Expr\Yield_ $node, int $precedence, int $lhsPrecedence) : string {
    if ($node->value === null) {
        $opPrecedence = $this->precedenceMap[Expr\Yield_::class][0];
        return $opPrecedence >= $lhsPrecedence ? '(yield)' : 'yield';
    }
    else {
        if (!$this->phpVersion
            ->supportsYieldWithoutParentheses()) {
            return '(yield ' . $this->pKey($node->key) . $this->p($node->value) . ')';
        }
        return $this->pPrefixOp(Expr\Yield_::class, 'yield ' . $this->pKey($node->key), $node->value, $precedence, $lhsPrecedence);
    }
}

API Navigation

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