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']})";
// 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
}
/**
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
}
};
- $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;
}
* to protect from being janused.
* @author Roan Kattouw
*/
-class CSSJanus_Tokenizer {
+class CSSJanusTokenizer {
private $regex, $token;
private $originals;