@@ -13,18 +13,18 @@ |
||
| 13 | 13 | use Psalm\Plugin\EventHandler\Event\AfterExpressionAnalysisEvent; |
| 14 | 14 | |
| 15 | 15 | class LogicalOperatorChecker implements AfterExpressionAnalysisInterface { |
| 16 | - public static function afterExpressionAnalysis(AfterExpressionAnalysisEvent $event): ?bool { |
|
| 17 | - $stmt = $event->getExpr(); |
|
| 18 | - if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\LogicalAnd |
|
| 19 | - || $stmt instanceof PhpParser\Node\Expr\BinaryOp\LogicalOr) { |
|
| 20 | - IssueBuffer::maybeAdd( |
|
| 21 | - new \Psalm\Issue\UnrecognizedExpression( |
|
| 22 | - 'Logical binary operators AND and OR are not allowed in the Nextcloud codebase', |
|
| 23 | - new CodeLocation($event->getStatementsSource()->getSource(), $stmt), |
|
| 24 | - ), |
|
| 25 | - $event->getStatementsSource()->getSuppressedIssues(), |
|
| 26 | - ); |
|
| 27 | - } |
|
| 28 | - return null; |
|
| 29 | - } |
|
| 16 | + public static function afterExpressionAnalysis(AfterExpressionAnalysisEvent $event): ?bool { |
|
| 17 | + $stmt = $event->getExpr(); |
|
| 18 | + if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\LogicalAnd |
|
| 19 | + || $stmt instanceof PhpParser\Node\Expr\BinaryOp\LogicalOr) { |
|
| 20 | + IssueBuffer::maybeAdd( |
|
| 21 | + new \Psalm\Issue\UnrecognizedExpression( |
|
| 22 | + 'Logical binary operators AND and OR are not allowed in the Nextcloud codebase', |
|
| 23 | + new CodeLocation($event->getStatementsSource()->getSource(), $stmt), |
|
| 24 | + ), |
|
| 25 | + $event->getStatementsSource()->getSuppressedIssues(), |
|
| 26 | + ); |
|
| 27 | + } |
|
| 28 | + return null; |
|
| 29 | + } |
|
| 30 | 30 | } |