| Conditions | 5 |
| Paths | 4 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function pass(FuncCall $funcCall, Context $context) |
||
| 33 | { |
||
| 34 | $functionName = $this->resolveFunctionName($funcCall, $context); |
||
| 35 | if (!$functionName || !isset($this->map[$functionName])) { |
||
| 36 | return false; |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($funcCall->getDocComment()) { |
||
| 40 | $phpdoc = $this->docBlockFactory->create($funcCall->getDocComment()->getText()); |
||
| 41 | if ($phpdoc->hasTag('expected')) { |
||
| 42 | return false; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | $context->notice( |
||
| 47 | 'debug.code', |
||
| 48 | sprintf('Function %s() is a debug function, please don`t use it in production.', $functionName), |
||
| 49 | $funcCall |
||
| 50 | ); |
||
| 51 | |||
| 52 | return true; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |