Browse Source

Add method annotations to avoid ignoring errors.

ADmad 8 years ago
parent
commit
de86794a03
3 changed files with 5 additions and 2 deletions
  1. 0 1
      phpstan.neon
  2. 3 1
      src/Database/Driver.php
  3. 2 0
      src/Datasource/ConnectionInterface.php

+ 0 - 1
phpstan.neon

@@ -10,7 +10,6 @@ parameters:
         - '#Access to undefined constant Memcached::DYNAMIC_CLIENT_MODE#'
         - '#Access to undefined constant PDO::SQLSRV_ATTR_ENCODING#'
         - '#Access to undefined constant PDO::SQLSRV_ENCODING_BINARY#'
-        - '#Access to an undefined property Cake\\Database\\Driver::\$_connection#'
         - '#Constant XC_TYPE_VAR not found#'
         - '#Class PHPUnit_Runner_Version not found and could not be autoloaded#'
         - '#Call to an undefined method Cake\\Auth\\Storage\\StorageInterface::getConfig\(\)#'

+ 3 - 1
src/Database/Driver.php

@@ -19,7 +19,9 @@ use PDO;
 
 /**
  * Represents a database driver containing all specificities for
- * a database engine including its SQL dialect
+ * a database engine including its SQL dialect.
+ *
+ * @property \Cake\Datasource\ConnectionInterface $_connection
  */
 abstract class Driver
 {

+ 2 - 0
src/Datasource/ConnectionInterface.php

@@ -25,6 +25,8 @@ namespace Cake\Datasource;
  * @method \Cake\Database\Query newQuery()
  * @method \Cake\Database\StatementInterface prepare($sql)
  * @method \Cake\Database\StatementInterface execute($query, $params = [], array $types = [])
+ * @method string quote($value, $type = null)
+ * @method string|int lastInsertId($table = null, $column = null)
  */
 interface ConnectionInterface
 {