1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 13:17:58 +02:00

phpDoc: added $var name to @param

This commit is contained in:
David Grudl
2018-03-21 13:38:58 +01:00
parent 121234aa9a
commit 837b97b582
18 changed files with 66 additions and 72 deletions

View File

@@ -50,8 +50,7 @@ class Connection
* - run (bool) => enable profiler? * - run (bool) => enable profiler?
* - file => file to log * - file => file to log
* - substitutes (array) => map of driver specific substitutes (under development) * - substitutes (array) => map of driver specific substitutes (under development)
* @param mixed connection parameters * @param mixed $config connection parameters
* @param string connection name
* @throws Exception * @throws Exception
*/ */
public function __construct($config, string $name = null) public function __construct($config, string $name = null)
@@ -199,7 +198,7 @@ class Connection
/** /**
* Generates (translates) and executes SQL query. * 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 * @return Result|int result set or number of affected rows
* @throws Exception * @throws Exception
*/ */
@@ -211,7 +210,7 @@ class Connection
/** /**
* Generates SQL query. * Generates SQL query.
* @param mixed one or more arguments * @param mixed $args
* @throws Exception * @throws Exception
*/ */
final public function translate(...$args): string final public function translate(...$args): string
@@ -222,7 +221,7 @@ class Connection
/** /**
* Generates and prints SQL query. * Generates and prints SQL query.
* @param mixed one or more arguments * @param mixed $args
*/ */
final public function test(...$args): bool final public function test(...$args): bool
{ {
@@ -243,7 +242,7 @@ class Connection
/** /**
* Generates (translates) and returns SQL query as DataSource. * Generates (translates) and returns SQL query as DataSource.
* @param mixed one or more arguments * @param mixed $args
* @throws Exception * @throws Exception
*/ */
final public function dataSource(...$args): DataSource final public function dataSource(...$args): DataSource
@@ -481,7 +480,7 @@ class Connection
/** /**
* Executes SQL query and fetch result - shortcut for query() & fetch(). * Executes SQL query and fetch result - shortcut for query() & fetch().
* @param mixed one or more arguments * @param mixed $args
* @throws Exception * @throws Exception
*/ */
public function fetch(...$args): ?Row public function fetch(...$args): ?Row
@@ -492,7 +491,7 @@ class Connection
/** /**
* Executes SQL query and fetch results - shortcut for query() & fetchAll(). * Executes SQL query and fetch results - shortcut for query() & fetchAll().
* @param mixed one or more arguments * @param mixed $args
* @return Row[] * @return Row[]
* @throws Exception * @throws Exception
*/ */
@@ -504,7 +503,7 @@ class Connection
/** /**
* Executes SQL query and fetch first column - shortcut for query() & fetchSingle(). * Executes SQL query and fetch first column - shortcut for query() & fetchSingle().
* @param mixed one or more arguments * @param mixed $args
* @return mixed * @return mixed
* @throws Exception * @throws Exception
*/ */
@@ -516,7 +515,7 @@ class Connection
/** /**
* Executes SQL query and fetch pairs - shortcut for query() & fetchPairs(). * Executes SQL query and fetch pairs - shortcut for query() & fetchPairs().
* @param mixed one or more arguments * @param mixed $args
* @throws Exception * @throws Exception
*/ */
public function fetchPairs(...$args): array public function fetchPairs(...$args): array

View File

@@ -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) public function __construct(string $sql, Connection $connection)
{ {
@@ -64,8 +64,8 @@ class DataSource implements IDataSource
/** /**
* Selects columns to query. * Selects columns to query.
* @param string|array column name or array of column names * @param string|array $col column name or array of column names
* @param string column alias * @param string $as column alias
*/ */
public function select($col, string $as = null): self public function select($col, string $as = null): self
{ {
@@ -97,7 +97,7 @@ class DataSource implements IDataSource
/** /**
* Selects columns to order by. * 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 public function orderBy($row, string $direction = 'ASC'): self
{ {

View File

@@ -18,7 +18,7 @@ class DateTime extends \DateTime
use Strict; use Strict;
/** /**
* @param string|int * @param string|int $time
*/ */
public function __construct($time = 'now', \DateTimeZone $timezone = null) public function __construct($time = 'now', \DateTimeZone $timezone = null)
{ {

View File

@@ -224,7 +224,7 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
/** /**
* Result set driver factory. * Result set driver factory.
* @param resource * @param resource $resource
*/ */
public function createResultDriver($resource): Dibi\ResultDriver 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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -174,7 +174,7 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver
/** /**
* Result set driver factory. * Result set driver factory.
* @param resource * @param resource $resource
*/ */
public function createResultDriver($resource): Dibi\ResultDriver 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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -198,7 +198,7 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
/** /**
* Result set driver factory. * Result set driver factory.
* @param resource * @param resource $resource
*/ */
public function createResultDriver($resource): Dibi\ResultDriver 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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -221,7 +221,7 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
/** /**
* Result set driver factory. * Result set driver factory.
* @param resource * @param resource $resource
*/ */
public function createResultDriver($resource): Dibi\ResultDriver 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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -127,7 +127,6 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
/** /**
* Executes the SQL query. * Executes the SQL query.
* @param string SQL statement.
* @throws Dibi\DriverException * @throws Dibi\DriverException
*/ */
public function query(string $sql): ?Dibi\ResultDriver public function query(string $sql): ?Dibi\ResultDriver
@@ -263,7 +262,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
/** /**
* Result set driver factory. * Result set driver factory.
* @param resource * @param resource $resource
*/ */
public function createResultDriver($resource): Dibi\ResultDriver 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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -195,7 +195,7 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver
/** /**
* Result set driver factory. * Result set driver factory.
* @param resource * @param resource $resource
*/ */
public function createResultDriver($resource): Dibi\ResultDriver 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 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 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. * 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 public function fetch(bool $assoc): ?array
{ {

View File

@@ -268,7 +268,7 @@ class Fluent implements IDataSource
/** /**
* Adds Result setup. * Adds Result setup.
* @param mixed args * @param mixed $method
*/ */
public function setupResult(string $method): self public function setupResult(string $method): self
{ {
@@ -282,7 +282,7 @@ class Fluent implements IDataSource
/** /**
* Generates and executes SQL query. * 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 * @return Result|int result set or number of affected rows
* @throws Exception * @throws Exception
*/ */
@@ -338,7 +338,7 @@ class Fluent implements IDataSource
/** /**
* Fetches all records from table and returns associative tree. * Fetches all records from table and returns associative tree.
* @param string associative descriptor * @param string $assoc associative descriptor
*/ */
public function fetchAssoc(string $assoc): array public function fetchAssoc(string $assoc): array
{ {
@@ -348,7 +348,6 @@ class Fluent implements IDataSource
/** /**
* Fetches all records from table like $key => $value pairs. * Fetches all records from table like $key => $value pairs.
* @param string associative key
*/ */
public function fetchPairs(string $key = null, string $value = null): array 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. * Generates and prints SQL query or it's part.
* @param string clause name
*/ */
public function test(string $clause = null): bool public function test(string $clause = null): bool
{ {
@@ -422,7 +420,6 @@ class Fluent implements IDataSource
/** /**
* Generates parameters for Translator. * Generates parameters for Translator.
* @param string clause name
*/ */
protected function _export(string $clause = null, array $args = []): array protected function _export(string $clause = null, array $args = []): array
{ {

View File

@@ -20,7 +20,7 @@ class Helpers
/** /**
* Prints out a syntax highlighted version of the SQL command or Result. * 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 public static function dump($sql = null, bool $return = false): ?string
{ {

View File

@@ -167,7 +167,7 @@ final class Translator
/** /**
* Apply modifier to single value. * Apply modifier to single value.
* @param mixed * @param mixed $value
*/ */
public function formatValue($value, ?string $modifier): string public function formatValue($value, ?string $modifier): string
{ {

View File

@@ -127,7 +127,7 @@ class dibi
/** /**
* Generates and executes SQL query - Monostate for Dibi\Connection::query(). * 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 * @return Dibi\Result|int result set or number of affected rows
* @throws Dibi\Exception * @throws Dibi\Exception
*/ */
@@ -149,7 +149,7 @@ class dibi
/** /**
* Generates and prints SQL query - Monostate for Dibi\Connection::test(). * 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 public static function test(...$args): bool
{ {
@@ -159,7 +159,7 @@ class dibi
/** /**
* Generates and returns SQL query as DataSource - Monostate for Dibi\Connection::test(). * 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 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(). * Executes SQL query and fetch result - Monostate for Dibi\Connection::query() & fetch().
* @param mixed one or more arguments * @param mixed $args
* @throws Dibi\Exception * @throws Dibi\Exception
*/ */
public static function fetch(...$args): ?Dibi\Row 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(). * Executes SQL query and fetch results - Monostate for Dibi\Connection::query() & fetchAll().
* @param mixed one or more arguments * @param mixed $args
* @return Dibi\Row[] * @return Dibi\Row[]
* @throws Dibi\Exception * @throws Dibi\Exception
*/ */
@@ -192,7 +192,7 @@ class dibi
/** /**
* Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle(). * Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle().
* @param mixed one or more arguments * @param mixed $args
* @return mixed * @return mixed
* @throws Dibi\Exception * @throws Dibi\Exception
*/ */
@@ -204,7 +204,7 @@ class dibi
/** /**
* Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs(). * Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs().
* @param mixed one or more arguments * @param mixed $args
* @throws Dibi\Exception * @throws Dibi\Exception
*/ */
public static function fetchPairs(...$args): array public static function fetchPairs(...$args): array
@@ -354,8 +354,8 @@ class dibi
/** /**
* Prints out a syntax highlighted version of the SQL command or Result. * Prints out a syntax highlighted version of the SQL command or Result.
* @param string|Result * @param string|Result $sql
* @param bool return output instead of printing it? * @param bool $return return output instead of printing it?
*/ */
public static function dump($sql = null, bool $return = false): ?string public static function dump($sql = null, bool $return = false): ?string
{ {

View File

@@ -95,12 +95,12 @@ interface Driver
function escapeBool(bool $value): string; function escapeBool(bool $value): string;
/** /**
* @param \DateTimeInterface|string|int * @param \DateTimeInterface|string|int $value
*/ */
function escapeDate($value): string; function escapeDate($value): string;
/** /**
* @param \DateTimeInterface|string|int * @param \DateTimeInterface|string|int $value
*/ */
function escapeDateTime($value): string; 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. * 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 * @internal
*/ */
function fetch(bool $type): ?array; function fetch(bool $type): ?array;
/** /**
* Frees the resources allocated for this result set. * Frees the resources allocated for this result set.
* @param resource result set resource
*/ */
function free(): void; function free(): void;