| Conditions | 5 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php namespace JobApis\JobsToMail\Filters; |
||
| 22 | public function filter(array $jobs, Search $search) |
||
| 23 | { |
||
| 24 | 3 | return array_filter($jobs, function (Job $job) use ($search) { |
|
| 25 | // Make sure this job has a company |
||
| 26 | 3 | if (isset($job->company) && $job->company) { |
|
| 27 | // See if this company is not a recruiter |
||
| 28 | 2 | if ($this->recruiter->whereNameLike($job->company)->first()) { |
|
| 29 | 2 | if ($search->no_recruiters === true) { |
|
| 30 | 1 | return false; |
|
| 31 | } else { |
||
| 32 | 1 | $job->setIndustry("Staffing"); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | 2 | return true; |
|
| 37 | 3 | }); |
|
| 38 | } |
||
| 39 | } |
||
| 40 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: