| Conditions | 4 |
| Paths | 8 |
| Total Lines | 29 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function testValidateIntNull() |
||
| 15 | { |
||
| 16 | self::assertNull(Util::validateIntNull('something', null, 2)); |
||
| 17 | self::assertEquals(1, Util::validateIntNull('asdf', 1, 2)); |
||
| 18 | try { |
||
| 19 | Util::validateIntNull('something', 'asdf', 2); |
||
| 20 | } catch (\Exception $exception) { |
||
| 21 | self::assertTrue(true); |
||
| 22 | } |
||
| 23 | |||
| 24 | $failed = false; |
||
| 25 | try { |
||
| 26 | Util::validateIntNull('test', '5', 2); |
||
| 27 | $failed = true; |
||
| 28 | } catch (\Exception $exception) { |
||
| 29 | self::assertTrue(true); |
||
| 30 | } |
||
| 31 | self::assertFalse($failed); |
||
| 32 | self::assertEquals(5, Util::validateIntNull('test', '5', 3)); |
||
| 33 | self::assertEquals(PHP_INT_MAX, Util::validateIntNull('test', PHP_INT_MAX, 64)); |
||
| 34 | |||
| 35 | try { |
||
| 36 | Util::validateIntNull('test', PHP_INT_MAX, 31); |
||
| 37 | $failed = true; |
||
| 38 | } catch (\Exception $exception) { |
||
| 39 | self::assertTrue(true); |
||
| 40 | } |
||
| 41 | self::assertFalse($failed); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.