| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3.004 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 2 | public function next() |
|
| 21 | { |
||
| 22 | /** @scrutinizer ignore-call */ |
||
| 23 | 2 | if ($this->metaData->next) { |
|
| 24 | /** @scrutinizer ignore-call */ |
||
| 25 | 2 | $func = $this->historyFunction; |
|
| 26 | 2 | $next = LiveEngage::$func($this->metaData->start, $this->metaData->end, $this->metaData->next->href); |
|
| 27 | 2 | if ($next) { |
|
| 28 | |||
| 29 | 2 | $next->_metadata->start = $this->metaData->start; |
|
| 30 | 2 | $next->_metadata->end = $this->metaData->end; |
|
| 31 | |||
| 32 | 2 | $meta = new MetaData((array) $next->_metadata); |
|
| 33 | |||
| 34 | 2 | $collection = new self($next->records); |
|
|
|
|||
| 35 | 2 | $collection->metaData = $meta; |
|
| 36 | |||
| 37 | 2 | return $collection; |
|
| 38 | |||
| 39 | } else { |
||
| 40 | return null; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | 2 | return null; |
|
| 45 | |||
| 82 | } |
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.