comparison vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children 5fb285c0d0e3
comparison
equal deleted inserted replaced
11:bfffd8d7479a 12:7a779792577d
372 protected function pExpr_BitwiseNot(Expr\BitwiseNot $node) { 372 protected function pExpr_BitwiseNot(Expr\BitwiseNot $node) {
373 return $this->pPrefixOp('Expr_BitwiseNot', '~', $node->expr); 373 return $this->pPrefixOp('Expr_BitwiseNot', '~', $node->expr);
374 } 374 }
375 375
376 protected function pExpr_UnaryMinus(Expr\UnaryMinus $node) { 376 protected function pExpr_UnaryMinus(Expr\UnaryMinus $node) {
377 if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) {
378 // Enforce -(-$expr) instead of --$expr
379 return '-(' . $this->p($node->expr) . ')';
380 }
377 return $this->pPrefixOp('Expr_UnaryMinus', '-', $node->expr); 381 return $this->pPrefixOp('Expr_UnaryMinus', '-', $node->expr);
378 } 382 }
379 383
380 protected function pExpr_UnaryPlus(Expr\UnaryPlus $node) { 384 protected function pExpr_UnaryPlus(Expr\UnaryPlus $node) {
385 if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) {
386 // Enforce +(+$expr) instead of ++$expr
387 return '+(' . $this->p($node->expr) . ')';
388 }
381 return $this->pPrefixOp('Expr_UnaryPlus', '+', $node->expr); 389 return $this->pPrefixOp('Expr_UnaryPlus', '+', $node->expr);
382 } 390 }
383 391
384 protected function pExpr_PreInc(Expr\PreInc $node) { 392 protected function pExpr_PreInc(Expr\PreInc $node) {
385 return $this->pPrefixOp('Expr_PreInc', '++', $node->var); 393 return $this->pPrefixOp('Expr_PreInc', '++', $node->var);