PostBarcodeCheckEvent::isValid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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