Browse Source

Remove unneeded error supressing for psalm.

ADmad 7 years ago
parent
commit
8fe9965f92
2 changed files with 3 additions and 11 deletions
  1. 0 9
      psalm.xml
  2. 3 2
      src/Datasource/ResultSetDecorator.php

+ 0 - 9
psalm.xml

@@ -34,7 +34,6 @@
 
         <RedundantCondition>
             <errorLevel type="suppress">
-                <file name="src/I18n/DateFormatTrait.php" />
                 <file name="src/Utility/Hash.php" />
             </errorLevel>
         </RedundantCondition>
@@ -164,7 +163,6 @@
             <errorLevel type="suppress">
                 <file name="src/Cache/Engine/MemcachedEngine.php" />
                 <file name="src/Cache/Engine/RedisEngine.php" />
-                <file name="src/ORM/Behavior/TranslateBehavior.php" />
                 <file name="src/ORM/Behavior/Translate/EavStrategy.php" />
             </errorLevel>
         </UndefinedClass>
@@ -174,7 +172,6 @@
                 <file name="src/Console/Shell.php" />
                 <file name="src/Controller/Component/AuthComponent.php" />
                 <file name="src/Datasource/Paginator.php" />
-                <file name="src/Datasource/ResultSetDecorator.php" />
                 <file name="src/ORM/Association.php" />
                 <file name="src/ORM/Association/BelongsToMany.php" />
             </errorLevel>
@@ -206,11 +203,5 @@
             </errorLevel>
         </InvalidCast>
 
-        <InvalidArrayOffset>
-            <errorLevel type="suppress">
-                <file name="src/Datasource/EntityTrait.php" />
-            </errorLevel>
-        </InvalidArrayOffset>
-
     </issueHandlers>
 </psalm>

+ 3 - 2
src/Datasource/ResultSetDecorator.php

@@ -35,8 +35,9 @@ class ResultSetDecorator extends Collection implements ResultSetInterface
      */
     public function count(): int
     {
-        if ($this->getInnerIterator() instanceof Countable) {
-            return $this->getInnerIterator()->count();
+        $iterator = $this->getInnerIterator();
+        if ($iterator instanceof Countable) {
+            return $iterator->count();
         }
 
         return count($this->toArray());