r97636: ParserCache meant to be committed already too
[lhc/web/wiklou.git] / includes / parser / StripState.php
index 0bf9e17..c7bd1e7 100644 (file)
@@ -22,15 +22,27 @@ class StripState {
 
        /**
         * Add a nowiki strip item
+        * @param $marker
+        * @param $value
         */
        function addNoWiki( $marker, $value ) {
                $this->addItem( 'nowiki', $marker, $value );
        }
 
+       /**
+        * @param $marker
+        * @param $value
+        */
        function addGeneral( $marker, $value ) {
                $this->addItem( 'general', $marker, $value );
        }
 
+       /**
+        * @throws MWException
+        * @param $type
+        * @param $marker
+        * @param $value
+        */
        protected function addItem( $type, $marker, $value ) {
                if ( !preg_match( $this->regex, $marker, $m ) ) {
                        throw new MWException( "Invalid marker: $marker" );
@@ -39,20 +51,37 @@ class StripState {
                $this->data[$type][$m[1]] = $value;
        }
 
+       /**
+        * @param $text
+        * @return mixed
+        */
        function unstripGeneral( $text ) {
                return $this->unstripType( 'general', $text );
        }
 
+       /**
+        * @param $text
+        * @return mixed
+        */
        function unstripNoWiki( $text ) {
                return $this->unstripType( 'nowiki', $text );
        }
 
+       /**
+        * @param  $text
+        * @return mixed
+        */
        function unstripBoth( $text ) {
                $text = $this->unstripType( 'general', $text );
                $text = $this->unstripType( 'nowiki', $text );
                return $text;
        }
 
+       /**
+        * @param $type
+        * @param $text
+        * @return mixed
+        */
        protected function unstripType( $type, $text ) {
                // Shortcut 
                if ( !count( $this->data[$type] ) ) {
@@ -67,6 +96,10 @@ class StripState {
                return $out;
        }
 
+       /**
+        * @param $m array
+        * @return array
+        */
        protected function unstripCallback( $m ) {
                if ( isset( $this->data[$this->tempType][$m[1]] ) ) {
                        return $this->data[$this->tempType][$m[1]];
@@ -78,6 +111,10 @@ class StripState {
        /**
         * Get a StripState object which is sufficient to unstrip the given text. 
         * It will contain the minimum subset of strip items necessary.
+        *
+        * @param $text string
+        *
+        * @return StripState
         */
        function getSubState( $text ) {
                $subState = new StripState( $this->prefix );