| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | 2 | public function __get(string $property): ModelInterface |
|
| 37 | { |
||
| 38 | 2 | if (!array_key_exists($property, self::MODELS_MAP)) { |
|
| 39 | 1 | throw new Exception(sprintf('Model `%s` not supported by Nova Poshta API Client', $property)); |
|
| 40 | } |
||
| 41 | 1 | $class = self::MODELS_MAP[$property]; |
|
| 42 | 1 | $this->$property = new $class($this->getConnection()); |
|
| 43 | 1 | return $this->$property; |
|
| 44 | } |
||
| 54 |