Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3153,6 +3153,8 @@ |
3154 | 3154 | * |
3155 | 3155 | * @param $wiki String |
3156 | 3156 | * @param $bits String |
| 3157 | + * |
| 3158 | + * @return array |
3157 | 3159 | */ |
3158 | 3160 | function wfSplitWikiID( $wiki ) { |
3159 | 3161 | $bits = explode( '-', $wiki, 2 ); |
Index: trunk/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -14,6 +14,10 @@ |
15 | 15 | * @see Database |
16 | 16 | */ |
17 | 17 | class DatabaseMysql extends DatabaseBase { |
| 18 | + |
| 19 | + /** |
| 20 | + * @return string |
| 21 | + */ |
18 | 22 | function getType() { |
19 | 23 | return 'mysql'; |
20 | 24 | } |
— | — | @@ -138,6 +142,9 @@ |
139 | 143 | return $success; |
140 | 144 | } |
141 | 145 | |
| 146 | + /** |
| 147 | + * @return bool |
| 148 | + */ |
142 | 149 | function close() { |
143 | 150 | $this->mOpened = false; |
144 | 151 | if ( $this->mConn ) { |
— | — | @@ -188,6 +195,11 @@ |
189 | 196 | return $row; |
190 | 197 | } |
191 | 198 | |
| 199 | + /** |
| 200 | + * @throws DBUnexpectedError |
| 201 | + * @param $res |
| 202 | + * @return int |
| 203 | + */ |
192 | 204 | function numRows( $res ) { |
193 | 205 | if ( $res instanceof ResultWrapper ) { |
194 | 206 | $res = $res->result; |
— | — | @@ -201,6 +213,10 @@ |
202 | 214 | return $n; |
203 | 215 | } |
204 | 216 | |
| 217 | + /** |
| 218 | + * @param $res |
| 219 | + * @return int |
| 220 | + */ |
205 | 221 | function numFields( $res ) { |
206 | 222 | if ( $res instanceof ResultWrapper ) { |
207 | 223 | $res = $res->result; |
— | — | @@ -208,6 +224,11 @@ |
209 | 225 | return mysql_num_fields( $res ); |
210 | 226 | } |
211 | 227 | |
| 228 | + /** |
| 229 | + * @param $res |
| 230 | + * @param $n |
| 231 | + * @return string |
| 232 | + */ |
212 | 233 | function fieldName( $res, $n ) { |
213 | 234 | if ( $res instanceof ResultWrapper ) { |
214 | 235 | $res = $res->result; |
— | — | @@ -215,7 +236,12 @@ |
216 | 237 | return mysql_field_name( $res, $n ); |
217 | 238 | } |
218 | 239 | |
219 | | - function insertId() { return mysql_insert_id( $this->mConn ); } |
| 240 | + /** |
| 241 | + * @return int |
| 242 | + */ |
| 243 | + function insertId() { |
| 244 | + return mysql_insert_id( $this->mConn ); |
| 245 | + } |
220 | 246 | |
221 | 247 | function dataSeek( $res, $row ) { |
222 | 248 | if ( $res instanceof ResultWrapper ) { |
— | — | @@ -250,7 +276,12 @@ |
251 | 277 | return $error; |
252 | 278 | } |
253 | 279 | |
254 | | - function affectedRows() { return mysql_affected_rows( $this->mConn ); } |
| 280 | + /** |
| 281 | + * @return int |
| 282 | + */ |
| 283 | + function affectedRows() { |
| 284 | + return mysql_affected_rows( $this->mConn ); |
| 285 | + } |
255 | 286 | |
256 | 287 | function replace( $table, $uniqueIndexes, $rows, $fname = 'DatabaseMysql::replace' ) { |
257 | 288 | return $this->nativeReplace( $table, $rows, $fname ); |
— | — | @@ -260,6 +291,8 @@ |
261 | 292 | * Estimate rows in dataset |
262 | 293 | * Returns estimated count, based on EXPLAIN output |
263 | 294 | * Takes same arguments as Database::select() |
| 295 | + * |
| 296 | + * @return int |
264 | 297 | */ |
265 | 298 | public function estimateRowCount( $table, $vars='*', $conds='', $fname = 'DatabaseMysql::estimateRowCount', $options = array() ) { |
266 | 299 | $options['EXPLAIN'] = true; |
— | — | @@ -278,6 +311,11 @@ |
279 | 312 | return $rows; |
280 | 313 | } |
281 | 314 | |
| 315 | + /** |
| 316 | + * @param $table string |
| 317 | + * @param $field string |
| 318 | + * @return bool|MySQLField |
| 319 | + */ |
282 | 320 | function fieldInfo( $table, $field ) { |
283 | 321 | $table = $this->tableName( $table ); |
284 | 322 | $res = $this->query( "SELECT * FROM $table LIMIT 1", __METHOD__, true ); |
— | — | @@ -297,6 +335,8 @@ |
298 | 336 | /** |
299 | 337 | * Get information about an index into an object |
300 | 338 | * Returns false if the index does not exist |
| 339 | + * |
| 340 | + * @return false|array |
301 | 341 | */ |
302 | 342 | function indexInfo( $table, $index, $fname = 'DatabaseMysql::indexInfo' ) { |
303 | 343 | # SHOW INDEX works in MySQL 3.23.58, but SHOW INDEXES does not. |
— | — | @@ -322,11 +362,20 @@ |
323 | 363 | return empty( $result ) ? false : $result; |
324 | 364 | } |
325 | 365 | |
| 366 | + /** |
| 367 | + * @param $db |
| 368 | + * @return bool |
| 369 | + */ |
326 | 370 | function selectDB( $db ) { |
327 | 371 | $this->mDBname = $db; |
328 | 372 | return mysql_select_db( $db, $this->mConn ); |
329 | 373 | } |
330 | 374 | |
| 375 | + /** |
| 376 | + * @param $s string |
| 377 | + * |
| 378 | + * @return string |
| 379 | + */ |
331 | 380 | function strencode( $s ) { |
332 | 381 | $sQuoted = mysql_real_escape_string( $s, $this->mConn ); |
333 | 382 | |
— | — | @@ -339,15 +388,26 @@ |
340 | 389 | |
341 | 390 | /** |
342 | 391 | * MySQL uses `backticks` for identifier quoting instead of the sql standard "double quotes". |
| 392 | + * |
| 393 | + * @param $s string |
| 394 | + * |
| 395 | + * @return string |
343 | 396 | */ |
344 | 397 | public function addIdentifierQuotes( $s ) { |
345 | 398 | return "`" . $this->strencode( $s ) . "`"; |
346 | 399 | } |
347 | 400 | |
| 401 | + /** |
| 402 | + * @param $name string |
| 403 | + * @return bool |
| 404 | + */ |
348 | 405 | public function isQuotedIdentifier( $name ) { |
349 | | - return strlen($name) && $name[0] == '`' && substr( $name, -1, 1 ) == '`'; |
| 406 | + return strlen( $name ) && $name[0] == '`' && substr( $name, -1, 1 ) == '`'; |
350 | 407 | } |
351 | 408 | |
| 409 | + /** |
| 410 | + * @return bool |
| 411 | + */ |
352 | 412 | function ping() { |
353 | 413 | $ping = mysql_ping( $this->mConn ); |
354 | 414 | if ( $ping ) { |
— | — | @@ -516,18 +576,31 @@ |
517 | 577 | } |
518 | 578 | } |
519 | 579 | |
| 580 | + /** |
| 581 | + * @return string |
| 582 | + */ |
520 | 583 | function getServerVersion() { |
521 | 584 | return mysql_get_server_info( $this->mConn ); |
522 | 585 | } |
523 | 586 | |
| 587 | + /** |
| 588 | + * @param $index |
| 589 | + * @return string |
| 590 | + */ |
524 | 591 | function useIndexClause( $index ) { |
525 | 592 | return "FORCE INDEX (" . $this->indexName( $index ) . ")"; |
526 | 593 | } |
527 | 594 | |
| 595 | + /** |
| 596 | + * @return string |
| 597 | + */ |
528 | 598 | function lowPriorityOption() { |
529 | 599 | return 'LOW_PRIORITY'; |
530 | 600 | } |
531 | 601 | |
| 602 | + /** |
| 603 | + * @return string |
| 604 | + */ |
532 | 605 | public static function getSoftwareLink() { |
533 | 606 | return '[http://www.mysql.com/ MySQL]'; |
534 | 607 | } |
— | — | @@ -630,6 +703,8 @@ |
631 | 704 | |
632 | 705 | /** |
633 | 706 | * Determines if the last failure was due to a deadlock |
| 707 | + * |
| 708 | + * @return bool |
634 | 709 | */ |
635 | 710 | function wasDeadlock() { |
636 | 711 | return $this->lastErrno() == 1213; |
— | — | @@ -638,6 +713,8 @@ |
639 | 714 | /** |
640 | 715 | * Determines if the last query error was something that should be dealt |
641 | 716 | * with by pinging the connection and reissuing the query |
| 717 | + * |
| 718 | + * @return bool |
642 | 719 | */ |
643 | 720 | function wasErrorReissuable() { |
644 | 721 | return $this->lastErrno() == 2013 || $this->lastErrno() == 2006; |
— | — | @@ -645,6 +722,8 @@ |
646 | 723 | |
647 | 724 | /** |
648 | 725 | * Determines if the last failure was due to the database being read-only. |
| 726 | + * |
| 727 | + * @return bool |
649 | 728 | */ |
650 | 729 | function wasReadOnlyError() { |
651 | 730 | return $this->lastErrno() == 1223 || |
— | — | @@ -702,6 +781,11 @@ |
703 | 782 | return $endArray; |
704 | 783 | } |
705 | 784 | |
| 785 | + /** |
| 786 | + * @param $tableName |
| 787 | + * @param $fName string |
| 788 | + * @return bool|ResultWrapper |
| 789 | + */ |
706 | 790 | public function dropTable( $tableName, $fName = 'DatabaseMysql::dropTable' ) { |
707 | 791 | if( !$this->tableExists( $tableName ) ) { |
708 | 792 | return false; |
— | — | @@ -735,6 +819,8 @@ |
736 | 820 | |
737 | 821 | /** |
738 | 822 | * Legacy support: Database == DatabaseMysql |
| 823 | + * |
| 824 | + * @deprecated in 1.16 |
739 | 825 | */ |
740 | 826 | class Database extends DatabaseMysql {} |
741 | 827 | |
— | — | @@ -759,10 +845,16 @@ |
760 | 846 | $this->type = $info->type; |
761 | 847 | } |
762 | 848 | |
| 849 | + /** |
| 850 | + * @return string |
| 851 | + */ |
763 | 852 | function name() { |
764 | 853 | return $this->name; |
765 | 854 | } |
766 | 855 | |
| 856 | + /** |
| 857 | + * @return string |
| 858 | + */ |
767 | 859 | function tableName() { |
768 | 860 | return $this->tableName; |
769 | 861 | } |
— | — | @@ -771,6 +863,9 @@ |
772 | 864 | return $this->type; |
773 | 865 | } |
774 | 866 | |
| 867 | + /** |
| 868 | + * @return bool |
| 869 | + */ |
775 | 870 | function isNullable() { |
776 | 871 | return $this->nullable; |
777 | 872 | } |
— | — | @@ -779,14 +874,23 @@ |
780 | 875 | return $this->default; |
781 | 876 | } |
782 | 877 | |
| 878 | + /** |
| 879 | + * @return bool |
| 880 | + */ |
783 | 881 | function isKey() { |
784 | 882 | return $this->is_key; |
785 | 883 | } |
786 | 884 | |
| 885 | + /** |
| 886 | + * @return bool |
| 887 | + */ |
787 | 888 | function isMultipleKey() { |
788 | 889 | return $this->is_multiple; |
789 | 890 | } |
790 | 891 | |
| 892 | + /** |
| 893 | + * @return int |
| 894 | + */ |
791 | 895 | function maxLength() { |
792 | 896 | return $this->max_length; |
793 | 897 | } |
Index: trunk/phase3/includes/db/DatabaseError.php |
— | — | @@ -87,6 +87,11 @@ |
88 | 88 | return false; |
89 | 89 | } |
90 | 90 | |
| 91 | + /** |
| 92 | + * @param $key |
| 93 | + * @param $fallback |
| 94 | + * @return string |
| 95 | + */ |
91 | 96 | function msg( $key, $fallback /*[, params...] */ ) { |
92 | 97 | global $wgLang; |
93 | 98 | |
Index: trunk/phase3/includes/db/LBFactory_Multi.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | $required = array( 'sectionsByDB', 'sectionLoads', 'serverTemplate' ); |
61 | 61 | $optional = array( 'groupLoadsBySection', 'groupLoadsByDB', 'hostsByName', |
62 | 62 | 'externalLoads', 'externalTemplateOverrides', 'templateOverridesByServer', |
63 | | - 'templateOverridesByCluster', 'masterTemplateOverrides', |
| 63 | + 'templateOverridesByCluster', 'masterTemplateOverrides', |
64 | 64 | 'readOnlyBySection' ); |
65 | 65 | |
66 | 66 | foreach ( $required as $key ) { |
— | — | @@ -83,6 +83,10 @@ |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
| 87 | + /** |
| 88 | + * @param $wiki bool|string |
| 89 | + * @return string |
| 90 | + */ |
87 | 91 | function getSectionForWiki( $wiki = false ) { |
88 | 92 | if ( $this->lastWiki === $wiki ) { |
89 | 93 | return $this->lastSection; |
— | — | @@ -99,7 +103,7 @@ |
100 | 104 | } |
101 | 105 | |
102 | 106 | /** |
103 | | - * @param $wiki string |
| 107 | + * @param $wiki bool|string |
104 | 108 | * @return LoadBalancer |
105 | 109 | */ |
106 | 110 | function newMainLB( $wiki = false ) { |
— | — | @@ -116,7 +120,7 @@ |
117 | 121 | } |
118 | 122 | |
119 | 123 | /** |
120 | | - * @param $wiki |
| 124 | + * @param $wiki bool|string |
121 | 125 | * @return LoadBalancer |
122 | 126 | */ |
123 | 127 | function getMainLB( $wiki = false ) { |
— | — | @@ -172,7 +176,7 @@ |
173 | 177 | $servers = $this->makeServerArray( $template, $loads, $groupLoads ); |
174 | 178 | $lb = new LoadBalancer( array( |
175 | 179 | 'servers' => $servers, |
176 | | - 'masterWaitTimeout' => $wgMasterWaitTimeout |
| 180 | + 'masterWaitTimeout' => $wgMasterWaitTimeout |
177 | 181 | )); |
178 | 182 | return $lb; |
179 | 183 | } |
— | — | @@ -180,6 +184,9 @@ |
181 | 185 | /** |
182 | 186 | * Make a server array as expected by LoadBalancer::__construct, using a template and load array |
183 | 187 | * |
| 188 | + * @param $template |
| 189 | + * @param $loads |
| 190 | + * @param $groupLoads |
184 | 191 | * @return array |
185 | 192 | */ |
186 | 193 | function makeServerArray( $template, $loads, $groupLoads ) { |
— | — | @@ -220,6 +227,8 @@ |
221 | 228 | |
222 | 229 | /** |
223 | 230 | * Take a group load array indexed by group then server, and reindex it by server then group |
| 231 | + * @param $groupLoads |
| 232 | + * @return array |
224 | 233 | */ |
225 | 234 | function reindexGroupLoads( $groupLoads ) { |
226 | 235 | $reindexed = array(); |
— | — | @@ -233,6 +242,8 @@ |
234 | 243 | |
235 | 244 | /** |
236 | 245 | * Get the database name and prefix based on the wiki ID |
| 246 | + * @param bool $wiki |
| 247 | + * @return array |
237 | 248 | */ |
238 | 249 | function getDBNameAndPrefix( $wiki = false ) { |
239 | 250 | if ( $wiki === false ) { |
— | — | @@ -247,6 +258,8 @@ |
248 | 259 | * Execute a function for each tracked load balancer |
249 | 260 | * The callback is called with the load balancer as the first parameter, |
250 | 261 | * and $params passed as the subsequent parameters. |
| 262 | + * @param $callback |
| 263 | + * @param $params array |
251 | 264 | */ |
252 | 265 | function forEachLB( $callback, $params = array() ) { |
253 | 266 | foreach ( $this->mainLBs as $lb ) { |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -224,6 +224,8 @@ |
225 | 225 | protected $mDefaultBigSelects = null; |
226 | 226 | protected $mSchemaVars = false; |
227 | 227 | |
| 228 | + protected $preparedArgs; |
| 229 | + |
228 | 230 | # ------------------------------------------------------------------------------ |
229 | 231 | # Accessors |
230 | 232 | # ------------------------------------------------------------------------------ |
— | — | @@ -290,7 +292,7 @@ |
291 | 293 | * code should use lastErrno() and lastError() to handle the |
292 | 294 | * situation as appropriate. |
293 | 295 | * |
294 | | - * @param $ignoreErrors |
| 296 | + * @param $ignoreErrors bool|null |
295 | 297 | * |
296 | 298 | * @return The previous value of the flag. |
297 | 299 | */ |
— | — | @@ -433,6 +435,8 @@ |
434 | 436 | /** |
435 | 437 | * Returns true if this database does an implicit order by when the column has an index |
436 | 438 | * For example: SELECT page_title FROM page LIMIT 1 |
| 439 | + * |
| 440 | + * @return bool |
437 | 441 | */ |
438 | 442 | function implicitOrderby() { |
439 | 443 | return true; |
— | — | @@ -530,6 +534,10 @@ |
531 | 535 | |
532 | 536 | /** |
533 | 537 | * General read-only accessor |
| 538 | + * |
| 539 | + * @param $name string |
| 540 | + * |
| 541 | + * @return string |
534 | 542 | */ |
535 | 543 | function getProperty( $name ) { |
536 | 544 | return $this->$name; |
— | — | @@ -707,7 +715,7 @@ |
708 | 716 | * The DBMS-dependent part of query() |
709 | 717 | * |
710 | 718 | * @param $sql String: SQL query. |
711 | | - * @return Result object to feed to fetchObject, fetchRow, ...; or false on failure |
| 719 | + * @return ResultWrapper Result object to feed to fetchObject, fetchRow, ...; or false on failure |
712 | 720 | */ |
713 | 721 | protected abstract function doQuery( $sql ); |
714 | 722 | |
— | — | @@ -1182,7 +1190,6 @@ |
1183 | 1191 | * @param $options Array Query options |
1184 | 1192 | * @param $join_conds Array Join conditions |
1185 | 1193 | * |
1186 | | - * |
1187 | 1194 | * @param $table string|array |
1188 | 1195 | * |
1189 | 1196 | * May be either an array of table names, or a single string holding a table |
— | — | @@ -1429,8 +1436,8 @@ |
1430 | 1437 | * Takes the same arguments as DatabaseBase::select(). |
1431 | 1438 | * |
1432 | 1439 | * @param $table String: table name |
1433 | | - * @param $vars Array: unused |
1434 | | - * @param $conds Array: filters on the table |
| 1440 | + * @param Array|string $vars : unused |
| 1441 | + * @param Array|string $conds : filters on the table |
1435 | 1442 | * @param $fname String: function name for profiling |
1436 | 1443 | * @param $options Array: options for select |
1437 | 1444 | * @return Integer: row count |
Index: trunk/phase3/includes/db/LBFactory_Single.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
19 | | - * @param $wiki |
| 19 | + * @param $wiki bool|string |
20 | 20 | * |
21 | 21 | * @return LoadBalancer_Single |
22 | 22 | */ |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
28 | | - * @param $wiki |
| 28 | + * @param $wiki bool|string |
29 | 29 | * |
30 | 30 | * @return LoadBalancer_Single |
31 | 31 | */ |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @param $cluster |
38 | | - * @param $wiki |
| 38 | + * @param $wiki bool|string |
39 | 39 | * |
40 | 40 | * @return LoadBalancer_Single |
41 | 41 | */ |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @param $cluster |
48 | | - * @param $wiki |
| 48 | + * @param $wiki bool|string |
49 | 49 | * |
50 | 50 | * @return LoadBalancer_Single |
51 | 51 | */ |
Index: trunk/phase3/includes/db/LoadBalancer.php |
— | — | @@ -391,6 +391,9 @@ |
392 | 392 | |
393 | 393 | /** |
394 | 394 | * Wait for a given slave to catch up to the master pos stored in $this |
| 395 | + * @param $index |
| 396 | + * @param $open bool |
| 397 | + * @return bool |
395 | 398 | */ |
396 | 399 | function doWait( $index, $open = false ) { |
397 | 400 | # Find a connection to wait on |
— | — | @@ -668,7 +671,7 @@ |
669 | 672 | function reallyOpenConnection( $server, $dbNameOverride = false ) { |
670 | 673 | if( !is_array( $server ) ) { |
671 | 674 | throw new MWException( 'You must update your load-balancing configuration. ' . |
672 | | - 'See DefaultSettings.php entry for $wgDBservers.' ); |
| 675 | + 'See DefaultSettings.php entry for $wgDBservers.' ); |
673 | 676 | } |
674 | 677 | |
675 | 678 | $host = $server['host']; |
— | — | @@ -837,8 +840,7 @@ |
838 | 841 | * Close a connection |
839 | 842 | * Using this function makes sure the LoadBalancer knows the connection is closed. |
840 | 843 | * If you use $conn->close() directly, the load balancer won't update its state. |
841 | | - * @param $conn |
842 | | - * @return void |
| 844 | + * @param $conn DatabaseBase |
843 | 845 | */ |
844 | 846 | function closeConnection( $conn ) { |
845 | 847 | $done = false; |
— | — | @@ -890,10 +892,17 @@ |
891 | 893 | } |
892 | 894 | } |
893 | 895 | |
| 896 | + /** |
| 897 | + * @param $value null |
| 898 | + * @return Mixed |
| 899 | + */ |
894 | 900 | function waitTimeout( $value = null ) { |
895 | 901 | return wfSetVar( $this->mWaitTimeout, $value ); |
896 | 902 | } |
897 | 903 | |
| 904 | + /** |
| 905 | + * @return bool |
| 906 | + */ |
898 | 907 | function getLaggedSlaveMode() { |
899 | 908 | return $this->mLaggedSlaveMode; |
900 | 909 | } |
— | — | @@ -906,6 +915,9 @@ |
907 | 916 | $this->mAllowLagged = $mode; |
908 | 917 | } |
909 | 918 | |
| 919 | + /** |
| 920 | + * @return bool |
| 921 | + */ |
910 | 922 | function pingAll() { |
911 | 923 | $success = true; |
912 | 924 | foreach ( $this->mConns as $conns2 ) { |
— | — | @@ -1005,6 +1017,10 @@ |
1006 | 1018 | * potentially restricted queries such as SHOW SLAVE STATUS. Using this |
1007 | 1019 | * function instead of Database::getLag() avoids a fatal error in this |
1008 | 1020 | * case on many installations. |
| 1021 | + * |
| 1022 | + * @param $conn DatabaseBase |
| 1023 | + * |
| 1024 | + * @return int |
1009 | 1025 | */ |
1010 | 1026 | function safeGetLag( $conn ) { |
1011 | 1027 | if ( $this->getServerCount() == 1 ) { |
Index: trunk/phase3/includes/db/DatabaseUtility.php |
— | — | @@ -155,6 +155,9 @@ |
156 | 156 | $this->currentRow = null; |
157 | 157 | } |
158 | 158 | |
| 159 | + /** |
| 160 | + * @return int |
| 161 | + */ |
159 | 162 | function current() { |
160 | 163 | if ( is_null( $this->currentRow ) ) { |
161 | 164 | $this->next(); |
— | — | @@ -162,16 +165,25 @@ |
163 | 166 | return $this->currentRow; |
164 | 167 | } |
165 | 168 | |
| 169 | + /** |
| 170 | + * @return int |
| 171 | + */ |
166 | 172 | function key() { |
167 | 173 | return $this->pos; |
168 | 174 | } |
169 | 175 | |
| 176 | + /** |
| 177 | + * @return int |
| 178 | + */ |
170 | 179 | function next() { |
171 | 180 | $this->pos++; |
172 | 181 | $this->currentRow = $this->fetchObject(); |
173 | 182 | return $this->currentRow; |
174 | 183 | } |
175 | 184 | |
| 185 | + /** |
| 186 | + * @return bool |
| 187 | + */ |
176 | 188 | function valid() { |
177 | 189 | return $this->current() !== false; |
178 | 190 | } |