diff --git a/src/Dibi/Drivers/Sqlite3Driver.php b/src/Dibi/Drivers/Sqlite3Driver.php index 3ca94df9..7860a8ff 100644 --- a/src/Dibi/Drivers/Sqlite3Driver.php +++ b/src/Dibi/Drivers/Sqlite3Driver.php @@ -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 */ diff --git a/src/Dibi/Event.php b/src/Dibi/Event.php index ae5dfa7d..57ff78fc 100644 --- a/src/Dibi/Event.php +++ b/src/Dibi/Event.php @@ -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; diff --git a/src/Dibi/Fluent.php b/src/Dibi/Fluent.php index 7b5bb0c9..5533f3cf 100644 --- a/src/Dibi/Fluent.php +++ b/src/Dibi/Fluent.php @@ -86,7 +86,7 @@ class Fluent implements IDataSource /** @var array */ private $setups = []; - /** @var string */ + /** @var string|null */ private $command; /** @var array */ diff --git a/src/Dibi/HashMap.php b/src/Dibi/HashMap.php index e9ea34ba..06406878 100644 --- a/src/Dibi/HashMap.php +++ b/src/Dibi/HashMap.php @@ -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 { diff --git a/src/Dibi/Reflection/Database.php b/src/Dibi/Reflection/Database.php index c34bee73..5897c60d 100644 --- a/src/Dibi/Reflection/Database.php +++ b/src/Dibi/Reflection/Database.php @@ -27,7 +27,7 @@ class Database /** @var string|null */ private $name; - /** @var array */ + /** @var Table[]|null */ private $tables; diff --git a/src/Dibi/Reflection/Result.php b/src/Dibi/Reflection/Result.php index c7499056..96c40026 100644 --- a/src/Dibi/Reflection/Result.php +++ b/src/Dibi/Reflection/Result.php @@ -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; diff --git a/src/Dibi/Reflection/Table.php b/src/Dibi/Reflection/Table.php index bee91246..d71cac64 100644 --- a/src/Dibi/Reflection/Table.php +++ b/src/Dibi/Reflection/Table.php @@ -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; diff --git a/src/Dibi/ResultIterator.php b/src/Dibi/ResultIterator.php index b2a3aa1c..b137bc8f 100644 --- a/src/Dibi/ResultIterator.php +++ b/src/Dibi/ResultIterator.php @@ -31,7 +31,7 @@ class ResultIterator implements \Iterator, \Countable private $row; /** @var int */ - private $pointer; + private $pointer = 0; /** diff --git a/src/Dibi/Translator.php b/src/Dibi/Translator.php index 1b337e44..fe4ec3e3 100644 --- a/src/Dibi/Translator.php +++ b/src/Dibi/Translator.php @@ -70,6 +70,7 @@ final class Translator $args = array_values($args[0]); } $this->args = $args; + $this->errors = []; $commandIns = null; $lastArr = null; diff --git a/src/Dibi/dibi.php b/src/Dibi/dibi.php index 9792cb9d..6bba9c29 100644 --- a/src/Dibi/dibi.php +++ b/src/Dibi/dibi.php @@ -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 diff --git a/src/Dibi/exceptions.php b/src/Dibi/exceptions.php index 0d8c490b..ec8fdcbd 100644 --- a/src/Dibi/exceptions.php +++ b/src/Dibi/exceptions.php @@ -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; } }