| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 1 | public function connect() |
|
| 23 | { |
||
| 24 | 1 | if ($this->instance !== null) { |
|
| 25 | 1 | $this->instance = null; // close previous connection |
|
| 26 | 1 | } |
|
| 27 | 1 | $key = $this->getConfigurationValue('key'); |
|
| 28 | 1 | $secret = $this->getConfigurationValue('secret'); |
|
| 29 | 1 | $region = $this->getConfigurationValue('region'); |
|
| 30 | |||
| 31 | 1 | $this->instance = SqsClient::factory([ |
|
| 32 | 1 | 'key' => $key, |
|
| 33 | 1 | 'secret' => $secret, |
|
| 34 | 1 | 'region' => $region, |
|
| 35 | 1 | ]); |
|
| 36 | |||
| 37 | 1 | return $this; |
|
| 38 | } |
||
| 39 | |||
| 54 |