| Conditions | 5 |
| Paths | 16 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.1502 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 23 | 3 | protected function openConnection($environment = null, $certificate = '',$passphrase = '') |
|
| 24 | { |
||
| 25 | if($environment === null) { |
||
| 26 | 3 | $environment = $this->credentials->environment(); |
|
| 27 | 3 | } |
|
| 28 | 3 | if(empty($certificate)) { |
|
| 29 | 3 | $certificate = $this->credentials->certificate(); |
|
| 30 | } |
||
| 31 | if(empty($passphrase)) { |
||
| 32 | $passphrase = $this->credentials->passPhrase(); |
||
| 33 | } |
||
| 34 | 3 | ||
| 35 | try { |
||
| 36 | $this->client->open( |
||
|
|
|||
| 37 | $environment, |
||
| 38 | $certificate, |
||
| 39 | $passphrase |
||
| 40 | ); |
||
| 41 | 3 | } catch (Exception $exception) { |
|
| 42 | throw ConnectionFailed::create($exception); |
||
| 43 | 3 | } |
|
| 44 | 3 | } |
|
| 45 | |||
| 56 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: