| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class ScalarTests extends TestCase |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @test |
||
| 15 | */ |
||
| 16 | public function freeze_integer() |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @test |
||
| 27 | */ |
||
| 28 | public function string_integer() |
||
| 29 | { |
||
| 30 | $scalar = new FreezeString('string'); |
||
| 31 | |||
| 32 | $this->isInstanceOf(FreezeString::class, $scalar); |
||
| 33 | $this->isInstanceOf(Scalar::class, $scalar); |
||
| 34 | $this->assertEquals($scalar->content(), 'string'); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @test |
||
| 39 | */ |
||
| 40 | public function unexpected_value() |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.