From: Reedy Date: Sun, 24 Mar 2019 20:14:07 +0000 (+0000) Subject: Use foreach for readability X-Git-Tag: 1.34.0-rc.0~2388^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=31c94f52276d31a91700015eca2d5c03156a3005 Use foreach for readability Change-Id: Ia4701bc50d8c57b9dcafe2da3bb399d59f4c8d0e --- diff --git a/tests/phpunit/documentation/ReleaseNotesTest.php b/tests/phpunit/documentation/ReleaseNotesTest.php index 019a13e4ca..05742d73ac 100644 --- a/tests/phpunit/documentation/ReleaseNotesTest.php +++ b/tests/phpunit/documentation/ReleaseNotesTest.php @@ -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'" ); } }