X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Ftidy%2FBalancer.php;h=947a57248092f486e7bee99b82648d1d85fdcdef;hp=4852ce5211cfe661a7d104b4b6c3b6a3964c3cc9;hb=d455aa29a685971c8191bc38383f1514e7cae806;hpb=9e2133ee040b7c39daae3366b043a9cf62e4bcd6 diff --git a/includes/tidy/Balancer.php b/includes/tidy/Balancer.php index 4852ce5211..947a572480 100644 --- a/includes/tidy/Balancer.php +++ b/includes/tidy/Balancer.php @@ -1203,7 +1203,7 @@ class BalanceStack implements IteratorAggregate { $furthestBlock = null; $furthestBlockIndex = -1; $stackLength = $this->length(); - for ( $i = $index+1; $i < $stackLength; $i++ ) { + for ( $i = $index + 1; $i < $stackLength; $i++ ) { if ( $this->node( $i )->isA( BalanceSets::$specialSet ) ) { $furthestBlock = $this->node( $i ); $furthestBlockIndex = $i; @@ -1225,7 +1225,7 @@ class BalanceStack implements IteratorAggregate { // Let the common ancestor be the element immediately above // the formatting element in the stack of open elements. - $ancestor = $this->node( $index-1 ); + $ancestor = $this->node( $index - 1 ); // Let a bookmark note the position of the formatting // element in the list of active formatting elements @@ -1528,7 +1528,7 @@ class BalanceActiveFormattingElements { /** * Determine whether an element is in the list of formatting elements. * @param BalanceElement $elt - * @return boolean + * @return bool */ public function isInList( BalanceElement $elt ) { return $this->head === $elt || $elt->prevAFE; @@ -2116,7 +2116,7 @@ class Balancer { return $this->insertToken( $token, $value, $attribs, $selfClose ); } // "Any other start tag" - $adjusted = ( $this->fragmentContext && $this->stack->length()===1 ) ? + $adjusted = ( $this->fragmentContext && $this->stack->length() === 1 ) ? $this->fragmentContext : $this->stack->currentNode; $this->stack->insertForeignElement( $adjusted->namespaceURI, $value, $attribs @@ -2242,7 +2242,7 @@ class Balancer { private function switchMode( $mode ) { Assert::parameter( - substr( $mode, -4 )==='Mode', '$mode', 'should end in Mode' + substr( $mode, -4 ) === 'Mode', '$mode', 'should end in Mode' ); $oldMode = $this->parseMode; $this->parseMode = $mode; @@ -2267,8 +2267,8 @@ class Balancer { switch ( $node->localName ) { case 'select': $stackLength = $this->stack->length(); - for ( $j = $i + 1; $j < $stackLength-1; $j++ ) { - $ancestor = $this->stack->node( $stackLength-$j-1 ); + for ( $j = $i + 1; $j < $stackLength - 1; $j++ ) { + $ancestor = $this->stack->node( $stackLength - $j - 1 ); if ( $ancestor->isHtmlNamed( 'template' ) ) { break; }