| Conditions | 5 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function handle() |
||
| 28 | { |
||
| 29 | $response = IproSoftwareFacade::getPropertyDayAvailabilityCheck([ |
||
| 30 | 'query' => [ |
||
| 31 | 'lastUpdated' => $this->minutesAgo, |
||
| 32 | ], |
||
| 33 | ])->onlySuccessful(); |
||
| 34 | |||
| 35 | $changedProperties = $response->json('PropertyIDs'); |
||
| 36 | |||
| 37 | if(is_array($changedProperties)) { |
||
| 38 | foreach ($changedProperties as $changedPropertyId) { |
||
| 39 | if(!$changedPropertyId || !is_numeric($changedPropertyId)) { |
||
| 40 | continue; |
||
| 41 | } |
||
| 42 | |||
| 43 | BlockoutsPull::dispatch($changedPropertyId) |
||
| 44 | ->onQueue($this->queue); |
||
| 45 | |||
| 46 | BookingsPull::dispatch(null, ['propertyids' => $changedPropertyId]) |
||
| 47 | ->onQueue($this->queue); |
||
| 48 | } |
||
| 52 |