@@ -485,7 +485,7 @@  | 
                                                    ||
| 485 | 485 | */  | 
                                                        
| 486 | 486 | public static function isA($name, $mask)  | 
                                                        
| 487 | 487 |      { | 
                                                        
| 488 | -        if (! static::isElement($name)) { | 
                                                        |
| 488 | +        if (!static::isElement($name)) { | 
                                                        |
| 489 | 489 | return false;  | 
                                                        
| 490 | 490 | }  | 
                                                        
| 491 | 491 | |
@@ -47,7 +47,7 @@  | 
                                                    ||
| 47 | 47 | */  | 
                                                        
| 48 | 48 | public static function lookupDecimal($int)  | 
                                                        
| 49 | 49 |      { | 
                                                        
| 50 | - $entity = '&#' . $int . ';';  | 
                                                        |
| 50 | + $entity = '&#'.$int.';';  | 
                                                        |
| 51 | 51 | // UNTESTED: This may fail on some planes. Couldn't find full documentation  | 
                                                        
| 52 | 52 | // on the value of the mask array.  | 
                                                        
| 53 | 53 | return mb_decode_numericentity($entity, static::$numeric_mask, 'utf-8');  | 
                                                        
@@ -188,7 +188,7 @@  | 
                                                    ||
| 188 | 188 | */  | 
                                                        
| 189 | 189 | public function next()  | 
                                                        
| 190 | 190 |      { | 
                                                        
| 191 | - $this->char ++;  | 
                                                        |
| 191 | + $this->char++;  | 
                                                        |
| 192 | 192 | }  | 
                                                        
| 193 | 193 | |
| 194 | 194 | /**  | 
                                                        
@@ -144,7 +144,7 @@ discard block  | 
                                                    ||
| 144 | 144 | /*  | 
                                                        
| 145 | 145 | * All U+0000 null characters in the input must be replaced by U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such characters is a parse error.  | 
                                                        
| 146 | 146 | */  | 
                                                        
| 147 | -        for ($i = 0, $count = substr_count($data, "\0"); $i < $count; $i ++) { | 
                                                        |
| 147 | +        for ($i = 0, $count = substr_count($data, "\0"); $i < $count; $i++) { | 
                                                        |
| 148 | 148 | $errors[] = 'null-character';  | 
                                                        
| 149 | 149 | }  | 
                                                        
| 150 | 150 | |
@@ -166,7 +166,7 @@ discard block  | 
                                                    ||
| 166 | 166 | |  | 
                                                        
| 167 | 167 |          [\xF0-\xF4][\x8F-\xBF]\xBF[\xBE\xBF] # U+nFFFE and U+nFFFF (1 <= n <= 10_{16}) | 
                                                        
| 168 | 168 | )/x', $data, $matches);  | 
                                                        
| 169 | -        for ($i = 0; $i < $count; $i ++) { | 
                                                        |
| 169 | +        for ($i = 0; $i < $count; $i++) { | 
                                                        |
| 170 | 170 | $errors[] = 'invalid-codepoint';  | 
                                                        
| 171 | 171 | }  | 
                                                        
| 172 | 172 | |
@@ -344,8 +344,8 @@ discard block  | 
                                                    ||
| 344 | 344 | }  | 
                                                        
| 345 | 345 | |
| 346 | 346 |          if ($this->onlyInline && Elements::isA($lname, Elements::BLOCK_TAG)) { | 
                                                        
| 347 | - $this->autoclose($this->onlyInline);  | 
                                                        |
| 348 | - $this->onlyInline = null;  | 
                                                        |
| 347 | + $this->autoclose($this->onlyInline);  | 
                                                        |
| 348 | + $this->onlyInline = null;  | 
                                                        |
| 349 | 349 | }  | 
                                                        
| 350 | 350 | |
| 351 | 351 |          try { | 
                                                        
@@ -375,7 +375,7 @@ discard block  | 
                                                    ||
| 375 | 375 | }  | 
                                                        
| 376 | 376 | |
| 377 | 377 |          if (Elements::isA($lname, Elements::BLOCK_ONLY_INLINE)) { | 
                                                        
| 378 | - $this->onlyInline = $lname;  | 
                                                        |
| 378 | + $this->onlyInline = $lname;  | 
                                                        |
| 379 | 379 | }  | 
                                                        
| 380 | 380 | |
| 381 | 381 | // When we add some namespacess, we have to track them. Later, when "endElement" is invoked, we have to remove them.  | 
                                                        
@@ -242,7 +242,7 @@ discard block  | 
                                                    ||
| 242 | 242 | $this->quirks = $quirks;  | 
                                                        
| 243 | 243 | |
| 244 | 244 |          if ($this->insertMode > static::IM_INITIAL) { | 
                                                        
| 245 | -            $this->parseError("Illegal placement of DOCTYPE tag. Ignoring: " . $name); | 
                                                        |
| 245 | +            $this->parseError("Illegal placement of DOCTYPE tag. Ignoring: ".$name); | 
                                                        |
| 246 | 246 | |
| 247 | 247 | return;  | 
                                                        
| 248 | 248 | }  | 
                                                        
@@ -263,7 +263,7 @@ discard block  | 
                                                    ||
| 263 | 263 | $lname = $this->normalizeTagName($name);  | 
                                                        
| 264 | 264 | |
| 265 | 265 | // Make sure we have an html element.  | 
                                                        
| 266 | -        if (! $this->doc->documentElement && $name !== 'html' && ! $this->frag) { | 
                                                        |
| 266 | +        if (!$this->doc->documentElement && $name !== 'html' && !$this->frag) { | 
                                                        |
| 267 | 267 |              $this->startTag('html'); | 
                                                        
| 268 | 268 | }  | 
                                                        
| 269 | 269 | |
@@ -324,7 +324,7 @@ discard block  | 
                                                    ||
| 324 | 324 | array_unshift($this->nsStack, array(  | 
                                                        
| 325 | 325 | '' => $this->nsRoots[$lname]  | 
                                                        
| 326 | 326 | ) + $this->nsStack[0]);  | 
                                                        
| 327 | - $pushes ++;  | 
                                                        |
| 327 | + $pushes++;  | 
                                                        |
| 328 | 328 | }  | 
                                                        
| 329 | 329 | $needsWorkaround = false;  | 
                                                        
| 330 | 330 |          if (isset($this->options["xmlNamespaces"]) && $this->options["xmlNamespaces"]) { | 
                                                        
@@ -335,12 +335,12 @@ discard block  | 
                                                    ||
| 335 | 335 | array_unshift($this->nsStack, array(  | 
                                                        
| 336 | 336 | '' => $aVal  | 
                                                        
| 337 | 337 | ) + $this->nsStack[0]);  | 
                                                        
| 338 | - $pushes ++;  | 
                                                        |
| 338 | + $pushes++;  | 
                                                        |
| 339 | 339 |                  } elseif ((($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : '') === 'xmlns') { | 
                                                        
| 340 | 340 | array_unshift($this->nsStack, array(  | 
                                                        
| 341 | 341 | substr($aName, $pos + 1) => $aVal  | 
                                                        
| 342 | 342 | ) + $this->nsStack[0]);  | 
                                                        
| 343 | - $pushes ++;  | 
                                                        |
| 343 | + $pushes++;  | 
                                                        |
| 344 | 344 | }  | 
                                                        
| 345 | 345 | }  | 
                                                        
| 346 | 346 | }  | 
                                                        
@@ -354,9 +354,9 @@ discard block  | 
                                                    ||
| 354 | 354 | $prefix = ($pos = strpos($lname, ':')) ? substr($lname, 0, $pos) : '';  | 
                                                        
| 355 | 355 | |
| 356 | 356 | |
| 357 | -            if ($needsWorkaround!==false) { | 
                                                        |
| 357 | +            if ($needsWorkaround !== false) { | 
                                                        |
| 358 | 358 | |
| 359 | -                $xml = "<$lname xmlns=\"$needsWorkaround\" ".(strlen($prefix) && isset($this->nsStack[0][$prefix])?("xmlns:$prefix=\"".$this->nsStack[0][$prefix]."\""):"")."/>"; | 
                                                        |
| 359 | +                $xml = "<$lname xmlns=\"$needsWorkaround\" ".(strlen($prefix) && isset($this->nsStack[0][$prefix]) ? ("xmlns:$prefix=\"".$this->nsStack[0][$prefix]."\"") : "")."/>"; | 
                                                        |
| 360 | 360 | |
| 361 | 361 |                  $frag = new \DOMDocument('1.0', 'UTF-8'); | 
                                                        
| 362 | 362 | $frag->loadXML($xml);  | 
                                                        
@@ -409,9 +409,9 @@ discard block  | 
                                                    ||
| 409 | 409 |              try { | 
                                                        
| 410 | 410 | $prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : false;  | 
                                                        
| 411 | 411 | |
| 412 | -                if ($prefix==='xmlns') { | 
                                                        |
| 412 | +                if ($prefix === 'xmlns') { | 
                                                        |
| 413 | 413 | $ele->setAttributeNs(self::NAMESPACE_XMLNS, $aName, $aVal);  | 
                                                        
| 414 | -                } elseif ($prefix!==false && isset($this->nsStack[0][$prefix])) { | 
                                                        |
| 414 | +                } elseif ($prefix !== false && isset($this->nsStack[0][$prefix])) { | 
                                                        |
| 415 | 415 | $ele->setAttributeNs($this->nsStack[0][$prefix], $aName, $aVal);  | 
                                                        
| 416 | 416 |                  } else { | 
                                                        
| 417 | 417 | $ele->setAttribute($aName, $aVal);  | 
                                                        
@@ -434,7 +434,7 @@ discard block  | 
                                                    ||
| 434 | 434 |          else { | 
                                                        
| 435 | 435 | $this->current->appendChild($ele);  | 
                                                        
| 436 | 436 | |
| 437 | -            if (! Elements::isA($name, Elements::VOID_TAG)) { | 
                                                        |
| 437 | +            if (!Elements::isA($name, Elements::VOID_TAG)) { | 
                                                        |
| 438 | 438 | $this->current = $ele;  | 
                                                        
| 439 | 439 | }  | 
                                                        
| 440 | 440 | |
@@ -456,7 +456,7 @@ discard block  | 
                                                    ||
| 456 | 456 | // but we have to remove the namespaces pushed to $nsStack.  | 
                                                        
| 457 | 457 |          if ($pushes > 0 && Elements::isA($name, Elements::VOID_TAG)) { | 
                                                        
| 458 | 458 | // remove the namespaced definded by current node  | 
                                                        
| 459 | -            for ($i = 0; $i < $pushes; $i ++) { | 
                                                        |
| 459 | +            for ($i = 0; $i < $pushes; $i++) { | 
                                                        |
| 460 | 460 | array_shift($this->nsStack);  | 
                                                        
| 461 | 461 | }  | 
                                                        
| 462 | 462 | }  | 
                                                        
@@ -525,14 +525,14 @@ discard block  | 
                                                    ||
| 525 | 525 | |
| 526 | 526 | // remove the namespaced definded by current node  | 
                                                        
| 527 | 527 |          if (isset($this->pushes[$cid])) { | 
                                                        
| 528 | -            for ($i = 0; $i < $this->pushes[$cid][0]; $i ++) { | 
                                                        |
| 528 | +            for ($i = 0; $i < $this->pushes[$cid][0]; $i++) { | 
                                                        |
| 529 | 529 | array_shift($this->nsStack);  | 
                                                        
| 530 | 530 | }  | 
                                                        
| 531 | 531 | unset($this->pushes[$cid]);  | 
                                                        
| 532 | 532 | }  | 
                                                        
| 533 | 533 | |
| 534 | -        if (! $this->autoclose($lname)) { | 
                                                        |
| 535 | -            $this->parseError('Could not find closing tag for ' . $lname); | 
                                                        |
| 534 | +        if (!$this->autoclose($lname)) { | 
                                                        |
| 535 | +            $this->parseError('Could not find closing tag for '.$lname); | 
                                                        |
| 536 | 536 | }  | 
                                                        
| 537 | 537 | |
| 538 | 538 |          // switch ($this->insertMode) { | 
                                                        
@@ -566,9 +566,9 @@ discard block  | 
                                                    ||
| 566 | 566 | // practical as most documents contain these characters. Other text is not  | 
                                                        
| 567 | 567 | // expected here so recording a parse error is necessary.  | 
                                                        
| 568 | 568 | $dataTmp = trim($data, " \t\n\r\f");  | 
                                                        
| 569 | -            if (! empty($dataTmp)) { | 
                                                        |
| 569 | +            if (!empty($dataTmp)) { | 
                                                        |
| 570 | 570 | // fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode);  | 
                                                        
| 571 | -                $this->parseError("Unexpected text. Ignoring: " . $dataTmp); | 
                                                        |
| 571 | +                $this->parseError("Unexpected text. Ignoring: ".$dataTmp); | 
                                                        |
| 572 | 572 | }  | 
                                                        
| 573 | 573 | |
| 574 | 574 | return;  | 
                                                        
@@ -610,7 +610,7 @@ discard block  | 
                                                    ||
| 610 | 610 | // it sees fit.  | 
                                                        
| 611 | 611 |          if (isset($this->processor)) { | 
                                                        
| 612 | 612 | $res = $this->processor->process($this->current, $name, $data);  | 
                                                        
| 613 | -            if (! empty($res)) { | 
                                                        |
| 613 | +            if (!empty($res)) { | 
                                                        |
| 614 | 614 | $this->current = $res;  | 
                                                        
| 615 | 615 | }  | 
                                                        
| 616 | 616 | |
@@ -236,7 +236,7 @@ discard block  | 
                                                    ||
| 236 | 236 | }  | 
                                                        
| 237 | 237 | |
| 238 | 238 | // If not unary, add a closing tag.  | 
                                                        
| 239 | -        if (! Elements::isA($name, Elements::VOID_TAG)) { | 
                                                        |
| 239 | +        if (!Elements::isA($name, Elements::VOID_TAG)) { | 
                                                        |
| 240 | 240 | $this->closeTag($ele);  | 
                                                        
| 241 | 241 | }  | 
                                                        
| 242 | 242 | }  | 
                                                        
@@ -288,11 +288,11 @@ discard block  | 
                                                    ||
| 288 | 288 | */  | 
                                                        
| 289 | 289 | protected function namespaceAttrs($ele)  | 
                                                        
| 290 | 290 |      { | 
                                                        
| 291 | -        if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument){ | 
                                                        |
| 291 | +        if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument) { | 
                                                        |
| 292 | 292 | $this->xpath = new \DOMXPath($ele->ownerDocument);  | 
                                                        
| 293 | 293 | }  | 
                                                        
| 294 | 294 | |
| 295 | -        foreach( $this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele ) as $nsNode ) { | 
                                                        |
| 295 | +        foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) { | 
                                                        |
| 296 | 296 |              if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) { | 
                                                        
| 297 | 297 |                  $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"'); | 
                                                        
| 298 | 298 | }  | 
                                                        
@@ -333,7 +333,7 @@ discard block  | 
                                                    ||
| 333 | 333 | protected function attrs($ele)  | 
                                                        
| 334 | 334 |      { | 
                                                        
| 335 | 335 | // FIXME: Needs support for xml, xmlns, xlink, and namespaced elements.  | 
                                                        
| 336 | -        if (! $ele->hasAttributes()) { | 
                                                        |
| 336 | +        if (!$ele->hasAttributes()) { | 
                                                        |
| 337 | 337 | return $this;  | 
                                                        
| 338 | 338 | }  | 
                                                        
| 339 | 339 | |
@@ -371,35 +371,35 @@ discard block  | 
                                                    ||
| 371 | 371 | protected function nonBooleanAttribute(\DOMAttr $attr)  | 
                                                        
| 372 | 372 |      { | 
                                                        
| 373 | 373 | $ele = $attr->ownerElement;  | 
                                                        
| 374 | -        foreach($this->nonBooleanAttributes as $rule){ | 
                                                        |
| 374 | +        foreach ($this->nonBooleanAttributes as $rule) { | 
                                                        |
| 375 | 375 | |
| 376 | -            if(isset($rule['nodeNamespace']) && $rule['nodeNamespace']!==$ele->namespaceURI){ | 
                                                        |
| 376 | +            if (isset($rule['nodeNamespace']) && $rule['nodeNamespace'] !== $ele->namespaceURI) { | 
                                                        |
| 377 | 377 | continue;  | 
                                                        
| 378 | 378 | }  | 
                                                        
| 379 | -            if(isset($rule['attNamespace']) && $rule['attNamespace']!==$attr->namespaceURI){ | 
                                                        |
| 379 | +            if (isset($rule['attNamespace']) && $rule['attNamespace'] !== $attr->namespaceURI) { | 
                                                        |
| 380 | 380 | continue;  | 
                                                        
| 381 | 381 | }  | 
                                                        
| 382 | -            if(isset($rule['nodeName']) && !is_array($rule['nodeName']) && $rule['nodeName']!==$ele->localName){ | 
                                                        |
| 382 | +            if (isset($rule['nodeName']) && !is_array($rule['nodeName']) && $rule['nodeName'] !== $ele->localName) { | 
                                                        |
| 383 | 383 | continue;  | 
                                                        
| 384 | 384 | }  | 
                                                        
| 385 | -            if(isset($rule['nodeName']) && is_array($rule['nodeName']) && !in_array($ele->localName, $rule['nodeName'], true)){ | 
                                                        |
| 385 | +            if (isset($rule['nodeName']) && is_array($rule['nodeName']) && !in_array($ele->localName, $rule['nodeName'], true)) { | 
                                                        |
| 386 | 386 | continue;  | 
                                                        
| 387 | 387 | }  | 
                                                        
| 388 | -            if(isset($rule['attrName']) && !is_array($rule['attrName']) && $rule['attrName']!==$attr->localName){ | 
                                                        |
| 388 | +            if (isset($rule['attrName']) && !is_array($rule['attrName']) && $rule['attrName'] !== $attr->localName) { | 
                                                        |
| 389 | 389 | continue;  | 
                                                        
| 390 | 390 | }  | 
                                                        
| 391 | -            if(isset($rule['attrName']) && is_array($rule['attrName']) && !in_array($attr->localName, $rule['attrName'], true)){ | 
                                                        |
| 391 | +            if (isset($rule['attrName']) && is_array($rule['attrName']) && !in_array($attr->localName, $rule['attrName'], true)) { | 
                                                        |
| 392 | 392 | continue;  | 
                                                        
| 393 | 393 | }  | 
                                                        
| 394 | -            if(isset($rule['xpath'])){ | 
                                                        |
| 394 | +            if (isset($rule['xpath'])) { | 
                                                        |
| 395 | 395 | |
| 396 | 396 | $xp = $this->getXPath($attr);  | 
                                                        
| 397 | -                if(isset($rule['prefixes'])){ | 
                                                        |
| 398 | -                    foreach($rule['prefixes'] as $nsPrefix => $ns){ | 
                                                        |
| 397 | +                if (isset($rule['prefixes'])) { | 
                                                        |
| 398 | +                    foreach ($rule['prefixes'] as $nsPrefix => $ns) { | 
                                                        |
| 399 | 399 | $xp->registerNamespace($nsPrefix, $ns);  | 
                                                        
| 400 | 400 | }  | 
                                                        
| 401 | 401 | }  | 
                                                        
| 402 | -                if(!$xp->evaluate($rule['xpath'], $attr)){ | 
                                                        |
| 402 | +                if (!$xp->evaluate($rule['xpath'], $attr)) { | 
                                                        |
| 403 | 403 | continue;  | 
                                                        
| 404 | 404 | }  | 
                                                        
| 405 | 405 | }  | 
                                                        
@@ -410,8 +410,8 @@ discard block  | 
                                                    ||
| 410 | 410 | return false;  | 
                                                        
| 411 | 411 | }  | 
                                                        
| 412 | 412 | |
| 413 | -    private function getXPath(\DOMNode $node){ | 
                                                        |
| 414 | -        if(!$this->xpath){ | 
                                                        |
| 413 | +    private function getXPath(\DOMNode $node) { | 
                                                        |
| 414 | +        if (!$this->xpath) { | 
                                                        |
| 415 | 415 | $this->xpath = new \DOMXPath($node->ownerDocument);  | 
                                                        
| 416 | 416 | }  | 
                                                        
| 417 | 417 | return $this->xpath;  | 
                                                        
@@ -491,7 +491,7 @@ discard block  | 
                                                    ||
| 491 | 491 |      { | 
                                                        
| 492 | 492 | |
| 493 | 493 | // Escape the text rather than convert to named character references.  | 
                                                        
| 494 | -        if (! $this->encode) { | 
                                                        |
| 494 | +        if (!$this->encode) { | 
                                                        |
| 495 | 495 | return $this->escape($text, $attribute);  | 
                                                        
| 496 | 496 | }  | 
                                                        
| 497 | 497 | |
@@ -168,7 +168,7 @@ discard block  | 
                                                    ||
| 168 | 168 | $options = array_merge($this->getOptions(), $options);  | 
                                                        
| 169 | 169 | $events = new DOMTreeBuilder(false, $options);  | 
                                                        
| 170 | 170 | $scanner = new Scanner($input);  | 
                                                        
| 171 | - $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML: Tokenizer::CONFORMANT_HTML);  | 
                                                        |
| 171 | + $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML : Tokenizer::CONFORMANT_HTML);  | 
                                                        |
| 172 | 172 | |
| 173 | 173 | $parser->parse();  | 
                                                        
| 174 | 174 | $this->errors = $events->getErrors();  | 
                                                        
@@ -187,7 +187,7 @@ discard block  | 
                                                    ||
| 187 | 187 | $options = array_merge($this->getOptions(), $options);  | 
                                                        
| 188 | 188 | $events = new DOMTreeBuilder(true, $options);  | 
                                                        
| 189 | 189 | $scanner = new Scanner($input);  | 
                                                        
| 190 | - $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML: Tokenizer::CONFORMANT_HTML);  | 
                                                        |
| 190 | + $parser = new Tokenizer($scanner, $events, !empty($options['xmlNamespaces']) ? Tokenizer::CONFORMANT_XML : Tokenizer::CONFORMANT_HTML);  | 
                                                        |
| 191 | 191 | |
| 192 | 192 | $parser->parse();  | 
                                                        
| 193 | 193 | $this->errors = $events->getErrors();  | 
                                                        
@@ -243,7 +243,7 @@ discard block  | 
                                                    ||
| 243 | 243 | return $this->text($tok);  | 
                                                        
| 244 | 244 | }  | 
                                                        
| 245 | 245 | |
| 246 | - $sequence = '</' . $this->untilTag . '>';  | 
                                                        |
| 246 | + $sequence = '</'.$this->untilTag.'>';  | 
                                                        |
| 247 | 247 | $txt = $this->readUntilSequence($sequence);  | 
                                                        
| 248 | 248 | $this->events->text($txt);  | 
                                                        
| 249 | 249 | $this->setTextMode(0);  | 
                                                        
@@ -264,11 +264,11 @@ discard block  | 
                                                    ||
| 264 | 264 | return $this->text($tok);  | 
                                                        
| 265 | 265 | }  | 
                                                        
| 266 | 266 | |
| 267 | - $sequence = '</' . $this->untilTag;  | 
                                                        |
| 267 | + $sequence = '</'.$this->untilTag;  | 
                                                        |
| 268 | 268 | $txt = '';  | 
                                                        
| 269 | 269 | |
| 270 | 270 | $caseSensitive = !Elements::isHtml5Element($this->untilTag);  | 
                                                        
| 271 | -        while ($tok !== false && ! ($tok == '<' && ($this->scanner->sequenceMatches($sequence, $caseSensitive)))) { | 
                                                        |
| 271 | +        while ($tok !== false && !($tok == '<' && ($this->scanner->sequenceMatches($sequence, $caseSensitive)))) { | 
                                                        |
| 272 | 272 |              if ($tok == '&') { | 
                                                        
| 273 | 273 | $txt .= $this->decodeCharacterReference();  | 
                                                        
| 274 | 274 | $tok = $this->scanner->current();  | 
                                                        
@@ -354,7 +354,7 @@ discard block  | 
                                                    ||
| 354 | 354 | // > -> parse error  | 
                                                        
| 355 | 355 | // EOF -> parse error  | 
                                                        
| 356 | 356 | // -> parse error  | 
                                                        
| 357 | -        if (! ctype_alpha($tok)) { | 
                                                        |
| 357 | +        if (!ctype_alpha($tok)) { | 
                                                        |
| 358 | 358 |              $this->parseError("Expected tag name, got '%s'", $tok); | 
                                                        
| 359 | 359 |              if ($tok == "\0" || $tok === false) { | 
                                                        
| 360 | 360 | return false;  | 
                                                        
@@ -363,7 +363,7 @@ discard block  | 
                                                    ||
| 363 | 363 | }  | 
                                                        
| 364 | 364 | |
| 365 | 365 |          $name = $this->scanner->charsUntil("\n\f \t>"); | 
                                                        
| 366 | - $name = $this->mode === self::CONFORMANT_XML ? $name: strtolower($name);  | 
                                                        |
| 366 | + $name = $this->mode === self::CONFORMANT_XML ? $name : strtolower($name);  | 
                                                        |
| 367 | 367 | // Trash whitespace.  | 
                                                        
| 368 | 368 | $this->scanner->whitespace();  | 
                                                        
| 369 | 369 | |
@@ -386,7 +386,7 @@ discard block  | 
                                                    ||
| 386 | 386 | protected function tagName()  | 
                                                        
| 387 | 387 |      { | 
                                                        
| 388 | 388 | $tok = $this->scanner->current();  | 
                                                        
| 389 | -        if (! ctype_alpha($tok)) { | 
                                                        |
| 389 | +        if (!ctype_alpha($tok)) { | 
                                                        |
| 390 | 390 | return false;  | 
                                                        
| 391 | 391 | }  | 
                                                        
| 392 | 392 | |
@@ -402,7 +402,7 @@ discard block  | 
                                                    ||
| 402 | 402 |              do { | 
                                                        
| 403 | 403 | $this->scanner->whitespace();  | 
                                                        
| 404 | 404 | $this->attribute($attributes);  | 
                                                        
| 405 | - } while (! $this->isTagEnd($selfClose));  | 
                                                        |
| 405 | + } while (!$this->isTagEnd($selfClose));  | 
                                                        |
| 406 | 406 |          } catch (ParseError $e) { | 
                                                        
| 407 | 407 | $selfClose = false;  | 
                                                        
| 408 | 408 | }  | 
                                                        
@@ -569,7 +569,7 @@ discard block  | 
                                                    ||
| 569 | 569 | */  | 
                                                        
| 570 | 570 | protected function quotedAttributeValue($quote)  | 
                                                        
| 571 | 571 |      { | 
                                                        
| 572 | - $stoplist = "\f" . $quote;  | 
                                                        |
| 572 | + $stoplist = "\f".$quote;  | 
                                                        |
| 573 | 573 | $val = '';  | 
                                                        
| 574 | 574 | |
| 575 | 575 |          while (true) { | 
                                                        
@@ -671,7 +671,7 @@ discard block  | 
                                                    ||
| 671 | 671 |          if ($tok == "\0") { | 
                                                        
| 672 | 672 | $tok = UTF8Utils::FFFD;  | 
                                                        
| 673 | 673 | }  | 
                                                        
| 674 | -        while (! $this->isCommentEnd()) { | 
                                                        |
| 674 | +        while (!$this->isCommentEnd()) { | 
                                                        |
| 675 | 675 | $comment .= $tok;  | 
                                                        
| 676 | 676 | $tok = $this->scanner->next();  | 
                                                        
| 677 | 677 | }  | 
                                                        
@@ -731,7 +731,7 @@ discard block  | 
                                                    ||
| 731 | 731 |          $chars = $this->scanner->charsWhile("DOCTYPEdoctype"); | 
                                                        
| 732 | 732 |          if (strcasecmp($chars, 'DOCTYPE')) { | 
                                                        
| 733 | 733 |              $this->parseError('Expected DOCTYPE, got %s', $chars); | 
                                                        
| 734 | -            return $this->bogusComment('<!' . $chars); | 
                                                        |
| 734 | +            return $this->bogusComment('<!'.$chars); | 
                                                        |
| 735 | 735 | }  | 
                                                        
| 736 | 736 | |
| 737 | 737 | $this->scanner->whitespace();  | 
                                                        
@@ -838,7 +838,7 @@ discard block  | 
                                                    ||
| 838 | 838 | $tok = $this->scanner->current();  | 
                                                        
| 839 | 839 |          if ($tok == '"' || $tok == "'") { | 
                                                        
| 840 | 840 | $this->scanner->consume();  | 
                                                        
| 841 | - $ret = $this->scanner->charsUntil($tok . $stopchars);  | 
                                                        |
| 841 | + $ret = $this->scanner->charsUntil($tok.$stopchars);  | 
                                                        |
| 842 | 842 |              if ($this->scanner->current() == $tok) { | 
                                                        
| 843 | 843 | $this->scanner->consume();  | 
                                                        
| 844 | 844 |              } else { | 
                                                        
@@ -866,19 +866,19 @@ discard block  | 
                                                    ||
| 866 | 866 |          $chars = $this->scanner->charsWhile('CDAT'); | 
                                                        
| 867 | 867 |          if ($chars != 'CDATA' || $this->scanner->current() != '[') { | 
                                                        
| 868 | 868 |              $this->parseError('Expected [CDATA[, got %s', $chars); | 
                                                        
| 869 | -            return $this->bogusComment('<![' . $chars); | 
                                                        |
| 869 | +            return $this->bogusComment('<!['.$chars); | 
                                                        |
| 870 | 870 | }  | 
                                                        
| 871 | 871 | |
| 872 | 872 | $tok = $this->scanner->next();  | 
                                                        
| 873 | 873 |          do { | 
                                                        
| 874 | 874 |              if ($tok === false) { | 
                                                        
| 875 | 875 |                  $this->parseError('Unexpected EOF inside CDATA.'); | 
                                                        
| 876 | -                $this->bogusComment('<![CDATA[' . $cdata); | 
                                                        |
| 876 | +                $this->bogusComment('<![CDATA['.$cdata); | 
                                                        |
| 877 | 877 | return true;  | 
                                                        
| 878 | 878 | }  | 
                                                        
| 879 | 879 | $cdata .= $tok;  | 
                                                        
| 880 | 880 | $tok = $this->scanner->next();  | 
                                                        
| 881 | -        } while (! $this->scanner->sequenceMatches(']]>')); | 
                                                        |
| 881 | +        } while (!$this->scanner->sequenceMatches(']]>')); | 
                                                        |
| 882 | 882 | |
| 883 | 883 | // Consume ]]>  | 
                                                        
| 884 | 884 | $this->scanner->consume(3);  | 
                                                        
@@ -913,13 +913,13 @@ discard block  | 
                                                    ||
| 913 | 913 | // If not a PI, send to bogusComment.  | 
                                                        
| 914 | 914 |          if (strlen($procName) == 0 || $white == 0 || $this->scanner->current() == false) { | 
                                                        
| 915 | 915 |              $this->parseError("Expected processing instruction name, got $tok"); | 
                                                        
| 916 | -            $this->bogusComment('<?' . $tok . $procName); | 
                                                        |
| 916 | +            $this->bogusComment('<?'.$tok.$procName); | 
                                                        |
| 917 | 917 | return true;  | 
                                                        
| 918 | 918 | }  | 
                                                        
| 919 | 919 | |
| 920 | 920 | $data = '';  | 
                                                        
| 921 | 921 | // As long as it's not the case that the next two chars are ? and >.  | 
                                                        
| 922 | -        while (! ($this->scanner->current() == '?' && $this->scanner->peek() == '>')) { | 
                                                        |
| 922 | +        while (!($this->scanner->current() == '?' && $this->scanner->peek() == '>')) { | 
                                                        |
| 923 | 923 | $data .= $this->scanner->current();  | 
                                                        
| 924 | 924 | |
| 925 | 925 | $tok = $this->scanner->next();  | 
                                                        
@@ -989,7 +989,7 @@ discard block  | 
                                                    ||
| 989 | 989 | */  | 
                                                        
| 990 | 990 | protected function sequenceMatches($sequence, $caseSensitive = true)  | 
                                                        
| 991 | 991 |      { | 
                                                        
| 992 | - @trigger_error(__METHOD__ . ' method is deprecated since version 2.4 and will be removed in 3.0. Use Scanner::sequenceMatches() instead.', E_USER_DEPRECATED);  | 
                                                        |
| 992 | + @trigger_error(__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. Use Scanner::sequenceMatches() instead.', E_USER_DEPRECATED);  | 
                                                        |
| 993 | 993 | |
| 994 | 994 | return $this->scanner->sequenceMatches($sequence, $caseSensitive);  | 
                                                        
| 995 | 995 | }  | 
                                                        
@@ -1071,7 +1071,7 @@ discard block  | 
                                                    ||
| 1071 | 1071 | |
| 1072 | 1072 | // These indicate not an entity. We return just  | 
                                                        
| 1073 | 1073 | // the &.  | 
                                                        
| 1074 | -        if (strspn($tok, static::WHITE . "&<") == 1) { | 
                                                        |
| 1074 | +        if (strspn($tok, static::WHITE."&<") == 1) { | 
                                                        |
| 1075 | 1075 | // $this->scanner->next();  | 
                                                        
| 1076 | 1076 | return '&';  | 
                                                        
| 1077 | 1077 | }  | 
                                                        
@@ -1148,6 +1148,6 @@ discard block  | 
                                                    ||
| 1148 | 1148 | }  | 
                                                        
| 1149 | 1149 | |
| 1150 | 1150 |          $this->parseError("Expected &ENTITY;, got &ENTITY%s (no trailing ;) ", $tok); | 
                                                        
| 1151 | - return '&' . $entity;  | 
                                                        |
| 1151 | + return '&'.$entity;  | 
                                                        |
| 1152 | 1152 | }  | 
                                                        
| 1153 | 1153 | }  | 
                                                        
@@ -323,13 +323,9 @@  | 
                                                    ||
| 323 | 323 |          if ($tok == '-' && $this->scanner->peek() == '-') { | 
                                                        
| 324 | 324 | $this->scanner->consume(2);  | 
                                                        
| 325 | 325 | return $this->comment();  | 
                                                        
| 326 | - }  | 
                                                        |
| 327 | -  | 
                                                        |
| 328 | -        elseif ($tok == 'D' || $tok == 'd') { // Doctype | 
                                                        |
| 326 | +        } elseif ($tok == 'D' || $tok == 'd') { // Doctype | 
                                                        |
| 329 | 327 | return $this->doctype();  | 
                                                        
| 330 | - }  | 
                                                        |
| 331 | -  | 
                                                        |
| 332 | -        elseif ($tok == '[') { // CDATA section | 
                                                        |
| 328 | +        } elseif ($tok == '[') { // CDATA section | 
                                                        |
| 333 | 329 | return $this->cdataSection();  | 
                                                        
| 334 | 330 | }  | 
                                                        
| 335 | 331 | |