Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — 0.11 ( 6acbd3...e1e379 )
by Jérémiah
17:19 queued 07:26
created

EventDispatcherVersionHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 23
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isForLegacy() 0 3 1
A dispatch() 0 6 2
1
<?php
2
3
namespace Overblog\GraphQLBundle\Event;
4
5
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
6
use Symfony\Component\HttpKernel\Kernel;
7
8
/**
9
 * @internal
10
 * TODO(mcg-web): delete hack after migrating Symfony >= 4.3
11
 */
12
final class EventDispatcherVersionHelper
13
{
14
    /**
15
     * @return bool
16
     */
17 99
    public static function isForLegacy()
18
    {
19 99
        return Kernel::VERSION_ID < 40300;
20
    }
21
22
    /**
23
     * @param EventDispatcherInterface $dispatcher
24
     * @param object                   $event
25
     * @param string|null              $eventName
26
     *
27
     * @return object the event
28
     */
29 97
    public static function dispatch(EventDispatcherInterface $dispatcher, $event, $eventName)
30
    {
31 97
        if (self::isForLegacy()) {
32
            return $dispatcher->dispatch($eventName, $event);
0 ignored issues
show
Unused Code introduced by
The call to Symfony\Contracts\EventD...erInterface::dispatch() has too many arguments starting with $event. ( Ignorable by Annotation )

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

32
            return $dispatcher->/** @scrutinizer ignore-call */ dispatch($eventName, $event);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
It seems like $eventName can also be of type string; however, parameter $event of Symfony\Contracts\EventD...erInterface::dispatch() does only seem to accept object, maybe add an additional type check? ( Ignorable by Annotation )

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

32
            return $dispatcher->dispatch(/** @scrutinizer ignore-type */ $eventName, $event);
Loading history...
33
        } else {
34 97
            return $dispatcher->dispatch($event, $eventName);
35
        }
36
    }
37
}
38