Issues (48)

src/Observers/GuestObserver.php (2 issues)

1
<?php
2
3
namespace Innoflash\Events\Observers;
4
5
use FaithGen\SDK\Traits\FileTraits;
6
use Innoflash\Events\Guest\Saved;
0 ignored issues
show
The type Innoflash\Events\Guest\Saved was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Innoflash\Events\Models\Guest;
8
9
class GuestObserver
10
{
11
    use FileTraits;
12
13
    public function deleted(Guest $guest)
14
    {
15
        if ($guest->image()->exists()) {
16
            $this->deleteFiles($guest);
17
            $guest->image()->delete();
18
        }
19
    }
20
21
    public function created(Guest $guest)
22
    {
23
        event(new Saved($guest, request('image')));
24
    }
25
26
    public function updated(Guest $guest)
0 ignored issues
show
The parameter $guest is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public function updated(/** @scrutinizer ignore-unused */ Guest $guest)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
    }
29
}
30