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.

IncompatibleClass::forExpellingEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEvents\Registry;
6
7
use Dsantang\DomainEvents\EventAware;
8
use RuntimeException;
9
use function get_class;
10
use function sprintf;
11
12
final class IncompatibleClass extends RuntimeException
13
{
14
    private const MESSAGE = 'Class "%s" must implement the "%s" interface in order to %s domain events.';
15
16 2
    public static function forExpellingEvents(object $instance) : self
17
    {
18 2
        return new self(sprintf(self::MESSAGE, get_class($instance), EventAware::class, 'expel'));
19
    }
20
21 2
    public static function forTriggeringEvents(object $instance) : self
22
    {
23 2
        return new self(sprintf(self::MESSAGE, get_class($instance), EventAware::class, 'trigger'));
24
    }
25
}
26