GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TestHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A whenTestEvent() 0 4 1
A getSubscribedEvents() 0 4 1
1
<?php declare (strict_types=1);
2
3
namespace Tests\EventDispatcher\Helpers;
4
5
use SmoothPhp\Contracts\EventDispatcher\Subscriber;
6
7
/**
8
 * Class TestHandler
9
 * @package Tests\EventDispatcher\Helpers
10
 * @author Simon Bennett <[email protected]>
11
 */
12
final class TestHandler implements Subscriber
13
{
14
    public $runCount = 0;
15
    /**
16
     * @param TestEvent $testEvent
17
     */
18
    public function whenTestEvent(TestEvent $testEvent)
0 ignored issues
show
Unused Code introduced by
The parameter $testEvent is not used and could be removed.

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

Loading history...
19
    {
20
        $runCount++;
0 ignored issues
show
Bug introduced by
The variable $runCount does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
21
    }
22
23
    /**
24
     * ['eventName' => 'methodName']
25
     * ['eventName' => ['methodName', $priority]]
26
     * ['eventName' => [['methodName1', $priority], array['methodName2']]
27
     * @return array
28
     */
29
    public function getSubscribedEvents()
30
    {
31
        return [TestEvent::class => ['whenTestEvent'],];
32
    }
33
}
34