Conditions | 5 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace JobApis\Jobs\Client\Providers; |
||
14 | 8 | public function createJobObject($payload) |
|
15 | { |
||
16 | 8 | $job = new Job([ |
|
17 | 8 | 'title' => $payload['title'], |
|
18 | 8 | 'name' => $payload['title'], |
|
19 | 8 | 'description' => $payload['description'], |
|
20 | 8 | 'url' => $payload['link'], |
|
21 | 8 | ]); |
|
22 | |||
23 | 8 | $job->setDatePostedAsString($payload['pubDate']); |
|
24 | |||
25 | // Set a location if it was set in the query |
||
26 | 8 | if ($this->query && $this->query->get('l')) { |
|
27 | 4 | $job->setLocation($this->query->get('l')); |
|
|
|||
28 | 4 | } |
|
29 | |||
30 | // Set a company if it was set in the query |
||
31 | 8 | if ($this->query && $this->query->get('company')) { |
|
32 | 2 | $job->setCompany($this->query->get('company')); |
|
33 | 2 | } |
|
34 | |||
35 | 8 | return $job; |
|
36 | } |
||
37 | |||
73 |
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: