@@ 103-110 (lines=8) @@ | ||
100 | public $errors = []; |
|
101 | ||
102 | public function enterNode(Node $node) { |
|
103 | if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\Equal) { |
|
104 | $this->errors[]= [ |
|
105 | 'disallowedToken' => '==', |
|
106 | 'errorCode' => CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED, |
|
107 | 'line' => $node->getLine(), |
|
108 | 'reason' => $this->buildReason('==', CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED) |
|
109 | ]; |
|
110 | } |
|
111 | if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\NotEqual) { |
|
112 | $this->errors[]= [ |
|
113 | 'disallowedToken' => '!=', |
|
@@ 111-118 (lines=8) @@ | ||
108 | 'reason' => $this->buildReason('==', CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED) |
|
109 | ]; |
|
110 | } |
|
111 | if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\NotEqual) { |
|
112 | $this->errors[]= [ |
|
113 | 'disallowedToken' => '!=', |
|
114 | 'errorCode' => CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED, |
|
115 | 'line' => $node->getLine(), |
|
116 | 'reason' => $this->buildReason('!=', CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED) |
|
117 | ]; |
|
118 | } |
|
119 | if ($node instanceof Node\Stmt\Class_) { |
|
120 | if ($node->extends !== null) { |
|
121 | $this->checkBlackList($node->extends->toString(), CodeChecker::CLASS_EXTENDS_NOT_ALLOWED, $node); |