Conditions | 3 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
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 | 6 | $job->setDatePostedAsString($payload['pubDate']); |
|
24 | |||
25 | // Set a location if it was set in the query |
||
26 | 6 | if ($this->query && $this->query->get('where')) { |
|
27 | 4 | $job->setLocation($this->query->get('where')); |
|
|
|||
28 | 4 | } |
|
29 | |||
30 | 6 | return $job; |
|
31 | } |
||
32 | |||
68 |
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: