Use foreach for readability
authorReedy <reedy@wikimedia.org>
Sun, 24 Mar 2019 20:14:07 +0000 (20:14 +0000)
committerReedy <reedy@wikimedia.org>
Sun, 24 Mar 2019 20:14:07 +0000 (20:14 +0000)
Change-Id: Ia4701bc50d8c57b9dcafe2da3bb399d59f4c8d0e

tests/phpunit/documentation/ReleaseNotesTest.php

index 019a13e..05742d7 100644 (file)
@@ -49,16 +49,12 @@ class ReleaseNotesTest extends MediaWikiTestCase {
                        "$type file '$fileName' is inaccessible."
                );
 
-               $lines = count( $file );
-
-               for ( $i = 0; $i < $lines; $i++ ) {
-                       $line = $file[$i];
-
+               foreach ( $file as $num => $line ) {
                        $this->assertLessThanOrEqual(
                                // FILE_IGNORE_NEW_LINES drops the \n at the EOL, so max length is 80 not 81.
                                80,
                                mb_strlen( $line ),
-                               "$type file '$fileName' line $i is longer than 80 chars:\n\t'$line'"
+                               "$type file '$fileName' line $num, is longer than 80 chars:\n\t'$line'"
                        );
                }
        }