function Standard::pExpr_Yield
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinter/ Standard.php, line 733
Class
Namespace
PhpParser\PrettyPrinterCode
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);
}
}