Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / tidy / RemexMungerData.php
index d614a38..c0dd00b 100644 (file)
@@ -75,4 +75,45 @@ class RemexMungerData {
        public function __set( $name, $value ) {
                throw new \Exception( "Cannot set property \"$name\"" );
        }
+
+       /**
+        * Get a text representation of the current state of the serializer, for
+        * debugging.
+        *
+        * @return string
+        */
+       public function dump() {
+               $parts = [];
+
+               if ( $this->childPElement ) {
+                       $parts[] = 'childPElement=' . $this->childPElement->getDebugTag();
+               }
+               if ( $this->ancestorPNode ) {
+                       $parts[] = "ancestorPNode=<{$this->ancestorPNode->name}>";
+               }
+               if ( $this->wrapBaseNode ) {
+                       $parts[] = "wrapBaseNode=<{$this->wrapBaseNode->name}>";
+               }
+               if ( $this->currentCloneElement ) {
+                       $parts[] = "currentCloneElement=" . $this->currentCloneElement->getDebugTag();
+               }
+               if ( $this->isPWrapper ) {
+                       $parts[] = 'isPWrapper';
+               }
+               if ( $this->isSplittable ) {
+                       $parts[] = 'isSplittable';
+               }
+               if ( $this->needsPWrapping ) {
+                       $parts[] = 'needsPWrapping';
+               }
+               if ( $this->nonblankNodeCount ) {
+                       $parts[] = "nonblankNodeCount={$this->nonblankNodeCount}";
+               }
+               $s = "RemexMungerData {\n";
+               foreach ( $parts as $part ) {
+                       $s .= "  $part\n";
+               }
+               $s .= "}\n";
+               return $s;
+       }
 }