| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | 1 | public function process(PHP_CodeSniffer_File $file, $position) |
|
| 53 | { |
||
| 54 | 1 | $this->file = $file; |
|
| 55 | 1 | $this->position = $position; |
|
| 56 | |||
| 57 | 1 | $interfaceName = $this->getInterfaceName(); |
|
| 58 | 1 | if ((strlen($interfaceName) - strlen('Interface')) === strrpos($interfaceName, 'Interface')) { |
|
| 59 | 1 | return; |
|
| 60 | } |
||
| 61 | |||
| 62 | 1 | $file->addError('Interface should have suffix "Interface".', $position); |
|
| 63 | 1 | } |
|
| 64 | |||
| 80 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: