Pass phpcs-strict on includes/libs/CSSJanus.php
authorSiebrand Mazeland <siebrand@kitano.nl>
Thu, 24 Apr 2014 19:46:54 +0000 (21:46 +0200)
committerSiebrand Mazeland <siebrand@kitano.nl>
Thu, 24 Apr 2014 19:46:54 +0000 (21:46 +0200)
Change-Id: I184a419a225d5503c5b72909bd69624eba690b0e

RELEASE-NOTES-1.24
includes/AutoLoader.php
includes/libs/CSSJanus.php

index fd422fa..48ea3d4 100644 (file)
@@ -38,6 +38,7 @@ changes to languages because of Bugzilla reports.
 * CLDRPluralRuleConverter_Fragment to CLDRPluralRuleConverterFragment
 * CLDRPluralRuleConverter_Operator to CLDRPluralRuleConverterOperator
 * CLDRPluralRuleEvaluator_Range to CLDRPluralRuleEvaluatorRange
+* CSSJanus_Tokenizer to CSSJanusTokenizer
 
 == Compatibility ==
 
index 5545767..d3aabfe 100644 (file)
@@ -676,7 +676,7 @@ $wgAutoloadLocalClasses = array(
 
        # includes/libs
        'CSSJanus' => 'includes/libs/CSSJanus.php',
-       'CSSJanus_Tokenizer' => 'includes/libs/CSSJanus.php',
+       'CSSJanusTokenizer' => 'includes/libs/CSSJanus.php',
        'CSSMin' => 'includes/libs/CSSMin.php',
        'GenericArrayObject' => 'includes/libs/GenericArrayObject.php',
        'HashRing' => 'includes/libs/HashRing.php',
index 0063a9b..4f0651d 100644 (file)
@@ -93,6 +93,7 @@ class CSSJanus {
                        return;
                }
 
+               // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
                $patterns =& self::$patterns;
                $patterns['escape'] = "(?:{$patterns['unicode']}|\\[^\r\n\f0-9a-f])";
                $patterns['nmstart'] = "(?:[_a-z]|{$patterns['nonAscii']}|{$patterns['escape']})";
@@ -127,6 +128,7 @@ class CSSJanus {
                // callback's job more straightforward
                $patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)(-?{$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
                $patterns['bg_horizontal_percentage_x'] = "/(background-position-x\s*:\s*)(-?{$patterns['num']})(%)/";
+               // @codingStandardsIgnoreEnd
        }
 
        /**
@@ -145,15 +147,15 @@ class CSSJanus {
                self::buildPatterns();
 
                // Tokenize single line rules with /* @noflip */
-               $noFlipSingle = new CSSJanus_Tokenizer( self::$patterns['noflip_single'], '`NOFLIP_SINGLE`' );
+               $noFlipSingle = new CSSJanusTokenizer( self::$patterns['noflip_single'], '`NOFLIP_SINGLE`' );
                $css = $noFlipSingle->tokenize( $css );
 
                // Tokenize class rules with /* @noflip */
-               $noFlipClass = new CSSJanus_Tokenizer( self::$patterns['noflip_class'], '`NOFLIP_CLASS`' );
+               $noFlipClass = new CSSJanusTokenizer( self::$patterns['noflip_class'], '`NOFLIP_CLASS`' );
                $css = $noFlipClass->tokenize( $css );
 
                // Tokenize comments
-               $comments = new CSSJanus_Tokenizer( self::$patterns['comment'], '`C`' );
+               $comments = new CSSJanusTokenizer( self::$patterns['comment'], '`C`' );
                $css = $comments->tokenize( $css );
 
                // LTR->RTL fixes start here
@@ -308,17 +310,28 @@ class CSSJanus {
                        }
                };
 
-               $css = preg_replace_callback( self::$patterns['box_shadow'], function ( $matches ) use ( $flipSign ) {
-                       return $matches[1] . $flipSign( $matches[2] );
-               }, $css );
-
-               $css = preg_replace_callback( self::$patterns['text_shadow1'], function ( $matches ) use ( $flipSign ) {
-                       return $matches[1] . $matches[2] . $matches[3] . $flipSign( $matches[4] );
-               }, $css );
-
-               $css = preg_replace_callback( self::$patterns['text_shadow2'], function ( $matches ) use ( $flipSign ) {
-                       return $matches[1] . $flipSign( $matches[2] );
-               }, $css );
+               $css = preg_replace_callback(
+                       self::$patterns['box_shadow'], function ( $matches ) use ( $flipSign ) {
+                               return $matches[1] . $flipSign( $matches[2] );
+                       },
+                       $css
+               );
+
+               $css = preg_replace_callback(
+                       self::$patterns['text_shadow1'],
+                       function ( $matches ) use ( $flipSign ) {
+                               return $matches[1] . $matches[2] . $matches[3] . $flipSign( $matches[4] );
+                       },
+                       $css
+               );
+
+               $css = preg_replace_callback(
+                       self::$patterns['text_shadow2'],
+                       function ( $matches ) use ( $flipSign ) {
+                               return $matches[1] . $flipSign( $matches[2] );
+                       },
+                       $css
+               );
 
                return $css;
        }
@@ -359,7 +372,7 @@ class CSSJanus {
  * to protect from being janused.
  * @author Roan Kattouw
  */
-class CSSJanus_Tokenizer {
+class CSSJanusTokenizer {
        private $regex, $token;
        private $originals;