Browse Source

Merge pull request #14472 from cakephp/phpstan

Fix error reported by phpstan
Mark Sch 6 years ago
parent
commit
c15f13821f
2 changed files with 3 additions and 28 deletions
  1. 0 25
      phpstan-baseline.neon
  2. 3 3
      src/Cache/Engine/ApcuEngine.php

+ 0 - 25
phpstan-baseline.neon

@@ -361,11 +361,6 @@ parameters:
 			path: src/I18n/Date.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/I18n/Date.php
-
-		-
 			message: "#^Result of \\|\\| is always true\\.$#"
 			count: 1
 			path: src/I18n/FrozenDate.php
@@ -376,11 +371,6 @@ parameters:
 			path: src/I18n/FrozenDate.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/I18n/FrozenDate.php
-
-		-
 			message: "#^Call to an undefined method Cake\\\\Chronos\\\\DifferenceFormatterInterface\\:\\:dateAgoInWords\\(\\)\\.$#"
 			count: 1
 			path: src/I18n/FrozenDate.php
@@ -396,11 +386,6 @@ parameters:
 			path: src/I18n/FrozenTime.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/I18n/FrozenTime.php
-
-		-
 			message: "#^Call to an undefined method Cake\\\\Chronos\\\\DifferenceFormatterInterface\\:\\:timeAgoInWords\\(\\)\\.$#"
 			count: 1
 			path: src/I18n/FrozenTime.php
@@ -416,11 +401,6 @@ parameters:
 			path: src/I18n/Time.php
 
 		-
-			message: "#^Unreachable statement \\- code above always terminates\\.$#"
-			count: 1
-			path: src/I18n/Time.php
-
-		-
 			message: "#^Call to an undefined method Cake\\\\Chronos\\\\DifferenceFormatterInterface\\:\\:timeAgoInWords\\(\\)\\.$#"
 			count: 1
 			path: src/I18n/Time.php
@@ -630,8 +610,3 @@ parameters:
 			count: 1
 			path: src/View/View.php
 
-		-
-			message: "#^Class Psy\\\\Shell not found\\.$#"
-			count: 1
-			path: src/basics.php
-

+ 3 - 3
src/Cache/Engine/ApcuEngine.php

@@ -16,7 +16,7 @@ declare(strict_types=1);
  */
 namespace Cake\Cache\Engine;
 
-use APCuIterator;
+use APCUIterator;
 use Cake\Cache\CacheEngine;
 
 /**
@@ -140,8 +140,8 @@ class ApcuEngine extends CacheEngine
      */
     public function clear(): bool
     {
-        if (class_exists(APCuIterator::class, false)) {
-            $iterator = new APCuIterator(
+        if (class_exists(APCUIterator::class, false)) {
+            $iterator = new APCUIterator(
                 '/^' . preg_quote($this->_config['prefix'], '/') . '/',
                 APC_ITER_NONE
             );