Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace JobApis\Jobs\Client\Providers; |
||
14 | 6 | public function createJobObject($payload) |
|
15 | { |
||
16 | 6 | $job = new Job([ |
|
17 | 6 | 'title' => $payload['title'], |
|
18 | 6 | 'name' => $payload['title'], |
|
19 | 6 | 'description' => $payload['description'], |
|
20 | 6 | 'url' => $payload['link'], |
|
21 | 6 | ]); |
|
22 | |||
23 | // Set a location if it was set in the query |
||
24 | 6 | if ($this->query && $this->query->get('location')) { |
|
25 | 4 | $job->setLocation($this->query->get('location')); |
|
|
|||
26 | 4 | } |
|
27 | |||
28 | 6 | return $job; |
|
29 | } |
||
30 | |||
65 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: