Browse Source

Merge pull request #11465 from cakephp/master-phpstan

Fix some higher phpstan issues.
Mark Story 8 years ago
parent
commit
77f60fcb69

+ 2 - 2
src/Database/Connection.php

@@ -459,7 +459,7 @@ class Connection implements ConnectionInterface
 
         $this->_transactionLevel++;
         if ($this->isSavePointsEnabled()) {
-            $this->createSavePoint($this->_transactionLevel);
+            $this->createSavePoint((string)$this->_transactionLevel);
         }
     }
 
@@ -490,7 +490,7 @@ class Connection implements ConnectionInterface
             return $this->_driver->commitTransaction();
         }
         if ($this->isSavePointsEnabled()) {
-            $this->releaseSavePoint($this->_transactionLevel);
+            $this->releaseSavePoint((string)$this->_transactionLevel);
         }
 
         $this->_transactionLevel--;

+ 1 - 1
src/Database/Expression/ValuesExpression.php

@@ -225,7 +225,7 @@ class ValuesExpression implements ExpressionInterface
      * Gets the query object to be used as the values expression to be evaluated
      * to insert records in the table.
      *
-     * @return \Cake\Database\Query
+     * @return \Cake\Database\Query|null
      */
     public function getQuery()
     {

+ 2 - 2
src/Database/Query.php

@@ -104,7 +104,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * The object responsible for generating query placeholders and temporarily store values
      * associated to each of those.
      *
-     * @var \Cake\Database\ValueBinder|null
+     * @var \Cake\Database\ValueBinder|false|null
      */
     protected $_valueBinder;
 
@@ -1870,7 +1870,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * to the statement object.
      *
      * @deprecated 3.5.0 Use getValueBinder() for the getter part instead.
-     * @param \Cake\Database\ValueBinder|null $binder new instance to be set. If no value is passed the
+     * @param \Cake\Database\ValueBinder|false|null $binder new instance to be set. If no value is passed the
      *   default one will be returned
      * @return $this|\Cake\Database\ValueBinder
      */

+ 3 - 3
src/Database/Statement/StatementDecorator.php

@@ -39,14 +39,14 @@ class StatementDecorator implements StatementInterface, Countable, IteratorAggre
      * Statement instance implementation, such as PDOStatement
      * or any other custom implementation.
      *
-     * @var \Cake\Database\StatementInterface|\PDOStatement
+     * @var \Cake\Database\StatementInterface|\PDOStatement|null
      */
     protected $_statement;
 
     /**
      * Reference to the driver object associated to this statement.
      *
-     * @var \Cake\Database\Driver
+     * @var \Cake\Database\Driver|null
      */
     protected $_driver;
 
@@ -246,7 +246,7 @@ class StatementDecorator implements StatementInterface, Countable, IteratorAggre
      * }
      * ```
      *
-     * @return \Iterator
+     * @return \Cake\Database\StatementInterface|\PDOStatement
      */
     public function getIterator()
     {

+ 1 - 1
src/Database/Type.php

@@ -76,7 +76,7 @@ class Type implements TypeInterface
     /**
      * Identifier name for this type
      *
-     * @var string
+     * @var string|null
      */
     protected $_name;
 

+ 1 - 1
src/Database/Type/DateTimeType.php

@@ -105,7 +105,7 @@ class DateTimeType extends Type implements TypeInterface
      *
      * @param string|int|\DateTime $value The value to convert.
      * @param \Cake\Database\Driver $driver The driver instance to convert with.
-     * @return string
+     * @return string|null
      */
     public function toDatabase($value, Driver $driver)
     {

+ 1 - 1
src/Utility/Hash.php

@@ -117,7 +117,7 @@ class Hash
      *
      * @param array|\ArrayAccess $data The data to extract from.
      * @param string $path The path to extract.
-     * @return array An array of the extracted values. Returns an empty array
+     * @return array|\ArrayAccess An array of the extracted values. Returns an empty array
      *   if there are no matches.
      * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::extract
      */