| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | public function find() |
||
| 8 | { |
||
| 9 | $this->prepare(); |
||
| 10 | |||
| 11 | $results = $this->vacancies->get(); |
||
|
|
|||
| 12 | |||
| 13 | $fromDatetime = $this->getUTCDateTime(); |
||
| 14 | |||
| 15 | if ($this->duration !== null) { |
||
| 16 | $toDatetime = $fromDatetime->addMinutes($this->duration); |
||
| 17 | |||
| 18 | $results = $results->reject(function ($vacancy) use ($fromDatetime, $toDatetime) { |
||
| 19 | return !$vacancy->hasRoomBetween($fromDatetime, $toDatetime); |
||
| 20 | }); |
||
| 21 | } |
||
| 22 | |||
| 23 | return $results; |
||
| 24 | } |
||
| 25 | |||
| 39 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.