Issues (2)

src/Utility/Services/EventDispatcher.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\Logistiq\Utility\Services;
6
7
use Illuminate\Contracts\Events\Dispatcher;
8
use ReliqArts\Logistiq\Utility\Contracts\EventDispatcher as EventDispatcherContract;
9
10
final class EventDispatcher implements EventDispatcherContract
11
{
12
    /**
13
     * @var Dispatcher
14
     */
15
    private $dispatcher;
16
17
    /**
18
     * EventDispatcher constructor.
19
     *
20
     * @param Dispatcher $dispatcher
21
     */
22
    public function __construct(Dispatcher $dispatcher)
23
    {
24
        $this->dispatcher = $dispatcher;
25
    }
26
27
    /**
28
     * Wrapper around Illuminate dispatcher.
29
     *
30
     * @param mixed ...$args
31
     *
32
     * @return null|array
33
     *
34
     * @see \Illuminate\Contracts\Events\Dispatcher for details on arguments
35
     */
36
    public function dispatch(...$args): ?array
37
    {
38
        return $this->dispatcher->dispatch(...$args);
0 ignored issues
show
$args is expanded, but the parameter $event of Illuminate\Events\Dispatcher::dispatch() does not expect variable arguments. ( Ignorable by Annotation )

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

38
        return $this->dispatcher->dispatch(/** @scrutinizer ignore-type */ ...$args);
Loading history...
39
    }
40
}
41