PostBarcodeCheckEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 3 1
A isValid() 0 3 1
A getSubject() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Loevgaard\SyliusBarcodePlugin\Event;
6
7
use Loevgaard\SyliusBarcodePlugin\Model\BarcodeAwareInterface;
8
use Symfony\Contracts\EventDispatcher\Event;
9
10
final class PostBarcodeCheckEvent extends Event
11
{
12
    /** @deprecated will be removed in v2 */
13
    public const NAME = 'loevgaard_sylius_barcode.post_barcode_check';
14
15
    /** @var BarcodeAwareInterface */
16
    private $subject;
17
18
    /** @var bool */
19
    private $valid;
20
21
    /** @var string */
22
    private $type;
23
24
    public function __construct(BarcodeAwareInterface $subject, bool $valid, string $type)
25
    {
26
        $this->subject = $subject;
27
        $this->valid = $valid;
28
        $this->type = $type;
29
    }
30
31
    public function getSubject(): BarcodeAwareInterface
32
    {
33
        return $this->subject;
34
    }
35
36
    public function isValid(): bool
37
    {
38
        return $this->valid;
39
    }
40
41
    public function getType(): string
42
    {
43
        return $this->type;
44
    }
45
}
46