@@ -39,12 +39,11 @@ public static function create(Connection $connection, string $database): bool
3939
4040 $ uri = Api::buildSystemUri ($ connection ->getBaseUri (), Api::DATABASE );
4141 $ response = $ connection ->post ($ uri , $ db );
42- $ data = json_decode ((string )$ response ->getBody (), true );
42+ json_decode ((string )$ response ->getBody (), true );
4343 return true ;
4444 } catch (ClientException $ exception ) {
4545 $ response = json_decode ((string )$ exception ->getResponse ()->getBody (), true );
46- $ databaseException = new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
47- throw $ databaseException ;
46+ throw new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
4847 }
4948 }
5049
@@ -64,7 +63,7 @@ public static function drop(Connection $connection, string $database): bool
6463 $ uri = Api::buildSystemUri ($ connection ->getBaseUri (), Api::DATABASE );
6564 $ uri = sprintf ("%s/%s " , $ uri , $ database );
6665 $ response = $ connection ->delete ($ uri );
67- $ data = json_decode ((string )$ response ->getBody (), true );
66+ json_decode ((string )$ response ->getBody (), true );
6867 return true ;
6968 } catch (ClientException $ exception ) {
7069 $ response = json_decode ((string )$ exception ->getResponse ()->getBody (), true );
@@ -98,8 +97,7 @@ public static function list(Connection $connection): ArrayList
9897 return new ArrayList ($ data ['result ' ]);
9998 } catch (ClientException $ exception ) {
10099 $ response = json_decode ((string )$ exception ->getResponse ()->getBody (), true );
101- $ databaseException = new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
102- throw $ databaseException ;
100+ throw new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
103101 }
104102 }
105103
@@ -122,8 +120,7 @@ public static function userDatabases(Connection $connection): ArrayList
122120 return new ArrayList ($ data ['result ' ]);
123121 } catch (ClientException $ exception ) {
124122 $ response = json_decode ((string )$ exception ->getResponse ()->getBody (), true );
125- $ databaseException = new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
126- throw $ databaseException ;
123+ throw new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
127124 }
128125 }
129126
@@ -147,8 +144,7 @@ public static function current(Connection $connection): array
147144 return $ data ['result ' ];
148145 } catch (ClientException $ exception ) {
149146 $ response = json_decode ((string )$ exception ->getResponse ()->getBody (), true );
150- $ databaseException = new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
151- throw $ databaseException ;
147+ throw new DatabaseException ($ response ['errorMessage ' ], $ exception , $ response ['errorNum ' ]);
152148 }
153149 }
154150}
0 commit comments