[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Balancer: Add a bunch of phpdoc and 2 fixmes

2016-10-12 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Balancer: Add a bunch of phpdoc and 2 fixmes
..


Balancer: Add a bunch of phpdoc and 2 fixmes

Change-Id: I0596c73cc87ec609d75aa4d8b241c2377bc4f9b1
---
M includes/tidy/Balancer.php
1 file changed, 27 insertions(+), 4 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/tidy/Balancer.php b/includes/tidy/Balancer.php
index 069b460..aef73c7 100644
--- a/includes/tidy/Balancer.php
+++ b/includes/tidy/Balancer.php
@@ -328,7 +328,7 @@
/**
 * Parent of this element, or the string "flat" if this element has
 * already been flattened into its parent.
-* @var string|null $parent
+* @var BalanceElement|string|null $parent
 */
public $parent;
 
@@ -337,7 +337,7 @@
 * child will be an actual BalanceElement object; the rest will
 * be strings, representing either text nodes or flattened
 * BalanceElement objects.
-* @var array $children
+* @var BalanceElement[]|string[] $children
 */
public $children;
 
@@ -465,6 +465,7 @@
 * in its parent by that string.
 *
 * @param array $config Balancer configuration; see 
Balancer::__construct().
+* @return string
 *
 * @see __toString()
 */
@@ -653,7 +654,7 @@
 class BalanceStack implements IteratorAggregate {
/**
 * Backing storage for the stack.
-* @var array $elements
+* @var BalanceElement[] $elements
 */
private $elements = [];
/**
@@ -717,6 +718,7 @@
/**
 * Insert text at the appropriate place for inserting a node.
 * @param string $value
+* @param bool $isComment
 * @see 
https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
 */
public function insertText( $value, $isComment = false ) {
@@ -906,7 +908,7 @@
/**
 * Return an iterator over this stack which visits the current node
 * first, and the root node last.
-* @return Iterator
+* @return \Iterator
 */
public function getIterator() {
return new ReverseArrayIterator( $this->elements );
@@ -1080,6 +1082,8 @@
/**
 * Foster parent the given $elt in the stack of open elements.
 * @param BalanceElement|string $elt
+* @return BalanceElement|string
+*
 * @see https://html.spec.whatwg.org/multipage/syntax.html#foster-parent
 */
private function fosterParent( $elt ) {
@@ -1520,6 +1524,7 @@
 
/**
 * Determine whether an element is in the list of formatting elements.
+* @param BalanceElement $elt
 * @return boolean
 */
public function isInList( BalanceElement $elt ) {
@@ -1529,6 +1534,8 @@
/**
 * Find the element $elt in the list and remove it.
 * Used when parsing a in body mode.
+*
+* @param BalanceElement $elt
 */
public function remove( BalanceElement $elt ) {
if ( $this->head !== $elt && !$elt->prevAFE ) {
@@ -1597,6 +1604,9 @@
 
/**
 * Find element $a in the list and replace it with element $b
+*
+* @param BalanceElement $a
+* @param BalanceElement $b
 */
public function replace( BalanceElement $a, BalanceElement $b ) {
if ( $this->head !== $a && !$a->prevAFE ) {
@@ -1628,6 +1638,9 @@
 
/**
 * Find $a in the list and insert $b after it.
+
+* @param BalanceElement $a
+* @param BalanceElement $b
 */
public function insertAfter( BalanceElement $a, BalanceElement $b ) {
if ( $this->head !== $a && !$a->prevAFE ) {
@@ -1778,9 +1791,12 @@
  */
 class Balancer {
private $parseMode;
+   /** @var \Iterator */
private $bitsIterator;
private $allowedHtmlElements;
+   /** @var BalanceActiveFormattingElements */
private $afe;
+   /** @var BalanceStack */
private $stack;
private $strict;
private $allowComments;
@@ -1794,6 +1810,11 @@
private $ignoreLinefeed;
private $inRCDATA;
private $inRAWTEXT;
+
+   /** @var callable|null */
+   private $processingCallback;
+   /** @var array */
+   private $processingArgs;
 
/**
 * Valid HTML5 comments.
@@ -2582,6 +2603,7 @@
case 'tt':
case 'u':
$this->afe->reconstruct( $this->stack );
+   // FIXME: only takes one parameter
$this->afe->push( 
$this->stack->insertHTMLElement( $value, $attribs ), $attribs );
return true;
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Balancer: Add a bunch of phpdoc and 2 fixmes

2016-10-11 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315321

Change subject: Balancer: Add a bunch of phpdoc and 2 fixmes
..

Balancer: Add a bunch of phpdoc and 2 fixmes

Change-Id: I0596c73cc87ec609d75aa4d8b241c2377bc4f9b1
---
M includes/tidy/Balancer.php
1 file changed, 27 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/315321/1

diff --git a/includes/tidy/Balancer.php b/includes/tidy/Balancer.php
index 069b460..aef73c7 100644
--- a/includes/tidy/Balancer.php
+++ b/includes/tidy/Balancer.php
@@ -328,7 +328,7 @@
/**
 * Parent of this element, or the string "flat" if this element has
 * already been flattened into its parent.
-* @var string|null $parent
+* @var BalanceElement|string|null $parent
 */
public $parent;
 
@@ -337,7 +337,7 @@
 * child will be an actual BalanceElement object; the rest will
 * be strings, representing either text nodes or flattened
 * BalanceElement objects.
-* @var array $children
+* @var BalanceElement[]|string[] $children
 */
public $children;
 
@@ -465,6 +465,7 @@
 * in its parent by that string.
 *
 * @param array $config Balancer configuration; see 
Balancer::__construct().
+* @return string
 *
 * @see __toString()
 */
@@ -653,7 +654,7 @@
 class BalanceStack implements IteratorAggregate {
/**
 * Backing storage for the stack.
-* @var array $elements
+* @var BalanceElement[] $elements
 */
private $elements = [];
/**
@@ -717,6 +718,7 @@
/**
 * Insert text at the appropriate place for inserting a node.
 * @param string $value
+* @param bool $isComment
 * @see 
https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
 */
public function insertText( $value, $isComment = false ) {
@@ -906,7 +908,7 @@
/**
 * Return an iterator over this stack which visits the current node
 * first, and the root node last.
-* @return Iterator
+* @return \Iterator
 */
public function getIterator() {
return new ReverseArrayIterator( $this->elements );
@@ -1080,6 +1082,8 @@
/**
 * Foster parent the given $elt in the stack of open elements.
 * @param BalanceElement|string $elt
+* @return BalanceElement|string
+*
 * @see https://html.spec.whatwg.org/multipage/syntax.html#foster-parent
 */
private function fosterParent( $elt ) {
@@ -1520,6 +1524,7 @@
 
/**
 * Determine whether an element is in the list of formatting elements.
+* @param BalanceElement $elt
 * @return boolean
 */
public function isInList( BalanceElement $elt ) {
@@ -1529,6 +1534,8 @@
/**
 * Find the element $elt in the list and remove it.
 * Used when parsing a in body mode.
+*
+* @param BalanceElement $elt
 */
public function remove( BalanceElement $elt ) {
if ( $this->head !== $elt && !$elt->prevAFE ) {
@@ -1597,6 +1604,9 @@
 
/**
 * Find element $a in the list and replace it with element $b
+*
+* @param BalanceElement $a
+* @param BalanceElement $b
 */
public function replace( BalanceElement $a, BalanceElement $b ) {
if ( $this->head !== $a && !$a->prevAFE ) {
@@ -1628,6 +1638,9 @@
 
/**
 * Find $a in the list and insert $b after it.
+
+* @param BalanceElement $a
+* @param BalanceElement $b
 */
public function insertAfter( BalanceElement $a, BalanceElement $b ) {
if ( $this->head !== $a && !$a->prevAFE ) {
@@ -1778,9 +1791,12 @@
  */
 class Balancer {
private $parseMode;
+   /** @var \Iterator */
private $bitsIterator;
private $allowedHtmlElements;
+   /** @var BalanceActiveFormattingElements */
private $afe;
+   /** @var BalanceStack */
private $stack;
private $strict;
private $allowComments;
@@ -1794,6 +1810,11 @@
private $ignoreLinefeed;
private $inRCDATA;
private $inRAWTEXT;
+
+   /** @var callable|null */
+   private $processingCallback;
+   /** @var array */
+   private $processingArgs;
 
/**
 * Valid HTML5 comments.
@@ -2582,6 +2603,7 @@
case 'tt':
case 'u':
$this->afe->reconstruct( $this->stack );
+   // FIXME: only takes one parameter
$this->afe->push( 
$this->stack->insertHTMLElement( $value, $attribs ), $attribs );