| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 5.2596 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 3 | public function setJob(JobInterface $job) |
|
| 34 | 3 | { |
|
| 35 | 3 | if (isset($this->jobs['__id__']) && $this->jobs['__id__'] == $job->getId()) { |
|
| 36 | return $this; |
||
| 37 | 3 | } |
|
| 38 | |||
| 39 | $this->jobs = array( |
||
| 40 | '__id__' => $job->getId(), |
||
| 41 | 'userId' => ($user = $job->getUser()) ? $user->getId() : null, |
||
| 42 | ); |
||
| 43 | $this->setJobsManagers($job->getMetaData('organizations:managers', [])); |
||
|
|
|||
| 44 | return $this; |
||
| 45 | } |
||
| 68 |
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.