Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
42 | 84 | public function __call($version, $arguments) |
|
43 | { |
||
44 | 84 | $serviceName = $this->getServiceName(\get_class($this)); |
|
45 | |||
46 | 84 | $version = \ucfirst($version); |
|
47 | |||
48 | 84 | if ($this->static === true) { |
|
49 | 1 | $serviceName = \str_replace('Version', '', $serviceName); |
|
50 | 1 | } |
|
51 | |||
52 | 84 | $class = "AlibabaCloud\\{$serviceName}\\$version\\{$serviceName}ApiResolver"; |
|
53 | |||
54 | 84 | if (\class_exists($class)) { |
|
55 | 83 | return new $class(); |
|
56 | } |
||
57 | |||
58 | 1 | throw new ClientException( |
|
59 | 1 | "$serviceName Versions contains no {$version}", |
|
60 | 'SDK.VersionNotFound' |
||
61 | 1 | ); |
|
84 |