| Total Complexity | 5 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class NormalizationFieldMapping implements NormalizationFieldMappingInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $name; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | private $groups; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var FieldNormalizerInterface |
||
| 25 | */ |
||
| 26 | private $fieldNormalizer; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var PolicyInterface |
||
| 30 | */ |
||
| 31 | private $policy; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $name |
||
| 35 | */ |
||
| 36 | public function __construct( |
||
| 37 | $name, |
||
| 38 | array $groups, |
||
| 39 | 4 | FieldNormalizerInterface $fieldNormalizer, |
|
| 40 | PolicyInterface $policy = null |
||
| 41 | ) { |
||
| 42 | $this->name = $name; |
||
| 43 | $this->groups = $groups; |
||
| 44 | $this->fieldNormalizer = $fieldNormalizer; |
||
| 45 | 4 | $this->policy = $policy ?? new NullPolicy(); |
|
| 46 | 4 | } |
|
| 47 | 4 | ||
| 48 | 4 | public function getName(): string |
|
| 49 | 4 | { |
|
| 50 | return $this->name; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | 1 | * @deprecated |
|
| 55 | * |
||
| 56 | 1 | * @return string[] |
|
| 57 | */ |
||
| 58 | public function getGroups(): array |
||
| 59 | { |
||
| 60 | return $this->groups; |
||
| 61 | } |
||
| 62 | |||
| 63 | public function getFieldNormalizer(): FieldNormalizerInterface |
||
| 64 | 1 | { |
|
| 65 | return $this->fieldNormalizer; |
||
| 66 | 1 | } |
|
| 67 | |||
| 68 | public function getPolicy(): PolicyInterface |
||
| 71 | } |
||
| 72 | } |
||
| 73 |