From 837b97b58264f636bd985e22b4004eef9ba6234f Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 21 Mar 2018 13:38:58 +0100 Subject: [PATCH] phpDoc: added $var name to @param --- src/Dibi/Connection.php | 21 ++++++++++----------- src/Dibi/DataSource.php | 8 ++++---- src/Dibi/DateTime.php | 2 +- src/Dibi/Drivers/FirebirdDriver.php | 8 ++++---- src/Dibi/Drivers/MsSqlDriver.php | 8 ++++---- src/Dibi/Drivers/MySqliDriver.php | 6 +++--- src/Dibi/Drivers/OdbcDriver.php | 8 ++++---- src/Dibi/Drivers/OracleDriver.php | 8 ++++---- src/Dibi/Drivers/PdoDriver.php | 6 +++--- src/Dibi/Drivers/PostgreDriver.php | 9 ++++----- src/Dibi/Drivers/Sqlite3Driver.php | 6 +++--- src/Dibi/Drivers/SqlsrvDriver.php | 8 ++++---- src/Dibi/Fluent.php | 9 +++------ src/Dibi/Helpers.php | 2 +- src/Dibi/Result.php | 2 +- src/Dibi/Translator.php | 2 +- src/Dibi/dibi.php | 18 +++++++++--------- src/Dibi/interfaces.php | 7 +++---- 18 files changed, 66 insertions(+), 72 deletions(-) diff --git a/src/Dibi/Connection.php b/src/Dibi/Connection.php index 785406e..afffd6b 100644 --- a/src/Dibi/Connection.php +++ b/src/Dibi/Connection.php @@ -50,8 +50,7 @@ class Connection * - run (bool) => enable profiler? * - file => file to log * - substitutes (array) => map of driver specific substitutes (under development) - * @param mixed connection parameters - * @param string connection name + * @param mixed $config connection parameters * @throws Exception */ public function __construct($config, string $name = null) @@ -199,7 +198,7 @@ class Connection /** * Generates (translates) and executes SQL query. - * @param mixed one or more arguments + * @param mixed $args * @return Result|int result set or number of affected rows * @throws Exception */ @@ -211,7 +210,7 @@ class Connection /** * Generates SQL query. - * @param mixed one or more arguments + * @param mixed $args * @throws Exception */ final public function translate(...$args): string @@ -222,7 +221,7 @@ class Connection /** * Generates and prints SQL query. - * @param mixed one or more arguments + * @param mixed $args */ final public function test(...$args): bool { @@ -243,7 +242,7 @@ class Connection /** * Generates (translates) and returns SQL query as DataSource. - * @param mixed one or more arguments + * @param mixed $args * @throws Exception */ final public function dataSource(...$args): DataSource @@ -481,7 +480,7 @@ class Connection /** * Executes SQL query and fetch result - shortcut for query() & fetch(). - * @param mixed one or more arguments + * @param mixed $args * @throws Exception */ public function fetch(...$args): ?Row @@ -492,7 +491,7 @@ class Connection /** * Executes SQL query and fetch results - shortcut for query() & fetchAll(). - * @param mixed one or more arguments + * @param mixed $args * @return Row[] * @throws Exception */ @@ -504,7 +503,7 @@ class Connection /** * Executes SQL query and fetch first column - shortcut for query() & fetchSingle(). - * @param mixed one or more arguments + * @param mixed $args * @return mixed * @throws Exception */ @@ -516,7 +515,7 @@ class Connection /** * Executes SQL query and fetch pairs - shortcut for query() & fetchPairs(). - * @param mixed one or more arguments + * @param mixed $args * @throws Exception */ public function fetchPairs(...$args): array @@ -536,7 +535,7 @@ class Connection /** * Import SQL dump from file. - * @param callable $onProgress function (int $count, ?float $percent): void + * @param callable $onProgress function (int $count, ?float $percent): void * @return int count of sql commands */ public function loadFile(string $file, callable $onProgress = null): int diff --git a/src/Dibi/DataSource.php b/src/Dibi/DataSource.php index af013b5..1efdd48 100644 --- a/src/Dibi/DataSource.php +++ b/src/Dibi/DataSource.php @@ -49,7 +49,7 @@ class DataSource implements IDataSource /** - * @param string SQL command or table or view name, as data source + * @param string $sql command or table or view name, as data source */ public function __construct(string $sql, Connection $connection) { @@ -64,8 +64,8 @@ class DataSource implements IDataSource /** * Selects columns to query. - * @param string|array column name or array of column names - * @param string column alias + * @param string|array $col column name or array of column names + * @param string $as column alias */ public function select($col, string $as = null): self { @@ -97,7 +97,7 @@ class DataSource implements IDataSource /** * Selects columns to order by. - * @param string|array column name or array of column names + * @param string|array $row column name or array of column names */ public function orderBy($row, string $direction = 'ASC'): self { diff --git a/src/Dibi/DateTime.php b/src/Dibi/DateTime.php index e71a3bf..9612d2e 100644 --- a/src/Dibi/DateTime.php +++ b/src/Dibi/DateTime.php @@ -18,7 +18,7 @@ class DateTime extends \DateTime use Strict; /** - * @param string|int + * @param string|int $time */ public function __construct($time = 'now', \DateTimeZone $timezone = null) { diff --git a/src/Dibi/Drivers/FirebirdDriver.php b/src/Dibi/Drivers/FirebirdDriver.php index c1fc091..96a4181 100644 --- a/src/Dibi/Drivers/FirebirdDriver.php +++ b/src/Dibi/Drivers/FirebirdDriver.php @@ -224,7 +224,7 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Result set driver factory. - * @param resource + * @param resource $resource */ public function createResultDriver($resource): Dibi\ResultDriver { @@ -265,7 +265,7 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -277,7 +277,7 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -341,7 +341,7 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/MsSqlDriver.php b/src/Dibi/Drivers/MsSqlDriver.php index c26c140..0bc06ea 100644 --- a/src/Dibi/Drivers/MsSqlDriver.php +++ b/src/Dibi/Drivers/MsSqlDriver.php @@ -174,7 +174,7 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver /** * Result set driver factory. - * @param resource + * @param resource $resource */ public function createResultDriver($resource): Dibi\ResultDriver { @@ -216,7 +216,7 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -228,7 +228,7 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -298,7 +298,7 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/MySqliDriver.php b/src/Dibi/Drivers/MySqliDriver.php index c866f74..caea7a5 100644 --- a/src/Dibi/Drivers/MySqliDriver.php +++ b/src/Dibi/Drivers/MySqliDriver.php @@ -300,7 +300,7 @@ class MySqliDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -312,7 +312,7 @@ class MySqliDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -384,7 +384,7 @@ class MySqliDriver implements Dibi\Driver, Dibi\ResultDriver /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/OdbcDriver.php b/src/Dibi/Drivers/OdbcDriver.php index 9bf9a01..83bacd5 100644 --- a/src/Dibi/Drivers/OdbcDriver.php +++ b/src/Dibi/Drivers/OdbcDriver.php @@ -198,7 +198,7 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Result set driver factory. - * @param resource + * @param resource $resource */ public function createResultDriver($resource): Dibi\ResultDriver { @@ -239,7 +239,7 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -251,7 +251,7 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -322,7 +322,7 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/OracleDriver.php b/src/Dibi/Drivers/OracleDriver.php index a0d89a9..7a5e975 100644 --- a/src/Dibi/Drivers/OracleDriver.php +++ b/src/Dibi/Drivers/OracleDriver.php @@ -221,7 +221,7 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Result set driver factory. - * @param resource + * @param resource $resource */ public function createResultDriver($resource): Dibi\ResultDriver { @@ -263,7 +263,7 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -277,7 +277,7 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -353,7 +353,7 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/PdoDriver.php b/src/Dibi/Drivers/PdoDriver.php index 1fe6b06..df4168c 100644 --- a/src/Dibi/Drivers/PdoDriver.php +++ b/src/Dibi/Drivers/PdoDriver.php @@ -298,7 +298,7 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -310,7 +310,7 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -467,7 +467,7 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/PostgreDriver.php b/src/Dibi/Drivers/PostgreDriver.php index c9b886c..38d72b8 100644 --- a/src/Dibi/Drivers/PostgreDriver.php +++ b/src/Dibi/Drivers/PostgreDriver.php @@ -127,7 +127,6 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Executes the SQL query. - * @param string SQL statement. * @throws Dibi\DriverException */ public function query(string $sql): ?Dibi\ResultDriver @@ -263,7 +262,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Result set driver factory. - * @param resource + * @param resource $resource */ public function createResultDriver($resource): Dibi\ResultDriver { @@ -311,7 +310,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -323,7 +322,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -395,7 +394,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/Sqlite3Driver.php b/src/Dibi/Drivers/Sqlite3Driver.php index 0af5245..b2992ca 100644 --- a/src/Dibi/Drivers/Sqlite3Driver.php +++ b/src/Dibi/Drivers/Sqlite3Driver.php @@ -259,7 +259,7 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -271,7 +271,7 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -340,7 +340,7 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Drivers/SqlsrvDriver.php b/src/Dibi/Drivers/SqlsrvDriver.php index e270377..b064c6d 100644 --- a/src/Dibi/Drivers/SqlsrvDriver.php +++ b/src/Dibi/Drivers/SqlsrvDriver.php @@ -195,7 +195,7 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver /** * Result set driver factory. - * @param resource + * @param resource $resource */ public function createResultDriver($resource): Dibi\ResultDriver { @@ -237,7 +237,7 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDate($value): string { @@ -249,7 +249,7 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ public function escapeDateTime($value): string { @@ -328,7 +328,7 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $assoc true for associative array, false for numeric */ public function fetch(bool $assoc): ?array { diff --git a/src/Dibi/Fluent.php b/src/Dibi/Fluent.php index f637159..18ebdcb 100644 --- a/src/Dibi/Fluent.php +++ b/src/Dibi/Fluent.php @@ -268,7 +268,7 @@ class Fluent implements IDataSource /** * Adds Result setup. - * @param mixed args + * @param mixed $method */ public function setupResult(string $method): self { @@ -282,7 +282,7 @@ class Fluent implements IDataSource /** * Generates and executes SQL query. - * @param mixed what to return? + * @param mixed $return what to return? * @return Result|int result set or number of affected rows * @throws Exception */ @@ -338,7 +338,7 @@ class Fluent implements IDataSource /** * Fetches all records from table and returns associative tree. - * @param string associative descriptor + * @param string $assoc associative descriptor */ public function fetchAssoc(string $assoc): array { @@ -348,7 +348,6 @@ class Fluent implements IDataSource /** * Fetches all records from table like $key => $value pairs. - * @param string associative key */ public function fetchPairs(string $key = null, string $value = null): array { @@ -367,7 +366,6 @@ class Fluent implements IDataSource /** * Generates and prints SQL query or it's part. - * @param string clause name */ public function test(string $clause = null): bool { @@ -422,7 +420,6 @@ class Fluent implements IDataSource /** * Generates parameters for Translator. - * @param string clause name */ protected function _export(string $clause = null, array $args = []): array { diff --git a/src/Dibi/Helpers.php b/src/Dibi/Helpers.php index d1b3d80..90f58a3 100644 --- a/src/Dibi/Helpers.php +++ b/src/Dibi/Helpers.php @@ -20,7 +20,7 @@ class Helpers /** * Prints out a syntax highlighted version of the SQL command or Result. - * @param string|Result + * @param string|Result $sql */ public static function dump($sql = null, bool $return = false): ?string { diff --git a/src/Dibi/Result.php b/src/Dibi/Result.php index 5add1ee..315081d 100644 --- a/src/Dibi/Result.php +++ b/src/Dibi/Result.php @@ -502,7 +502,7 @@ class Result implements IDataSource /** * Define column type. - * @param string $type use constant Type::* + * @param string $type use constant Type::* */ final public function setType(string $column, string $type): self { diff --git a/src/Dibi/Translator.php b/src/Dibi/Translator.php index 01fb914..e2f9241 100644 --- a/src/Dibi/Translator.php +++ b/src/Dibi/Translator.php @@ -167,7 +167,7 @@ final class Translator /** * Apply modifier to single value. - * @param mixed + * @param mixed $value */ public function formatValue($value, ?string $modifier): string { diff --git a/src/Dibi/dibi.php b/src/Dibi/dibi.php index 327f2ac..56df300 100644 --- a/src/Dibi/dibi.php +++ b/src/Dibi/dibi.php @@ -127,7 +127,7 @@ class dibi /** * Generates and executes SQL query - Monostate for Dibi\Connection::query(). - * @param mixed one or more arguments + * @param mixed $args * @return Dibi\Result|int result set or number of affected rows * @throws Dibi\Exception */ @@ -149,7 +149,7 @@ class dibi /** * Generates and prints SQL query - Monostate for Dibi\Connection::test(). - * @param mixed one or more arguments + * @param mixed $args */ public static function test(...$args): bool { @@ -159,7 +159,7 @@ class dibi /** * Generates and returns SQL query as DataSource - Monostate for Dibi\Connection::test(). - * @param mixed one or more arguments + * @param mixed $args */ public static function dataSource(...$args): Dibi\DataSource { @@ -169,7 +169,7 @@ class dibi /** * Executes SQL query and fetch result - Monostate for Dibi\Connection::query() & fetch(). - * @param mixed one or more arguments + * @param mixed $args * @throws Dibi\Exception */ public static function fetch(...$args): ?Dibi\Row @@ -180,7 +180,7 @@ class dibi /** * Executes SQL query and fetch results - Monostate for Dibi\Connection::query() & fetchAll(). - * @param mixed one or more arguments + * @param mixed $args * @return Dibi\Row[] * @throws Dibi\Exception */ @@ -192,7 +192,7 @@ class dibi /** * Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle(). - * @param mixed one or more arguments + * @param mixed $args * @return mixed * @throws Dibi\Exception */ @@ -204,7 +204,7 @@ class dibi /** * Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs(). - * @param mixed one or more arguments + * @param mixed $args * @throws Dibi\Exception */ public static function fetchPairs(...$args): array @@ -354,8 +354,8 @@ class dibi /** * Prints out a syntax highlighted version of the SQL command or Result. - * @param string|Result - * @param bool return output instead of printing it? + * @param string|Result $sql + * @param bool $return return output instead of printing it? */ public static function dump($sql = null, bool $return = false): ?string { diff --git a/src/Dibi/interfaces.php b/src/Dibi/interfaces.php index 35fd217..c352a2a 100644 --- a/src/Dibi/interfaces.php +++ b/src/Dibi/interfaces.php @@ -95,12 +95,12 @@ interface Driver function escapeBool(bool $value): string; /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ function escapeDate($value): string; /** - * @param \DateTimeInterface|string|int + * @param \DateTimeInterface|string|int $value */ function escapeDateTime($value): string; @@ -136,14 +136,13 @@ interface ResultDriver /** * Fetches the row at current position and moves the internal cursor to the next position. - * @param bool true for associative array, false for numeric + * @param bool $type true for associative array, false for numeric * @internal */ function fetch(bool $type): ?array; /** * Frees the resources allocated for this result set. - * @param resource result set resource */ function free(): void;