Passed
Branch master (df2ee3)
by Dawid
07:19 queued 02:10
created

CheckResult::getValidationResult()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Event\ResponseSchemaCheck;
6
7
use Spiechu\SymfonyCommonsBundle\Service\ValidationResult;
8
use Symfony\Component\EventDispatcher\Event;
9
10
class CheckResult extends Event
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $format;
16
17
    /**
18
     * @var string
19
     */
20
    protected $content;
21
22
    /**
23
     * @var ValidationResult
24
     */
25
    protected $validationResult;
26
27 1
    public function __construct(string $format, string $content, ValidationResult $validationResult)
28
    {
29 1
        $this->format = $format;
30 1
        $this->content = $content;
31 1
        $this->validationResult = $validationResult;
32 1
    }
33
34 1
    public function getFormat(): string
35
    {
36 1
        return $this->format;
37
    }
38
39 1
    public function getContent(): string
40
    {
41 1
        return $this->content;
42
    }
43
44 1
    public function getValidationResult(): ValidationResult
45
    {
46 1
        return $this->validationResult;
47
    }
48
49
    public function isValid(): bool
50
    {
51
        return $this->validationResult->isValid();
52
    }
53
}
54