소스 검색

Merge pull request #8239 from carusogabriel/improve-redability-foreach

Make usage of foreach to improve readability
Jordi Boggiano 5 년 전
부모
커밋
555fa5bae2
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  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) {