| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3.0327 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | 2 | public function prev() |
|
| 55 | { |
||
| 56 | /** @scrutinizer ignore-call */ |
||
| 57 | 2 | if ($this->metaData->prev) { |
|
| 58 | /** @scrutinizer ignore-call */ |
||
| 59 | 2 | $func = $this->historyFunction; |
|
| 60 | 2 | $prev = LiveEngage::$func($this->metaData->start, $this->metaData->end, $this->metaData->prev->href); |
|
| 61 | 2 | if ($prev) { |
|
| 62 | |||
| 63 | 2 | $prev->_metadata->start = $this->metaData->start; |
|
| 64 | 2 | $prev->_metadata->end = $this->metaData->end; |
|
| 65 | |||
| 66 | 2 | $meta = new MetaData((array) $prev->_metadata); |
|
| 67 | |||
| 68 | 2 | $collection = new self($prev->records); |
|
| 69 | 2 | $collection->metaData = $meta; |
|
| 70 | |||
| 71 | 2 | return $collection; |
|
| 72 | |||
| 73 | } else { |
||
| 74 | return null; |
||
| 75 | } |
||
| 76 | } |
||
| 77 | |||
| 78 | return null; |
||
| 79 | |||
| 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.