Browse Source

Merge pull request #14403 from cakephp/phpstan

Fix errors reported by phpstan
Mark Sch 6 years ago
parent
commit
0741b97cf0
3 changed files with 1 additions and 13 deletions
  1. 0 10
      phpstan-baseline.neon
  2. 0 2
      src/Cache/CacheEngine.php
  3. 1 1
      src/Database/Expression/QueryExpression.php

+ 0 - 10
phpstan-baseline.neon

@@ -21,11 +21,6 @@ parameters:
 			path: src/Auth/Storage/SessionStorage.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Cache/CacheEngine.php
-
-		-
 			message: "#^Access to undefined constant Memcached\\:\\:OPT_CLIENT_MODE\\.$#"
 			count: 1
 			path: src/Cache/Engine/MemcachedEngine.php
@@ -266,11 +261,6 @@ parameters:
 			path: src/Database/Expression/QueryExpression.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Database/Expression/QueryExpression.php
-
-		-
 			message: "#^Access to an undefined property Exception\\:\\:\\$queryString\\.$#"
 			count: 1
 			path: src/Database/Log/LoggingStatement.php

+ 0 - 2
src/Cache/CacheEngine.php

@@ -178,8 +178,6 @@ abstract class CacheEngine implements CacheInterface, CacheEngineInterface
                 $this->setConfig('duration', $restore);
             }
         }
-
-        return false;
     }
 
     /**

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

@@ -788,7 +788,7 @@ class QueryExpression implements ExpressionInterface, Countable
     /**
      * Returns the type name for the passed field if it was stored in the typeMap
      *
-     * @param string|\Cake\Database\Expression\IdentifierExpression $field The field name to get a type for.
+     * @param string|\Cake\Database\ExpressionInterface $field The field name to get a type for.
      * @return string|null The computed type or null, if the type is unknown.
      */
     protected function _calculateType($field): ?string