mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +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:
parent
e022c07370
commit
b4fc3b7eef
1 changed files with 4 additions and 4 deletions
|
@ -162,18 +162,18 @@ class AllFunctionalTest extends TestCase
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for ($i = 0, $c = count($tokens); $i < $c; $i++) {
|
foreach ($tokens as $token) {
|
||||||
if ('' === $tokens[$i] && null === $section) {
|
if ('' === $token && null === $section) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle section headers.
|
// Handle section headers.
|
||||||
if (null === $section) {
|
if (null === $section) {
|
||||||
$section = $tokens[$i];
|
$section = $token;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sectionData = $tokens[$i];
|
$sectionData = $token;
|
||||||
|
|
||||||
// Allow sections to validate, or modify their section data.
|
// Allow sections to validate, or modify their section data.
|
||||||
switch ($section) {
|
switch ($section) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue