| Total Complexity | 6 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 93.75% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class NumberNormalizer extends AbstractNormalizer |
||
| 9 | { |
||
| 10 | /** @var */ |
||
| 11 | private $decimals; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @param int|null $decimals |
||
| 15 | */ |
||
| 16 | 6 | public function __construct(NormalizerInterface $normalizer = null, $decimals = null) |
|
| 17 | { |
||
| 18 | 6 | $this->setDecimals($decimals); |
|
| 19 | |||
| 20 | 6 | parent::__construct($normalizer); |
|
| 21 | 6 | } |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @param int|null $decimals |
||
| 25 | * |
||
| 26 | * @return self |
||
| 27 | */ |
||
| 28 | 6 | public function setDecimals($decimals) |
|
| 29 | { |
||
| 30 | 6 | $this->decimals = $decimals; |
|
| 31 | |||
| 32 | 6 | return $this; |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return int|null |
||
| 37 | */ |
||
| 38 | 6 | public function getDecimals() |
|
| 39 | { |
||
| 40 | 6 | return $this->decimals; |
|
| 41 | } |
||
| 42 | |||
| 43 | 6 | protected function getNormalizedValue($value) |
|
| 56 | } |
||
| 57 | } |
||
| 58 |