Skip to content

Commit 022b782

Browse files
committed
Improving syntax layout to please phpcs
1 parent 35310a2 commit 022b782

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/PHPCouchDB/Exception/ServerException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
namespace PHPCouchDB\Exception;
44

5-
class ServerException {
5+
class ServerException
6+
{
67
}
7-

src/PHPCouchDB/Server.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,26 @@ class Server
2828
*/
2929
public function __construct(array $options)
3030
{
31-
if(empty($options) || !is_array($options)) {
32-
throw new \PHPCouchDB\Exception\ServerException('$options is a required parameter, array should contain either a url or a client');
31+
if (empty($options) || !is_array($options)) {
32+
throw new \PHPCouchDB\Exception\ServerException(
33+
'$options is a required parameter, array should contain either a url or a client'
34+
);
3335
}
3436

35-
if(isset($options['client']) && $options['client'] instanceof \GuzzleHttp\ClientInterface) {
37+
if (isset($options['client']) && $options['client'] instanceof \GuzzleHttp\ClientInterface) {
3638
$this->client = $options['client'];
37-
} elseif(isset($options['url'])) {
39+
} elseif (isset($options['url'])) {
3840
try {
3941
$this->client = new \GuzzleHttp\Client(["base_uri" => $options['url']]);
40-
} catch(Exception $e) {
41-
throw new \PHPCouchDB\Exception\ServerException("Could not connect with URL. Error: " . $e->getMessage());
42+
} catch (Exception $e) {
43+
throw new \PHPCouchDB\Exception\ServerException(
44+
"Could not connect with URL. Error: " . $e->getMessage()
45+
);
4246
}
4347
} else {
44-
throw new \PHPCouchDB\Exception\ServerException('Failed to parse $options, array should contain either a url or a client');
48+
throw new \PHPCouchDB\Exception\ServerException(
49+
'Failed to parse $options, array should contain either a url or a client'
50+
);
4551
}
4652
}
4753

@@ -72,7 +78,8 @@ public function getVersion() : string
7278
*
7379
* @return array The database names
7480
*/
75-
public function getAllDbs() {
81+
public function getAllDbs()
82+
{
7683
$response = $this->client->request("GET", "/_all_dbs");
7784
if ($response->getStatusCode() == 200) {
7885
// try to decode JSON

0 commit comments

Comments
 (0)