| Total Complexity | 11 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Target implements \JsonSerializable |
||
| 10 | { |
||
| 11 | /** @var string */ |
||
| 12 | protected $germColor; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | protected $germSize; |
||
| 16 | |||
| 17 | /** @var string */ |
||
| 18 | protected $germStyle; |
||
| 19 | |||
| 20 | 37 | public function __construct(string $germColor, string $germSize, string $germStyle) |
|
| 21 | { |
||
| 22 | 37 | $this->germColor = $germColor; |
|
| 23 | 37 | $this->germSize = $germSize; |
|
| 24 | 37 | $this->germStyle = $germStyle; |
|
| 25 | 37 | } |
|
| 26 | |||
| 27 | 7 | public function setGermColor(string $germColor): void |
|
| 28 | { |
||
| 29 | 7 | $this->germColor = $germColor; |
|
| 30 | 7 | } |
|
| 31 | |||
| 32 | 6 | public function setGermSize(string $germSize): void |
|
| 33 | { |
||
| 34 | 6 | $this->germSize = $germSize; |
|
| 35 | 6 | } |
|
| 36 | |||
| 37 | 4 | public function setGermStyle(string $germStyle): void |
|
| 38 | { |
||
| 39 | 4 | $this->germStyle = $germStyle; |
|
| 40 | 4 | } |
|
| 41 | |||
| 42 | 19 | public function getGermColor(): string |
|
| 43 | { |
||
| 44 | 19 | return $this->germColor; |
|
| 45 | } |
||
| 46 | |||
| 47 | 19 | public function getGermSize(): string |
|
| 48 | { |
||
| 49 | 19 | return $this->germSize; |
|
| 50 | } |
||
| 51 | |||
| 52 | 16 | public function getGermStyle(): string |
|
| 55 | } |
||
| 56 | |||
| 57 | 14 | public function checkIfSame(GermTile $tile): bool |
|
| 58 | { |
||
| 59 | 14 | if ($tile->getColor() !== $this->getGermColor()) { |
|
| 60 | 6 | return false; |
|
| 61 | } |
||
| 62 | |||
| 63 | 12 | if ($tile->getSize() !== $this->getGermSize()) { |
|
| 64 | 4 | return false; |
|
| 65 | } |
||
| 66 | |||
| 67 | 11 | return $tile->getStyle() === $this->getGermStyle(); |
|
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @return string[] |
||
| 72 | */ |
||
| 73 | 1 | public function jsonSerialize(): array |
|
| 76 | } |
||
| 77 | } |
||
| 78 |