| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class DiceHydrator implements HydratorInterface |
||
| 12 | { |
||
| 13 | /** @var ValidatorInterface */ |
||
| 14 | private $diceValidator; |
||
| 15 | |||
| 16 | 4 | public function __construct(ValidatorInterface $diceValidator) |
|
| 19 | 4 | } |
|
| 20 | |||
| 21 | 2 | public function supports(string $type): bool |
|
| 22 | { |
||
| 23 | 2 | return true; |
|
| 24 | } |
||
| 25 | |||
| 26 | 1 | public function hydrate(array $diceData): Tile |
|
| 27 | { |
||
| 28 | 1 | return new Dice( |
|
| 29 | 1 | $diceData['germColor'], |
|
| 30 | 1 | $diceData['germSize'], |
|
| 31 | 1 | $diceData['germStyle'], |
|
| 32 | 1 | $diceData['entryColor'], |
|
| 33 | 1 | $diceData['entryDirection'] |
|
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | 1 | public function validate(array $diceData): void |
|
| 40 | 1 | } |
|
| 41 | } |
||
| 42 |