We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 10 | public function __construct(string $countryCode) |
|
| 42 | { |
||
| 43 | 10 | $normalized = ucfirst(mb_strtolower($countryCode)); |
|
| 44 | 10 | $className = sprintf('%s\\Locale\\%s%s', __NAMESPACE__, $normalized, $this->getSuffix()); |
|
| 45 | 10 | if (!class_exists($className)) { |
|
| 46 | throw new ComponentException(sprintf('"%s" is not a supported country code', $countryCode)); |
||
| 47 | } |
||
| 48 | |||
| 49 | 10 | $this->countryCode = $countryCode; |
|
| 50 | 10 | parent::__construct(new $className); |
|
| 51 | 10 | } |
|
| 60 |