| Conditions | 7 |
| Paths | 8 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | public function visitPhpFunctionCall(FuncCall $funcCall, Context $context) |
||
| 17 | { |
||
| 18 | $name = false; |
||
| 19 | |||
| 20 | if ($funcCall->name instanceof Name && !$funcCall->name->isFullyQualified()) { |
||
| 21 | $name = $funcCall->name->getFirst(); |
||
| 22 | } |
||
| 23 | |||
| 24 | if ($name && isset($this->map[$name])) { |
||
|
|
|||
| 25 | if ($funcCall->getDocComment()) { |
||
| 26 | $phpdoc = new \phpDocumentor\Reflection\DocBlock($funcCall->getDocComment()->getText()); |
||
| 27 | if ($phpdoc->hasTag('expected')) { |
||
| 28 | return true; |
||
| 29 | } |
||
| 30 | |||
| 31 | // return true; |
||
| 32 | } |
||
| 33 | |||
| 34 | $context->notice( |
||
| 35 | 'debug.code', |
||
| 36 | sprintf('Function %s() is a debug code, please don`t use it in production.', $name), |
||
| 37 | $funcCall |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: