1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 22:26:43 +02:00

type fixes

This commit is contained in:
David Grudl
2018-04-17 10:38:07 +02:00
parent 4049ea4717
commit 0d5fd9d65b
16 changed files with 29 additions and 29 deletions

View File

@@ -23,7 +23,7 @@ class Panel implements Tracy\IBarPanel
/** @var int maximum SQL length */
public static $maxLength = 1000;
/** @var bool explain queries? */
/** @var bool|string explain queries? */
public $explain;
/** @var int */

View File

@@ -29,7 +29,7 @@ class Connection
/** @var Driver */
private $driver;
/** @var Translator */
/** @var Translator|null */
private $translator;
/** @var bool Is connected? */
@@ -559,7 +559,7 @@ class Connection
/**
* Executes SQL query and fetch results - shortcut for query() & fetchAll().
* @param array|mixed one or more arguments
* @return Row[]
* @return Row[]|array[]
* @throws Exception
*/
public function fetchAll($args)

View File

@@ -21,13 +21,13 @@ class DataSource implements IDataSource
/** @var string */
private $sql;
/** @var Result */
/** @var Result|null */
private $result;
/** @var int */
/** @var int|null */
private $count;
/** @var int */
/** @var int|null */
private $totalCount;
/** @var array */

View File

@@ -256,7 +256,7 @@ class MySqliDriver implements Dibi\Driver, Dibi\ResultDriver
/**
* Returns the connection resource.
* @return \mysqli
* @return \mysqli|null
*/
public function getResource()
{

View File

@@ -27,7 +27,7 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver
{
use Dibi\Strict;
/** @var PDO Connection resource */
/** @var PDO|null Connection resource */
private $connection;
/** @var \PDOStatement|null Resultset resource */
@@ -200,7 +200,7 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver
/**
* Returns the connection resource.
* @return PDO
* @return PDO|null
*/
public function getResource()
{

View File

@@ -214,7 +214,7 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver
/**
* Returns the connection resource.
* @return SQLite3
* @return SQLite3|null
*/
public function getResource()
{

View File

@@ -43,7 +43,7 @@ class Event
/** @var float */
public $time;
/** @var int */
/** @var int|null */
public $count;
/** @var array */
@@ -74,7 +74,7 @@ class Event
}
}
\dibi::$elapsedTime = false;
\dibi::$elapsedTime = null;
\dibi::$numOfQueries++;
\dibi::$sql = $sql;
}

View File

@@ -13,7 +13,7 @@ namespace Dibi;
*
* @method Fluent select(...$field)
* @method Fluent distinct()
* @method Fluent from($table)
* @method Fluent from($table, ...$args)
* @method Fluent where(...$cond)
* @method Fluent groupBy(...$field)
* @method Fluent having(...$cond)
@@ -95,7 +95,7 @@ class Fluent implements IDataSource
/** @var array */
private $flags = [];
/** @var array */
/** @var array|null */
private $cursor;
/** @var HashMap normalized clauses */

View File

@@ -12,7 +12,7 @@ class Helpers
{
use Strict;
/** @var array */
/** @var HashMap */
private static $types;

View File

@@ -29,7 +29,7 @@ class FirePhpLogger
/** @var int */
public $filter;
/** @var int Elapsed time for all queries */
/** @var float Elapsed time for all queries */
public $totalTime = 0;
/** @var int Number of all queries */

View File

@@ -24,7 +24,7 @@ class Database
/** @var Dibi\Reflector */
private $reflector;
/** @var string */
/** @var string|null */
private $name;
/** @var array */
@@ -39,7 +39,7 @@ class Database
/**
* @return string
* @return string|null
*/
public function getName()
{

View File

@@ -42,10 +42,10 @@ class Result implements IDataSource
/** @var bool Already fetched? Used for allowance for first seek(0) */
private $fetched = false;
/** @var string returned object class */
/** @var string|null returned object class */
private $rowClass = 'Dibi\Row';
/** @var callable returned object factory*/
/** @var callable|null returned object factory */
private $rowFactory;
/** @var array format */
@@ -225,7 +225,7 @@ class Result implements IDataSource
* Fetches all records from table.
* @param int offset
* @param int limit
* @return Row[]
* @return Row[]|array[]
*/
final public function fetchAll($offset = null, $limit = null)
{

View File

@@ -31,7 +31,7 @@ class Row implements \ArrayAccess, \IteratorAggregate, \Countable
* Converts value to DateTime object.
* @param string key
* @param string format
* @return \DateTime
* @return DateTime|string|null
*/
public function asDateTime($key, $format = null)
{

View File

@@ -39,10 +39,10 @@ final class Translator
/** @var int */
private $ifLevelStart = 0;
/** @var int */
/** @var int|null */
private $limit;
/** @var int */
/** @var int|null */
private $offset;
/** @var HashMap */

View File

@@ -49,13 +49,13 @@ class dibi
FIELD_DATETIME = Type::DATETIME,
FIELD_TIME = Type::TIME;
/** @var string Last SQL command @see dibi::query() */
/** @var string|null Last SQL command @see dibi::query() */
public static $sql;
/** @var int Elapsed time for last query */
/** @var float|null Elapsed time for last query */
public static $elapsedTime;
/** @var int Elapsed time for all queries */
/** @var float Elapsed time for all queries */
public static $totalTime;
/** @var int Number or queries */
@@ -441,7 +441,7 @@ 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?
* @return string
* @return string|null
*/
public static function dump($sql = null, $return = false)
{

View File

@@ -104,7 +104,7 @@ class ProcedureException extends Exception
* @param int Some code
* @param string SQL command
*/
public function __construct($message = null, $code = 0, $severity = null, $sql = null)
public function __construct($message = '', $code = 0, $severity = '', $sql = null)
{
parent::__construct($message, (int) $code, $sql);
$this->severity = $severity;