| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function __invoke() |
||
| 30 | { |
||
| 31 | $adapterName = strtolower($this->config->get('voice.provider', self::VOICE_PROVIDER_GOOGLE)); |
||
| 32 | switch ($adapterName) { |
||
| 33 | case self::VOICE_PROVIDER_GOOGLE: |
||
| 34 | $adapter = new Google(); |
||
| 35 | $adapter->getOptions()->setLanguage('en'); |
||
| 36 | $adapter->getOptions()->setEncoding('UTF-8'); |
||
| 37 | break; |
||
| 38 | case self::VOICE_PROVIDER_IVONA: |
||
| 39 | $secretKey = $this->config->get('voice.' . $adapterName . '.secret_key', ''); |
||
| 40 | $accessKey = $this->config->get('voice.' . $adapterName . '.access_key', ''); |
||
| 41 | $adapter = new Ivona(); |
||
|
1 ignored issue
–
show
|
|||
| 42 | $adapter->getOptions()->setSecretKey($secretKey); |
||
| 43 | $adapter->getOptions()->setAccessKey($accessKey); |
||
| 44 | break; |
||
| 45 | default: |
||
| 46 | throw new ErrorException('Not implemented functionality for voice provider: ' . $adapterName); |
||
| 47 | } |
||
| 48 | |||
| 49 | return $adapter; |
||
| 50 | } |
||
| 51 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.