BeforeNormalizationEvent::getResource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

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
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the FiveLab Resource package
7
 *
8
 * (c) FiveLab
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code
12
 */
13
14
namespace FiveLab\Component\Resource\Serializer\Events;
15
16
use FiveLab\Component\Resource\Resource\ResourceInterface;
17
use Symfony\Component\EventDispatcher\Event;
18
19
/**
20
 * Before normalization event.
21
 *
22
 * @author Vitaliy Zhuk <[email protected]>
23
 */
24
class BeforeNormalizationEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
25
{
26
    /**
27
     * @var ResourceInterface
28
     */
29
    private $resource;
30
31
    /**
32
     * @var string
33
     */
34
    private $format;
35
36
    /**
37
     * @var array
38
     */
39
    private $context;
40
41
    /**
42
     * Constructor.
43
     *
44
     * @param ResourceInterface $resource
45
     * @param string            $format
46
     * @param array             $context
47
     */
48 5
    public function __construct(ResourceInterface $resource, string $format, array $context)
49
    {
50 5
        $this->resource = $resource;
51 5
        $this->format = $format;
52 5
        $this->context = $context;
53 5
    }
54
55
    /**
56
     * Get resource
57
     *
58
     * @return ResourceInterface
59
     */
60 1
    public function getResource(): ResourceInterface
61
    {
62 1
        return $this->resource;
63
    }
64
65
    /**
66
     * Get format
67
     *
68
     * @return string
69
     */
70 1
    public function getFormat(): string
71
    {
72 1
        return $this->format;
73
    }
74
75
    /**
76
     * Get context
77
     *
78
     * @return array
79
     */
80 1
    public function getContext(): array
81
    {
82 1
        return $this->context;
83
    }
84
}
85