Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.4746 |
Changes | 0 |
1 | <?php |
||
25 | 2 | public function __construct(?string $platform = null) |
|
26 | { |
||
27 | 2 | if ($platform === null) { |
|
28 | 1 | $platform = self::getCurrentPlatform(); |
|
29 | } else { |
||
30 | 1 | if (!in_array(mb_strtoupper($platform), self::SUPPORTED_PLATFORMS, true)) { |
|
31 | throw new \InvalidArgumentException(sprintf( |
||
32 | 'Platform \'%s\' is not supported', |
||
33 | $platform |
||
34 | )); |
||
35 | } |
||
36 | } |
||
37 | 2 | $this->platform = mb_strtoupper($platform); |
|
38 | 2 | } |
|
61 |