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

Breadcrumb

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

function PrettyPrinterAbstract::staticDereferenceLhsRequiresParens

Determines whether the LHS of a static operation must be wrapped in parentheses.

Parameters

Node $node LHS of dereferencing operation:

Return value

bool Whether parentheses are required

3 calls to PrettyPrinterAbstract::staticDereferenceLhsRequiresParens()
PrettyPrinterAbstract::dereferenceLhsRequiresParens in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Determines whether the LHS of an array/object operation must be wrapped in parentheses.
PrettyPrinterAbstract::pFixup in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Print node with fixups.
Standard::pStaticDereferenceLhs in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php

File

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

Class

PrettyPrinterAbstract

Namespace

PhpParser

Code

protected function staticDereferenceLhsRequiresParens(Node $node) : bool {
    return !($node instanceof Expr\Variable || $node instanceof Node\Name || $node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || $node instanceof Expr\NullsafePropertyFetch || $node instanceof Expr\StaticPropertyFetch || $node instanceof Expr\FuncCall || $node instanceof Expr\MethodCall || $node instanceof Expr\NullsafeMethodCall || $node instanceof Expr\StaticCall || $node instanceof Expr\Array_ || $node instanceof Scalar\String_ || $node instanceof Expr\ClassConstFetch);
}

API Navigation

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