@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | /** @noinspection StringFragmentMisplacedInspection */ |
| 211 | 211 | if (\stripos('<?xml', $xml) !== 0) { |
| 212 | 212 | $xmlHackUsed = true; |
| 213 | - $xml = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $xml; |
|
| 213 | + $xml = '<?xml encoding="'.$this->getEncoding().'" ?>'.$xml; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $documentFound = $this->document->loadXML($xml, $optionsXml); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | && |
| 234 | 234 | \count($xmlErrors) > 0 |
| 235 | 235 | ) { |
| 236 | - $errorStr = 'XML-Errors: ' . \print_r($xmlErrors, true) . ' in ' . \print_r($xml, true); |
|
| 236 | + $errorStr = 'XML-Errors: '.\print_r($xmlErrors, true).' in '.\print_r($xml, true); |
|
| 237 | 237 | |
| 238 | 238 | if (!$this->reportXmlErrorsAsException) { |
| 239 | 239 | \trigger_error($errorStr, \E_USER_WARNING); |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | private function removeXPathNamespaces(string $xml): string |
| 565 | 565 | { |
| 566 | 566 | foreach ($this->xPathNamespaces as $key => $value) { |
| 567 | - $xml = \str_replace($key . ':', '', $xml); |
|
| 567 | + $xml = \str_replace($key.':', '', $xml); |
|
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | return (string) \preg_replace('#xmlns:?.*=(["\'])(?:.*)\\1#Ui', '', $xml); |
@@ -9,36 +9,36 @@ |
||
| 9 | 9 | |
| 10 | 10 | // find all link |
| 11 | 11 | foreach ($html->find('a') as $e) { |
| 12 | - echo $e->href . '<br>'; |
|
| 12 | + echo $e->href.'<br>'; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // find all image |
| 16 | 16 | foreach ($html->find('img') as $e) { |
| 17 | - echo $e->src . '<br>'; |
|
| 17 | + echo $e->src.'<br>'; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // find all image with full tag |
| 21 | 21 | foreach ($html->find('img') as $e) { |
| 22 | - echo $e->outertext . '<br>'; |
|
| 22 | + echo $e->outertext.'<br>'; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // find all div tags with id=gbar |
| 26 | 26 | foreach ($html->find('div#gbar') as $e) { |
| 27 | - echo $e->innertext . '<br>'; |
|
| 27 | + echo $e->innertext.'<br>'; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // find all span tags with class=gb1 |
| 31 | 31 | foreach ($html->find('span.gb1') as $e) { |
| 32 | - echo $e->outertext . '<br>'; |
|
| 32 | + echo $e->outertext.'<br>'; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // find all td tags with attribute align=center |
| 36 | 36 | foreach ($html->find('td[align=center]') as $e) { |
| 37 | - echo $e->innertext . '<br>'; |
|
| 37 | + echo $e->innertext.'<br>'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | // extract text from table |
| 41 | -echo $html->find('td[align="center"]', 1)->plaintext . '<br><hr>'; |
|
| 41 | +echo $html->find('td[align="center"]', 1)->plaintext.'<br><hr>'; |
|
| 42 | 42 | |
| 43 | 43 | // extract text from HTML |
| 44 | 44 | echo $html->plaintext; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector 2.8+ is not installed (you can use filterXPath instead).'); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $converterKey = '-' . $isForHtml . '-' . $ignoreCssSelectorErrors . '-'; |
|
| 53 | + $converterKey = '-'.$isForHtml.'-'.$ignoreCssSelectorErrors.'-'; |
|
| 54 | 54 | static $converterArray = []; |
| 55 | 55 | if (!isset($converterArray[$converterKey])) { |
| 56 | 56 | $converterArray[$converterKey] = new CssSelectorConverter($isForHtml); |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | $tmpStr = $this->normalizeStringForComparision($string); |
| 195 | 195 | if ($tmpDomString !== $tmpStr) { |
| 196 | 196 | throw new \RuntimeException( |
| 197 | - 'Not valid HTML fragment!' . "\n" . |
|
| 198 | - $tmpDomString . "\n" . |
|
| 197 | + 'Not valid HTML fragment!'."\n". |
|
| 198 | + $tmpDomString."\n". |
|
| 199 | 199 | $tmpStr |
| 200 | 200 | ); |
| 201 | 201 | } |
@@ -254,8 +254,8 @@ discard block |
||
| 254 | 254 | $tmpStr = $this->normalizeStringForComparision($string); |
| 255 | 255 | if ($tmpDomOuterTextString !== $tmpStr) { |
| 256 | 256 | throw new \RuntimeException( |
| 257 | - 'Not valid HTML fragment!' . "\n" |
|
| 258 | - . $tmpDomOuterTextString . "\n" . |
|
| 257 | + 'Not valid HTML fragment!'."\n" |
|
| 258 | + . $tmpDomOuterTextString."\n". |
|
| 259 | 259 | $tmpStr |
| 260 | 260 | ); |
| 261 | 261 | } |
@@ -999,6 +999,6 @@ discard block |
||
| 999 | 999 | */ |
| 1000 | 1000 | public function delete() |
| 1001 | 1001 | { |
| 1002 | - $this->outertext=''; |
|
| 1002 | + $this->outertext = ''; |
|
| 1003 | 1003 | } |
| 1004 | 1004 | } |
@@ -465,6 +465,6 @@ |
||
| 465 | 465 | */ |
| 466 | 466 | public function delete() |
| 467 | 467 | { |
| 468 | - $this->outertext=''; |
|
| 468 | + $this->outertext = ''; |
|
| 469 | 469 | } |
| 470 | 470 | } |