Add access modifiers to MagicWord.php
[lhc/web/wiklou.git] / includes / parser / Preprocessor.php
index 30eab19..368d79e 100644 (file)
@@ -30,6 +30,27 @@ abstract class Preprocessor {
 
        const CACHE_VERSION = 1;
 
+       /**
+        * @var array Brace matching rules.
+        */
+       protected $rules = [
+               '{' => [
+                       'end' => '}',
+                       'names' => [
+                               2 => 'template',
+                               3 => 'tplarg',
+                       ],
+                       'min' => 2,
+                       'max' => 3,
+               ],
+               '[' => [
+                       'end' => ']',
+                       'names' => [ 2 => null ],
+                       'min' => 2,
+                       'max' => 2,
+               ]
+       ];
+
        /**
         * Store a document tree in the cache.
         *
@@ -46,9 +67,9 @@ abstract class Preprocessor {
                }
 
                $key = wfMemcKey(
-                       defined( 'self::CACHE_PREFIX' ) ? self::CACHE_PREFIX : __CLASS__,
+                       defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : static::class,
                        md5( $text ), $flags );
-               $value = sprintf( "%08d", self::CACHE_VERSION ) . $tree;
+               $value = sprintf( "%08d", static::CACHE_VERSION ) . $tree;
 
                $cache = ObjectCache::getInstance( $config->get( 'MainCacheType' ) );
                $cache->set( $key, $value, 86400 );
@@ -77,7 +98,7 @@ abstract class Preprocessor {
                $cache = ObjectCache::getInstance( $config->get( 'MainCacheType' ) );
 
                $key = wfMemcKey(
-                       defined( 'self::CACHE_PREFIX' ) ? self::CACHE_PREFIX : __CLASS__,
+                       defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : static::class,
                        md5( $text ), $flags );
 
                $value = $cache->get( $key );
@@ -86,7 +107,7 @@ abstract class Preprocessor {
                }
 
                $version = intval( substr( $value, 0, 8 ) );
-               if ( $version !== self::CACHE_VERSION ) {
+               if ( $version !== static::CACHE_VERSION ) {
                        return false;
                }