aboutsummaryrefslogtreecommitdiffstats
path: root/includes/parser/DateFormatter.php
diff options
context:
space:
mode:
authorSiebrand Mazeland <siebrand@kitano.nl>2014-05-11 01:03:45 +0200
committerParent5446 <tylerromeo@gmail.com>2014-05-11 08:44:52 +0000
commit2527cca6de0be7c146369288b373008ad69cc3de (patch)
tree69dbb80f02295d3c5e40f1ca99aade965f87e33b /includes/parser/DateFormatter.php
parentf359cdf61462782743a87943938ef4cce78b2647 (diff)
downloadmediawikicore-2527cca6de0be7c146369288b373008ad69cc3de.tar.gz
mediawikicore-2527cca6de0be7c146369288b373008ad69cc3de.zip
Fix most CodeSniffer issues in includes/parser/
Remaining are the classes containing underscores and possibly a few other issues that will be addressed soonish. Change-Id: Icf56374c71afc134420ebbcfecf12dcb29dc9564
Diffstat (limited to 'includes/parser/DateFormatter.php')
-rw-r--r--includes/parser/DateFormatter.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php
index a6092a3fe3f4..54c6dece6881 100644
--- a/includes/parser/DateFormatter.php
+++ b/includes/parser/DateFormatter.php
@@ -234,7 +234,8 @@ class DateFormatter {
$bits = array();
$key = $this->keys[$this->mSource];
- for ( $p = 0; $p < strlen( $key ); $p++ ) {
+ $keyLength = strlen( $key );
+ for ( $p = 0; $p < $keyLength; $p++ ) {
if ( $key[$p] != ' ' ) {
$bits[$key[$p]] = $matches[$p + 1];
}
@@ -283,7 +284,8 @@ class DateFormatter {
$bits['d'] = sprintf( '%02d', $bits['j'] );
}
- for ( $p = 0; $p < strlen( $format ); $p++ ) {
+ $formatLength = strlen( $format );
+ for ( $p = 0; $p < $formatLength; $p++ ) {
$char = $format[$p];
switch ( $char ) {
case 'd': # ISO day of month