Skip to content

Commit cc16dbb

Browse files
committed
Escape dollar signs in PHPDoc callback signatures for proper rendering in IDEs and consistency with official documentation.
1 parent 35ed69b commit cc16dbb

4 files changed

Lines changed: 66 additions & 66 deletions

File tree

PDO/PDO.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class PDO
421421
* <p>
422422
* using <b>PDO::ATTR_DRIVER_NAME</b>
423423
* <code>
424-
* if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
424+
* if (\$db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
425425
* echo "Running on mysql; doing something mysql specific here\n";
426426
* }
427427
* </code>
@@ -590,11 +590,11 @@ class PDO
590590
* <p>
591591
* Forcing queries to be buffered in mysql
592592
* <code>
593-
* if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
594-
* $stmt = $db->prepare('select * from foo',
593+
* if (\$db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
594+
* \$stmt = \$db->prepare('select * from foo',
595595
* array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
596596
* } else {
597-
* die("my application only works with mysql; I should use \$stmt->fetchAll() instead");
597+
* die("my application only works with mysql; I should use \\$stmt->fetchAll() instead");
598598
* }
599599
* </code>
600600
* </p>
@@ -1198,7 +1198,7 @@ public function setAttribute(
11981198
* <b>PDO::exec</b>, wherein a statement that affected 0 rows
11991199
* results in a call to <b>die</b>:
12001200
* <code>
1201-
* $db->exec() or die(print_r($db->errorInfo(), true));
1201+
* \$db->exec() or die(print_r(\$db->errorInfo(), true));
12021202
* </code>
12031203
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
12041204
*/
@@ -2269,23 +2269,23 @@ class Sqlite extends PDO
22692269
* @param callable $step Callback function called for each row of the result set. The
22702270
* callback should accumulate the result and store it in the aggregation context. This
22712271
* function need to be defined as:
2272-
* <code>step ( mixed $context , int $rownumber , mixed $value , mixed $values ): mixed</code>
2273-
* <br/>$context - null for the first row; on subsequent rows it will have the value that was
2272+
* <code>step ( mixed \$context , int \$rownumber , mixed \$value , mixed \$values ): mixed</code>
2273+
* <br/>\$context - null for the first row; on subsequent rows it will have the value that was
22742274
* previously returned from the step function; you should use this to maintain the aggregate
22752275
* state.
2276-
* <br/>$rownumber - The current row number.
2277-
* <br/>$value - The first argument passed to the aggregate.
2278-
* <br/>$values - Further arguments passed to the aggregate.
2276+
* <br/>\$rownumber - The current row number.
2277+
* <br/>\$value - The first argument passed to the aggregate.
2278+
* <br/>\$values - Further arguments passed to the aggregate.
22792279
* <br/>The return value of this function will be used as the context argument in the next
22802280
* call of the step or finalize functions.
22812281
* @param callable $finalize Callback function to aggregate the "stepped" data from each
22822282
* row. Once all the rows have been processed, this function will be called, and it should
22832283
* then take the data from the aggregation context and return the result. This callback
22842284
* function should return a type understood by SQLite (i.e. scalar type). This function need
22852285
* to be defined as:
2286-
* <code>fini ( mixed $context , int $rowcount ): mixed</code>
2287-
* <br/>$context - Holds the return value from the very last call to the step function.
2288-
* <br/>$rowcount - Holds the number of rows over which the aggregate was performed.
2286+
* <code>fini ( mixed \$context , int \$rowcount ): mixed</code>
2287+
* <br/>\$context - Holds the return value from the very last call to the step function.
2288+
* <br/>\$rowcount - Holds the number of rows over which the aggregate was performed.
22892289
* <br/>The return value of this function will be used as the return value for the
22902290
* aggregate.
22912291
* @param int $numArgs Hint to the SQLite parser if the callback function accepts a
@@ -2328,9 +2328,9 @@ public function createCollation(string $name, callable $callback): bool {}
23282328
* @param callable $callback Callback function to handle the defined SQL function. Callback
23292329
* functions should return a type understood by SQLite (i.e. scalar type). This function
23302330
* need to be defined as:
2331-
* <code>callback ( mixed $value , mixed $values ): mixed</code>
2332-
* <br/>$value - The first argument passed to the SQL function.
2333-
* <br/>$values - Further arguments passed to the SQL function.
2331+
* <code>callback ( mixed \$value , mixed \$values ): mixed</code>
2332+
* <br/>\$value - The first argument passed to the SQL function.
2333+
* <br/>\$values - Further arguments passed to the SQL function.
23342334
* @param int $num_args The number of arguments that the SQL function takes. If this
23352335
* parameter is -1, then the SQL function may take any number of arguments.
23362336
* @param int $flags A bitmask of flags. Currently, only Pdo\Sqlite::DETERMINISTIC is

0 commit comments

Comments
 (0)