| Total Complexity | 6 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | final class InnerFieldsNameConverter implements NameConverterInterface |
||
| 27 | { |
||
| 28 | private $decorated; |
||
| 29 | |||
| 30 | public function __construct(?NameConverterInterface $decorated = null) |
||
| 31 | { |
||
| 32 | $this->decorated = $decorated ?? new CamelCaseToSnakeCaseNameConverter(); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | public function normalize($propertyName) |
||
| 39 | { |
||
| 40 | return $this->convertInnerFields($propertyName, true); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | public function denormalize($propertyName) |
||
| 47 | { |
||
| 48 | return $this->convertInnerFields($propertyName, false); |
||
| 49 | } |
||
| 50 | |||
| 51 | private function convertInnerFields(string $propertyName, bool $normalization): string |
||
| 60 | } |
||
| 61 | } |
||
| 62 |