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