Skip to content

Commit 3be2c9a

Browse files
committed
DB functions may return int instead of recordset
1 parent 9a1b4da commit 3be2c9a

32 files changed

+210
-201
lines changed

src/database/Postgres.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function printField($name, $value, $type, $extras = [])
179179
* @param string $term The search term
180180
* @param string $filter The object type to restrict to ('' means no restriction)
181181
*
182-
* @return \PHPPgAdmin\ADORecordSet A recordset
182+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
183183
*/
184184
public function findObject($term, $filter)
185185
{
@@ -376,7 +376,7 @@ public function getAttributeNames($table, $atts)
376376
*
377377
* @param bool $all True to get all languages, regardless of show_system
378378
*
379-
* @return \PHPPgAdmin\ADORecordSet A recordset
379+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
380380
*/
381381
public function getLanguages($all = false)
382382
{

src/database/Postgres10.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Postgres10 extends Postgres96
2525
/**
2626
* Return all tables in current database (and schema).
2727
*
28-
* @return \PHPPgAdmin\ADORecordSet All tables, sorted alphabetically
28+
* @return \PHPPgAdmin\ADORecordSet|int All tables, sorted alphabetically
2929
*/
3030
public function getTables()
3131
{

src/database/Postgres11.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Postgres11 extends Postgres10
2626
* @param bool $all If true, will find all available functions, if false just those in search path
2727
* @param mixed $type If truthy, will return functions of type trigger
2828
*
29-
* @return \PHPPgAdmin\ADORecordSet All functions
29+
* @return \PHPPgAdmin\ADORecordSet|int All functions
3030
*/
3131
public function getFunctions($all = false, $type = null)
3232
{

src/database/Postgres74.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function alterDatabase($dbName, $newName, $newOwner = '', $comment = '')
6363
*
6464
* @param null|string $currentdatabase
6565
*
66-
* @return \PHPPgAdmin\ADORecordSet A list of databases, sorted alphabetically
66+
* @return \PHPPgAdmin\ADORecordSet|int A list of databases, sorted alphabetically
6767
*/
6868
public function getDatabases($currentdatabase = null)
6969
{
@@ -110,7 +110,7 @@ public function getDatabases($currentdatabase = null)
110110
* @param string $term The search term
111111
* @param string $filter The object type to restrict to ('' means no restriction)
112112
*
113-
* @return \PHPPgAdmin\ADORecordSet A recordset
113+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
114114
*/
115115
public function findObject($term, $filter)
116116
{
@@ -257,7 +257,7 @@ public function findObject($term, $filter)
257257
/**
258258
* Returns table locks information in the current database.
259259
*
260-
* @return \PHPPgAdmin\ADORecordSet A recordset
260+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
261261
*/
262262
public function getLocks()
263263
{
@@ -383,7 +383,7 @@ public function alterColumn(
383383
*
384384
* @param string $table The name of the table
385385
*
386-
* @return \PHPPgAdmin\ADORecordSet A recordset
386+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
387387
*/
388388
public function getTable($table)
389389
{
@@ -424,7 +424,7 @@ public function getDefaultWithOid()
424424
*
425425
* @param string $table the table where we are looking for fk
426426
*
427-
* @return \PHPPgAdmin\ADORecordSet A recordset
427+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
428428
*/
429429
public function getConstraintsWithFields($table)
430430
{
@@ -489,7 +489,7 @@ public function getConstraintsWithFields($table)
489489
*
490490
* @param bool $all
491491
*
492-
* @return \PHPPgAdmin\ADORecordSet A recordset
492+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
493493
*/
494494
public function getSequences($all = false)
495495
{
@@ -520,7 +520,7 @@ public function getSequences($all = false)
520520
*
521521
* @param int $function_oid function identifier
522522
*
523-
* @return \PHPPgAdmin\ADORecordSet Function info
523+
* @return \PHPPgAdmin\ADORecordSet|int Function info
524524
*
525525
* @internal param string The $func name of the function to retrieve
526526
*/
@@ -560,7 +560,7 @@ public function getFunction($function_oid)
560560
/**
561561
* Returns a list of all casts in the database.
562562
*
563-
* @return \PHPPgAdmin\ADORecordSet All casts
563+
* @return \PHPPgAdmin\ADORecordSet|int All casts
564564
*/
565565
public function getCasts()
566566
{

src/database/Postgres80.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Postgres80 extends Postgres81
5757
*
5858
* @param null|string $currentdatabase
5959
*
60-
* @return \PHPPgAdmin\ADORecordSet A list of databases, sorted alphabetically
60+
* @return \PHPPgAdmin\ADORecordSet|int A list of databases, sorted alphabetically
6161
*/
6262
public function getDatabases($currentdatabase = null)
6363
{
@@ -104,7 +104,7 @@ public function getDatabases($currentdatabase = null)
104104
/**
105105
* Return all schemas in the current database.
106106
*
107-
* @return \PHPPgAdmin\ADORecordSet All schemas, sorted alphabetically
107+
* @return \PHPPgAdmin\ADORecordSet|int All schemas, sorted alphabetically
108108
*/
109109
public function getSchemas()
110110
{
@@ -132,7 +132,7 @@ public function getSchemas()
132132
*
133133
* @param string $schema The name of the schema
134134
*
135-
* @return \PHPPgAdmin\ADORecordSet Schema information
135+
* @return \PHPPgAdmin\ADORecordSet|int Schema information
136136
*/
137137
public function getSchemaByName($schema)
138138
{
@@ -155,7 +155,7 @@ public function getSchemaByName($schema)
155155
* @param string $username The username
156156
* @param string $password The new password
157157
*
158-
* @return int 0 if operation was successful
158+
* @return \PHPPgAdmin\ADORecordSet|int 0 if operation was successful
159159
*/
160160
public function changePassword($username, $password)
161161
{
@@ -176,7 +176,7 @@ public function changePassword($username, $password)
176176
* @param string $name The name of the aggregate
177177
* @param string $basetype The input data type of the aggregate
178178
*
179-
* @return \PHPPgAdmin\ADORecordSet A recordset
179+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
180180
*/
181181
public function getAggregate($name, $basetype)
182182
{
@@ -431,7 +431,7 @@ protected function _alterSequence(
431431
/**
432432
* Return all tables in current database (and schema).
433433
*
434-
* @return \PHPPgAdmin\ADORecordSet All tables, sorted alphabetically
434+
* @return \PHPPgAdmin\ADORecordSet|int All tables, sorted alphabetically
435435
*/
436436
public function getTables()
437437
{

src/database/Postgres81.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Postgres81 extends Postgres82
5454
*
5555
* @param null|string $currentdatabase
5656
*
57-
* @return \PHPPgAdmin\ADORecordSet A list of databases, sorted alphabetically
57+
* @return \PHPPgAdmin\ADORecordSet|int A list of databases, sorted alphabetically
5858
*/
5959
public function getDatabases($currentdatabase = null)
6060
{
@@ -144,6 +144,9 @@ public function alterDatabase($dbName, $newName, $newOwner = '', $comment = '')
144144

145145
// Autovacuum functions
146146

147+
/**
148+
* @return \PHPPgAdmin\ADORecordSet|int
149+
*/
147150
public function saveAutovacuum(
148151
$table,
149152
$vacenabled,
@@ -250,7 +253,7 @@ public function saveAutovacuum(
250253
*
251254
* @param null|string $database (optional) Find only connections to specified database
252255
*
253-
* @return \PHPPgAdmin\ADORecordSet A recordset
256+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
254257
*/
255258
public function getProcesses($database = null)
256259
{
@@ -278,7 +281,7 @@ public function getProcesses($database = null)
278281
*
279282
* @param string $spcname namespace
280283
*
281-
* @return \PHPPgAdmin\ADORecordSet A recordset
284+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
282285
*/
283286
public function getTablespace($spcname)
284287
{
@@ -295,7 +298,7 @@ public function getTablespace($spcname)
295298
*
296299
* @param bool $all Include all tablespaces (necessary when moving objects back to the default space)
297300
*
298-
* @return \PHPPgAdmin\ADORecordSet A recordset
301+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
299302
*/
300303
public function getTablespaces($all = false)
301304
{

src/database/Postgres82.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Postgres82 extends Postgres83
5151
/**
5252
* Returns table locks information in the current database.
5353
*
54-
* @return \PHPPgAdmin\ADORecordSet A recordset
54+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
5555
*/
5656
public function getLocks()
5757
{
@@ -79,7 +79,7 @@ public function getLocks()
7979
* @param \PHPPgAdmin\ADORecordSet $seqrs The sequence RecordSet returned by getSequence()
8080
* @param string $name The new name for the sequence
8181
*
82-
* @return int 0 if operation was successful
82+
* @return \PHPPgAdmin\ADORecordSet|int 0 if operation was successful
8383
*/
8484
public function alterSequenceName($seqrs, $name)
8585
{
@@ -107,7 +107,7 @@ public function alterSequenceName($seqrs, $name)
107107
* @param \PHPPgAdmin\ADORecordSet $vwrs The view recordSet returned by getView()
108108
* @param string $name The new view's name
109109
*
110-
* @return int -1 if Failed
110+
* @return \PHPPgAdmin\ADORecordSet|int -1 if Failed
111111
*/
112112
public function alterViewName($vwrs, $name)
113113
{
@@ -135,7 +135,7 @@ public function alterViewName($vwrs, $name)
135135
*
136136
* @param string $table The name of a table whose triggers to retrieve
137137
*
138-
* @return \PHPPgAdmin\ADORecordSet A recordset
138+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
139139
*/
140140
public function getTriggers($table = '')
141141
{
@@ -167,7 +167,7 @@ public function getTriggers($table = '')
167167
*
168168
* @param int $function_oid
169169
*
170-
* @return \PHPPgAdmin\ADORecordSet Function info
170+
* @return \PHPPgAdmin\ADORecordSet|int Function info
171171
*
172172
* @internal param string The $func name of the function to retrieve
173173
*/
@@ -338,7 +338,7 @@ public function clusterIndex($table = '', $index = '')
338338
*
339339
* @param int $operator_oid The oid of the operator
340340
*
341-
* @return \PHPPgAdmin\ADORecordSet Function info
341+
* @return \PHPPgAdmin\ADORecordSet|int Function info
342342
*/
343343
public function getOperator($operator_oid)
344344
{
@@ -374,7 +374,7 @@ public function getOperator($operator_oid)
374374
/**
375375
* Gets all opclasses.
376376
*
377-
* @return \PHPPgAdmin\ADORecordSet A recordset
377+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
378378
*/
379379
public function getOpClasses()
380380
{

src/database/Postgres83.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getDatabases($currentdatabase = null)
103103
*
104104
* @param string $table
105105
*
106-
* @return \PHPPgAdmin\ADORecordSet A recordset
106+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
107107
*/
108108
public function getTableAutovacuum($table = '')
109109
{
@@ -149,6 +149,9 @@ public function getTableAutovacuum($table = '')
149149
return $this->selectSet($sql);
150150
}
151151

152+
/**
153+
* @return \PHPPgAdmin\ADORecordSet|int
154+
*/
152155
public function saveAutovacuum(
153156
$table,
154157
$vacenabled,
@@ -264,6 +267,9 @@ public function saveAutovacuum(
264267
return $status;
265268
}
266269

270+
/**
271+
* @return bool|int
272+
*/
267273
public function dropAutovacuum($table)
268274
{
269275
$c_schema = $this->_schema;
@@ -295,7 +301,7 @@ public function dropAutovacuum($table)
295301
* @param bool $cycledvalue Sequence can cycle ?
296302
* @param int $startvalue The sequence start value when issueing a restart (ignored)
297303
*
298-
* @return int 0 if operation was successful
304+
* @return \PHPPgAdmin\ADORecordSet|int 0 if operation was successful
299305
*/
300306
public function alterSequenceProps(
301307
$seqrs,
@@ -351,7 +357,7 @@ public function alterSequenceProps(
351357
* @param \PHPPgAdmin\ADORecordSet $seqrs The sequence RecordSet returned by getSequence()
352358
* @param string $owner sequence owner
353359
*
354-
* @return int 0 if operation was successful
360+
* @return \PHPPgAdmin\ADORecordSet|int 0 if operation was successful
355361
*
356362
* @internal param string The $name new owner for the sequence
357363
*/
@@ -379,7 +385,7 @@ public function alterSequenceOwner($seqrs, $owner)
379385
*
380386
* @param $function_oid
381387
*
382-
* @return \PHPPgAdmin\ADORecordSet Function info
388+
* @return \PHPPgAdmin\ADORecordSet|int Function info
383389
*
384390
* @internal param string $func name of the function to retrieve
385391
*/

src/database/Postgres84.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Postgres84 extends Postgres90
3939
*
4040
* @param string $table The name of a table whose triggers to retrieve
4141
*
42-
* @return \PHPPgAdmin\ADORecordSet A recordset
42+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
4343
*/
4444
public function getTriggers($table = '')
4545
{
@@ -71,7 +71,7 @@ public function getTriggers($table = '')
7171
* @param string $term The search term
7272
* @param string $filter The object type to restrict to ('' means no restriction)
7373
*
74-
* @return \PHPPgAdmin\ADORecordSet A recordset
74+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
7575
*/
7676
public function findObject($term, $filter)
7777
{

src/database/Postgres91.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Postgres91 extends Postgres92
2727
*
2828
* @param null|string $database (optional) Find only connections to specified database
2929
*
30-
* @return \PHPPgAdmin\ADORecordSet A recordset
30+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
3131
*/
3232
public function getProcesses($database = null)
3333
{
@@ -53,7 +53,7 @@ public function getProcesses($database = null)
5353
*
5454
* @param bool $all Include all tablespaces (necessary when moving objects back to the default space)
5555
*
56-
* @return \PHPPgAdmin\ADORecordSet A recordset
56+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
5757
*/
5858
public function getTablespaces($all = false)
5959
{
@@ -77,7 +77,7 @@ public function getTablespaces($all = false)
7777
*
7878
* @param string $spcname
7979
*
80-
* @return \PHPPgAdmin\ADORecordSet A recordset
80+
* @return \PHPPgAdmin\ADORecordSet|int A recordset
8181
*/
8282
public function getTablespace($spcname)
8383
{

0 commit comments

Comments
 (0)