faithgen /
events
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Innoflash\Events\Observers; |
||
| 4 | |||
| 5 | use FaithGen\SDK\Traits\FileTraits; |
||
| 6 | use Innoflash\Events\Jobs\Saved\ProcessImage; |
||
| 7 | use Innoflash\Events\Jobs\Saved\S3Upload; |
||
| 8 | use Innoflash\Events\Jobs\Saved\UploadImage; |
||
| 9 | use Innoflash\Events\Models\Event; |
||
| 10 | |||
| 11 | class EventObserver |
||
| 12 | { |
||
| 13 | use FileTraits; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Handle the event "created" event. |
||
| 17 | * |
||
| 18 | * @param \App\Event $event |
||
|
0 ignored issues
–
show
|
|||
| 19 | * @return void |
||
| 20 | */ |
||
| 21 | public function created(Event $event) |
||
| 22 | { |
||
| 23 | if (request()->has('banner')) { |
||
| 24 | UploadImage::withChain([ |
||
| 25 | new ProcessImage($event), |
||
| 26 | new S3Upload($event), |
||
| 27 | ])->dispatch($event, request('banner')); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Handle the event "updated" event. |
||
| 33 | * |
||
| 34 | * @param \App\Event $event |
||
| 35 | * @return void |
||
| 36 | */ |
||
| 37 | public function updated(Event $event) |
||
| 38 | { |
||
| 39 | if (request()->has('banner')) { |
||
| 40 | $this->deleted($event); |
||
| 41 | UploadImage::withChain([ |
||
| 42 | new ProcessImage($event), |
||
| 43 | new S3Upload($event), |
||
| 44 | ])->dispatch($event, request('banner')); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Handle the event "deleted" event. |
||
| 50 | * |
||
| 51 | * @param \App\Event $event |
||
| 52 | * @return void |
||
| 53 | */ |
||
| 54 | public function deleted(Event $event) |
||
| 55 | { |
||
| 56 | if ($event->image()->exists()) { |
||
| 57 | $this->deleteFiles($event); |
||
| 58 | $event->image()->delete(); |
||
| 59 | } |
||
| 60 | } |
||
| 61 | } |
||
| 62 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths