1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-03 20:57:36 +02:00

type improvements

This commit is contained in:
David Grudl
2018-05-01 13:24:22 +02:00
parent 809386edf8
commit f474abfeda
11 changed files with 22 additions and 16 deletions

View File

@@ -36,9 +36,10 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver
/** @var bool */
private $autoFree = true;
/** @var string Date and datetime format */
/** @var string Date format */
private $fmtDate;
/** @var string Datetime format */
private $fmtDateTime;
/** @var string character encoding */

View File

@@ -46,7 +46,7 @@ class Event
/** @var int|null */
public $count;
/** @var array */
/** @var array|null */
public $source;
@@ -80,6 +80,9 @@ class Event
}
/**
* @param Result|DriverException|null
*/
public function done($result = null)
{
$this->result = $result;

View File

@@ -86,7 +86,7 @@ class Fluent implements IDataSource
/** @var array */
private $setups = [];
/** @var string */
/** @var string|null */
private $command;
/** @var array */

View File

@@ -14,6 +14,7 @@ namespace Dibi;
*/
abstract class HashMapBase
{
/** @var callable */
private $callback;
@@ -45,7 +46,7 @@ final class HashMap extends HashMapBase
{
public function __set($nm, $val)
{
if ($nm == '') {
if ($nm === '') {
$nm = "\xFF";
}
$this->$nm = $val;
@@ -54,7 +55,7 @@ final class HashMap extends HashMapBase
public function __get($nm)
{
if ($nm == '') {
if ($nm === '') {
$nm = "\xFF";
return isset($this->$nm) ? $this->$nm : $this->$nm = call_user_func($this->getCallback(), '');
} else {

View File

@@ -27,7 +27,7 @@ class Database
/** @var string|null */
private $name;
/** @var array */
/** @var Table[]|null */
private $tables;

View File

@@ -23,10 +23,10 @@ class Result
/** @var Dibi\ResultDriver */
private $driver;
/** @var array */
/** @var Column[]|null */
private $columns;
/** @var array */
/** @var string[]|null */
private $names;

View File

@@ -34,16 +34,16 @@ class Table
/** @var bool */
private $view;
/** @var array */
/** @var Column[]|null */
private $columns;
/** @var array */
/** @var ForeignKey[]|null */
private $foreignKeys;
/** @var array */
/** @var Index[]|null */
private $indexes;
/** @var Index */
/** @var Index|null */
private $primaryKey;

View File

@@ -31,7 +31,7 @@ class ResultIterator implements \Iterator, \Countable
private $row;
/** @var int */
private $pointer;
private $pointer = 0;
/**

View File

@@ -70,6 +70,7 @@ final class Translator
$args = array_values($args[0]);
}
$this->args = $args;
$this->errors = [];
$commandIns = null;
$lastArr = null;

View File

@@ -85,7 +85,7 @@ class dibi
/**
* Creates a new Connection object and connects it to specified database.
* @param mixed connection parameters
* @param array|string connection parameters
* @param string connection name
* @return Dibi\Connection
* @throws Dibi\Exception

View File

@@ -20,7 +20,7 @@ class Exception extends \Exception
/**
* Construct a dibi exception.
* @param string Message describing the exception
* @param mixed
* @param string|int
* @param string SQL command
* @param \Exception
*/
@@ -117,7 +117,7 @@ class ProcedureException extends Exception
*/
public function getSeverity()
{
$this->severity;
return $this->severity;
}
}