AbstractEvent   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 2
dl 0
loc 42
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A notAuthorized() 0 4 1
A notFound() 0 4 1
A notModified() 0 4 1
A alreadyRegistered() 0 4 1
A successful() 0 4 1
A getStatus() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbookBundle\Event;
6
7
use Symfony\Contracts\EventDispatcher\Event;
8
9
abstract class AbstractEvent extends Event
10
{
11
    /**
12
     * @var Status
13
     */
14
    private $status;
15
16 1
    public function __construct()
17
    {
18 1
        $this->status = Status::unhandled();
19 1
    }
20
21 1
    final public function notAuthorized(): void
22
    {
23 1
        $this->status = Status::notAuthorized();
24 1
    }
25
26 1
    final public function notFound(): void
27
    {
28 1
        $this->status = Status::notFound();
29 1
    }
30
31 1
    final public function notModified(): void
32
    {
33 1
        $this->status = Status::notModified();
34 1
    }
35
36 1
    final public function alreadyRegistered(): void
37
    {
38 1
        $this->status = Status::alreadyRegistered();
39 1
    }
40
41 1
    final protected function successful(): void
42
    {
43 1
        $this->status = Status::successful();
44 1
    }
45
46 1
    final public function getStatus(): Status
47
    {
48 1
        return $this->status;
49
    }
50
}
51