Browse Source

Update PHPStan

mscherer 3 years ago
parent
commit
e76494a668
4 changed files with 2 additions and 88 deletions
  1. 1 1
      .phive/phars.xml
  2. 0 85
      phpstan-baseline.neon
  3. 1 1
      src/Database/Expression/WhenThenExpression.php
  4. 0 1
      src/Utility/Hash.php

+ 1 - 1
.phive/phars.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <phive xmlns="https://phar.io/phive">
-  <phar name="phpstan" version="1.9.12" installed="1.9.12" location="./tools/phpstan" copy="false"/>
+  <phar name="phpstan" version="1.10.2" installed="1.10.2" location="./tools/phpstan" copy="false"/>
   <phar name="psalm" version="4.30.0" installed="4.30.0" location="./tools/psalm" copy="false"/>
 </phive>

+ 0 - 85
phpstan-baseline.neon

@@ -1,11 +1,6 @@
 parameters:
 	ignoreErrors:
 		-
-			message: "#^Strict comparison using \\=\\=\\= between string and false will always evaluate to false\\.$#"
-			count: 1
-			path: src/Auth/DigestAuthenticate.php
-
-		-
 			message: "#^Constructor of class Cake\\\\Auth\\\\Storage\\\\SessionStorage has an unused parameter \\$response\\.$#"
 			count: 1
 			path: src/Auth/Storage/SessionStorage.php
@@ -16,11 +11,6 @@ parameters:
 			path: src/Auth/Storage/StorageInterface.php
 
 		-
-			message: "#^Strict comparison using \\=\\=\\= between class\\-string\\<ArrayObject\\> and 'ArrayIterator' will always evaluate to false\\.$#"
-			count: 1
-			path: src/Collection/Collection.php
-
-		-
 			message: "#^Call to an undefined method Traversable\\:\\:getArrayCopy\\(\\)\\.$#"
 			count: 1
 			path: src/Collection/Iterator/ExtractIterator.php
@@ -41,26 +31,11 @@ parameters:
 			path: src/Collection/Iterator/TreeIterator.php
 
 		-
-			message: "#^Strict comparison using \\=\\=\\= between class\\-string\\<ArrayObject\\> and 'ArrayIterator' will always evaluate to false\\.$#"
-			count: 1
-			path: src/Collection/Iterator/TreeIterator.php
-
-		-
-			message: "#^Strict comparison using \\=\\=\\= between class\\-string\\<ArrayObject\\> and 'ArrayIterator' will always evaluate to false\\.$#"
-			count: 1
-			path: src/Collection/Iterator/TreePrinter.php
-
-		-
 			message: "#^Parameter \\#1 \\$iterator of method MultipleIterator\\:\\:attachIterator\\(\\) expects Iterator, Traversable given\\.$#"
 			count: 1
 			path: src/Collection/Iterator/ZipIterator.php
 
 		-
-			message: "#^Strict comparison using \\=\\=\\= between class\\-string\\<ArrayObject\\> and 'ArrayIterator' will always evaluate to false\\.$#"
-			count: 1
-			path: src/Collection/Iterator/ZipIterator.php
-
-		-
 			message: "#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#"
 			count: 2
 			path: src/Command/I18nExtractCommand.php
@@ -116,51 +91,6 @@ parameters:
 			path: src/Database/Driver.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Database/Driver.php
-
-		-
-			message: "#^If condition is always true\\.$#"
-			count: 1
-			path: src/Database/Driver/Mysql.php
-
-		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Database/Driver/Mysql.php
-
-		-
-			message: "#^If condition is always true\\.$#"
-			count: 1
-			path: src/Database/Driver/Postgres.php
-
-		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Database/Driver/Postgres.php
-
-		-
-			message: "#^If condition is always true\\.$#"
-			count: 1
-			path: src/Database/Driver/Sqlite.php
-
-		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Database/Driver/Sqlite.php
-
-		-
-			message: "#^If condition is always true\\.$#"
-			count: 1
-			path: src/Database/Driver/Sqlserver.php
-
-		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/Database/Driver/Sqlserver.php
-
-		-
 			message: "#^Unsafe usage of new static\\(\\)\\.$#"
 			count: 8
 			path: src/Database/Expression/QueryExpression.php
@@ -221,16 +151,6 @@ parameters:
 			path: src/Http/Client.php
 
 		-
-			message: "#^Parameter \\$ch of method Cake\\\\Http\\\\Client\\\\Adapter\\\\Curl\\:\\:exec\\(\\) has invalid type CurlHandle\\.$#"
-			count: 1
-			path: src/Http/Client/Adapter/Curl.php
-
-		-
-			message: "#^Parameter \\$handle of method Cake\\\\Http\\\\Client\\\\Adapter\\\\Curl\\:\\:createResponse\\(\\) has invalid type CurlHandle\\.$#"
-			count: 1
-			path: src/Http/Client/Adapter/Curl.php
-
-		-
 			message: "#^Constructor of class Cake\\\\Http\\\\Client\\\\Auth\\\\Digest has an unused parameter \\$options\\.$#"
 			count: 1
 			path: src/Http/Client/Auth/Digest.php
@@ -341,11 +261,6 @@ parameters:
 			path: src/ORM/Query.php
 
 		-
-			message: "#^Strict comparison using \\=\\=\\= between class\\-string\\<ArrayObject\\> and 'ArrayIterator' will always evaluate to false\\.$#"
-			count: 1
-			path: src/ORM/ResultSet.php
-
-		-
 			message: "#^Parameter \\#1 \\$rules of method Cake\\\\ORM\\\\Table\\:\\:buildRules\\(\\) expects Cake\\\\ORM\\\\RulesChecker, Cake\\\\Datasource\\\\RulesChecker given\\.$#"
 			count: 1
 			path: src/ORM/Table.php

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

@@ -134,7 +134,7 @@ class WhenThenExpression implements ExpressionInterface
                 'The `$when` argument must be either a non-empty array, a scalar value, an object, ' .
                 'or an instance of `\%s`, `%s` given.',
                 ExpressionInterface::class,
-                is_array($when) ? '[]' : getTypeName($when) // @phpstan-ignore-line
+                is_array($when) ? '[]' : getTypeName($when)
             ));
         }
 

+ 0 - 1
src/Utility/Hash.php

@@ -1119,7 +1119,6 @@ class Hash
             next($intersection);
         }
 
-        /** @phpstan-ignore-next-line */
         return $data + $compare;
     }