Skip to content

Commit dadce73

Browse files
committed
Tidy up namespaces
1 parent 202539b commit dadce73

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/PHPCouchDB/Server.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Server
3030
public function __construct(array $options)
3131
{
3232
if (empty($options) || !is_array($options)) {
33-
throw new \PHPCouchDB\Exception\ServerException(
33+
throw new Exception\ServerException(
3434
'$options is a required parameter, array should contain either a url or a client'
3535
);
3636
}
@@ -40,7 +40,7 @@ public function __construct(array $options)
4040
} elseif (isset($options['url'])) {
4141
$client = new \GuzzleHttp\Client(["base_uri" => $options['url']]);
4242
} else {
43-
throw new \PHPCouchDB\Exception\ServerException(
43+
throw new Exception\ServerException(
4444
'Failed to parse $options, array should contain either a url or a client'
4545
);
4646
}
@@ -50,7 +50,7 @@ public function __construct(array $options)
5050
$client->get('/');
5151
$this->client = $client;
5252
} catch (\GuzzleHttp\Exception\ConnectException $e) {
53-
throw new \PHPCouchDB\Exception\ServerException(
53+
throw new Exception\ServerException(
5454
"Could not connect to database. Error: " . $e->getMessage(),
5555
0,
5656
$e
@@ -76,7 +76,7 @@ public function getVersion() : string
7676
return "unknown";
7777
}
7878
} else {
79-
throw new \PHPCouchDB\Exception\ServerException('JSON response not received or not understood');
79+
throw new Exception\ServerException('JSON response not received or not understood');
8080
}
8181
}
8282
}
@@ -95,7 +95,7 @@ public function getAllDbs() : array
9595
if ($json_data = json_decode($response->getBody(), true)) {
9696
return $json_data;
9797
} else {
98-
throw new \PHPCouchDB\Exception\ServerException('JSON response not received or not understood');
98+
throw new Exception\ServerException('JSON response not received or not understood');
9999
}
100100
}
101101
}
@@ -110,11 +110,11 @@ public function getAllDbs() : array
110110
* with parsing arguments or creating the database object (e.g. database
111111
* doesn't exist and shouldn't be created)
112112
*/
113-
public function useDb($options) : \PHPCouchDB\Database
113+
public function useDb($options) : Database
114114
{
115115
// check the $options array is sane
116116
if (!isset($options['name'])) {
117-
throw new \PHPCouchDB\Exception\ServerException(
117+
throw new Exception\ServerException(
118118
'"name" is a required $options parameter'
119119
);
120120
} else {
@@ -144,7 +144,7 @@ public function useDb($options) : \PHPCouchDB\Database
144144
return new Database($this->client, $db_name);
145145
}
146146

147-
throw new \PHPCouchDB\Exception\ServerException(
147+
throw new Exception\ServerException(
148148
'Database doesn\'t exist, include "create_if_not_exists" parameter to create it'
149149
);
150150
}

0 commit comments

Comments
 (0)