1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Make usage of foreach to improve readability

Instead of count and comparing, we can simple use a foreach.
This commit is contained in:
Gabriel Caruso 2019-07-24 02:39:40 +02:00
parent e022c07370
commit b4fc3b7eef
No known key found for this signature in database
GPG key ID: 4B385A6EE6C9678D

View file

@ -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) {