| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | protected function replaceUriValidator() |
||
| 43 | { |
||
| 44 | static $replaced; |
||
| 45 | |||
| 46 | if ($replaced) { |
||
| 47 | return; |
||
| 48 | } |
||
| 49 | |||
| 50 | $validators = Route::getValidators(); |
||
| 51 | foreach ($validators as $key => $validator) { |
||
| 52 | if ($validator instanceof LaravelUriValidator) { |
||
| 53 | Route::$validators[$key] = new UriValidator(); |
||
| 54 | break; |
||
| 55 | } |
||
| 56 | } |
||
| 57 | |||
| 58 | $replaced = true; |
||
| 59 | } |
||
| 61 |
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.