@@ 257-269 (lines=13) @@ | ||
254 | } |
|
255 | } |
|
256 | ||
257 | private function checkBlackListConstant($class, $constantName, Node $node) { |
|
258 | $name = $class . '::' . $constantName; |
|
259 | $lowerName = \strtolower($name); |
|
260 | ||
261 | if (isset($this->blackListedConstants[$lowerName])) { |
|
262 | $this->errors[]= [ |
|
263 | 'disallowedToken' => $name, |
|
264 | 'errorCode' => CodeChecker::CLASS_CONST_FETCH_NOT_ALLOWED, |
|
265 | 'line' => $node->getLine(), |
|
266 | 'reason' => $this->buildReason($this->blackListedConstants[$lowerName], CodeChecker::CLASS_CONST_FETCH_NOT_ALLOWED) |
|
267 | ]; |
|
268 | } |
|
269 | } |
|
270 | ||
271 | private function checkBlackListFunction($class, $functionName, Node $node) { |
|
272 | $name = $class . '::' . $functionName; |
|
@@ 271-283 (lines=13) @@ | ||
268 | } |
|
269 | } |
|
270 | ||
271 | private function checkBlackListFunction($class, $functionName, Node $node) { |
|
272 | $name = $class . '::' . $functionName; |
|
273 | $lowerName = \strtolower($name); |
|
274 | ||
275 | if (isset($this->blackListedFunctions[$lowerName])) { |
|
276 | $this->errors[]= [ |
|
277 | 'disallowedToken' => $name, |
|
278 | 'errorCode' => CodeChecker::STATIC_CALL_NOT_ALLOWED, |
|
279 | 'line' => $node->getLine(), |
|
280 | 'reason' => $this->buildReason($this->blackListedFunctions[$lowerName], CodeChecker::STATIC_CALL_NOT_ALLOWED) |
|
281 | ]; |
|
282 | } |
|
283 | } |
|
284 | ||
285 | private function checkBlackListMethod($class, $functionName, Node $node) { |
|
286 | $name = $class . '::' . $functionName; |
|
@@ 285-297 (lines=13) @@ | ||
282 | } |
|
283 | } |
|
284 | ||
285 | private function checkBlackListMethod($class, $functionName, Node $node) { |
|
286 | $name = $class . '::' . $functionName; |
|
287 | $lowerName = \strtolower($name); |
|
288 | ||
289 | if (isset($this->blackListedMethods[$lowerName])) { |
|
290 | $this->errors[]= [ |
|
291 | 'disallowedToken' => $name, |
|
292 | 'errorCode' => CodeChecker::CLASS_METHOD_CALL_NOT_ALLOWED, |
|
293 | 'line' => $node->getLine(), |
|
294 | 'reason' => $this->buildReason($this->blackListedMethods[$lowerName], CodeChecker::CLASS_METHOD_CALL_NOT_ALLOWED) |
|
295 | ]; |
|
296 | } |
|
297 | } |
|
298 | ||
299 | private function buildReason($name, $errorCode) { |
|
300 | if (isset($this->errorMessages[$errorCode])) { |