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   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forTriggeringEvents() 0 3 1
A forExpellingEvents() 0 3 1
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