MediaWiki  master
RemexMungerData.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki\Tidy;
4 
17 
25 
34  public $wrapBaseNode;
35 
46 
52  public $isPWrapper = false;
53 
61  public $isSplittable = false;
62 
67  public $needsPWrapping = false;
68 
73  public $nonblankNodeCount = 0;
74 
75  public function __set( $name, $value ) {
76  throw new \Exception( "Cannot set property \"$name\"" );
77  }
78 
85  public function dump() {
86  $parts = [];
87 
88  if ( $this->childPElement ) {
89  $parts[] = 'childPElement=' . $this->childPElement->getDebugTag();
90  }
91  if ( $this->ancestorPNode ) {
92  $parts[] = "ancestorPNode=<{$this->ancestorPNode->name}>";
93  }
94  if ( $this->wrapBaseNode ) {
95  $parts[] = "wrapBaseNode=<{$this->wrapBaseNode->name}>";
96  }
97  if ( $this->currentCloneElement ) {
98  $parts[] = "currentCloneElement=" . $this->currentCloneElement->getDebugTag();
99  }
100  if ( $this->isPWrapper ) {
101  $parts[] = 'isPWrapper';
102  }
103  if ( $this->isSplittable ) {
104  $parts[] = 'isSplittable';
105  }
106  if ( $this->needsPWrapping ) {
107  $parts[] = 'needsPWrapping';
108  }
109  if ( $this->nonblankNodeCount ) {
110  $parts[] = "nonblankNodeCount={$this->nonblankNodeCount}";
111  }
112  $s = "RemexMungerData {\n";
113  foreach ( $parts as $part ) {
114  $s .= " $part\n";
115  }
116  $s .= "}\n";
117  return $s;
118  }
119 }
MediaWiki\Tidy\RemexMungerData\$isPWrapper
bool $isPWrapper
Is the node a p-wrapper, with name mw:p-wrap?
Definition: RemexMungerData.php:52
MediaWiki\Tidy\RemexMungerData\dump
dump()
Get a text representation of the current state of the serializer, for debugging.
Definition: RemexMungerData.php:85
MediaWiki\Tidy\RemexMungerData\$currentCloneElement
RemexHtml TreeBuilder Element null $currentCloneElement
Stack splitting (essentially our idea of AFE reconstruction) can clone formatting elements which are ...
Definition: RemexMungerData.php:45
MediaWiki\Tidy\RemexMungerData\__set
__set( $name, $value)
Definition: RemexMungerData.php:75
$s
$s
Definition: mergeMessageFileList.php:185
MediaWiki\Tidy\RemexMungerData\$childPElement
RemexHtml TreeBuilder Element null $childPElement
The Element for the mw:p-wrap which is a child of the current node.
Definition: RemexMungerData.php:16
MediaWiki\Tidy\RemexMungerData\$needsPWrapping
$needsPWrapping
This is true if the node is a body or blockquote, which activates p-wrapping of child nodes.
Definition: RemexMungerData.php:67
MediaWiki\Tidy\RemexMungerData\$wrapBaseNode
RemexHtml Serializer SerializerNode null $wrapBaseNode
The wrap base node is the body or blockquote node which is the parent of active p-wrappers.
Definition: RemexMungerData.php:34
MediaWiki\Tidy\RemexMungerData\$isSplittable
bool $isSplittable
Is the node splittable, i.e.
Definition: RemexMungerData.php:61
MediaWiki\Tidy\RemexMungerData\$nonblankNodeCount
$nonblankNodeCount
The number of child nodes, not counting whitespace-only text nodes or comments.
Definition: RemexMungerData.php:73
MediaWiki\Tidy\RemexMungerData\$ancestorPNode
RemexHtml Serializer SerializerNode null $ancestorPNode
This tracks the mw:p-wrap node in the Serializer stack which is an ancestor of this node.
Definition: RemexMungerData.php:24
MediaWiki\Tidy\RemexMungerData
Definition: RemexMungerData.php:8
MediaWiki\Tidy
Definition: RemexCompatFormatter.php:3