Browse Source

Make usage of foreach to improve readability

Instead of count and comparing, we can simple use a foreach.
Gabriel Caruso 5 years ago
parent
commit
b4fc3b7eef
1 changed files with 4 additions and 4 deletions
  1. 4 4
      tests/Composer/Test/AllFunctionalTest.php

+ 4 - 4
tests/Composer/Test/AllFunctionalTest.php

@@ -162,18 +162,18 @@ class AllFunctionalTest extends TestCase
             }
         };
 
-        for ($i = 0, $c = count($tokens); $i < $c; $i++) {
-            if ('' === $tokens[$i] && null === $section) {
+        foreach ($tokens as $token) {
+            if ('' === $token && null === $section) {
                 continue;
             }
 
             // Handle section headers.
             if (null === $section) {
-                $section = $tokens[$i];
+                $section = $token;
                 continue;
             }
 
-            $sectionData = $tokens[$i];
+            $sectionData = $token;
 
             // Allow sections to validate, or modify their section data.
             switch ($section) {