Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
96 | 18 | public function dsn() |
|
97 | { |
||
98 | // @see https://github.com/acquia/acquia-sdk-php/issues/27 |
||
99 | 18 | if (!isset($this['name'])) { |
|
100 | 3 | throw new \OutOfBoundsException('Malformed response: expecting "name" property'); |
|
101 | } |
||
102 | 15 | if (!isset($this['host'])) { |
|
103 | 3 | throw new \OutOfBoundsException('Malformed response: expecting "host" property'); |
|
104 | } |
||
105 | 12 | if (!isset($this['port'])) { |
|
106 | 3 | throw new \OutOfBoundsException('Malformed response: expecting "port" property'); |
|
107 | } |
||
108 | |||
109 | 9 | return 'mysql:dbname=' . $this['name'] . ';host=' . $this['host'] . ';port=' . $this['port']; |
|
110 | } |
||
111 | |||
120 |