Completed
Push — master ( 9a5449...ad2f53 )
by Lars
14:03
created
src/voku/helper/SimpleHtmlAttributes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
             return (string) $this;
66 66
         }
67 67
 
68
-        throw new \InvalidArgumentException('Undefined property: $' . $name);
68
+        throw new \InvalidArgumentException('Undefined property: $'.$name);
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
example/example_find_text.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,5 +41,5 @@
 block discarded – undo
41 41
 $document = new \voku\helper\HtmlDomParser($html);
42 42
 
43 43
 foreach (find_contains($document, '.lall', 'foo') as $child_dom) {
44
-    echo $child_dom->html() . "\n";
44
+    echo $child_dom->html()."\n";
45 45
 }
Please login to merge, or discard this patch.
example/example_scraping_imdb.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,5 +24,5 @@
 block discarded – undo
24 24
 $data = scraping_imdb('http://imdb.com/title/tt0335266/');
25 25
 
26 26
 foreach ($data as $k => $v) {
27
-    echo '<strong>' . $k . ' </strong>' . $v . '<br>';
27
+    echo '<strong>'.$k.' </strong>'.$v.'<br>';
28 28
 }
Please login to merge, or discard this patch.
example/example_scraping_lebensmittelwarnung.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
 
35 35
 foreach ($data as $v) {
36 36
     foreach ($v as $k_inner => $v_inner) {
37
-        echo '<strong>' . $k_inner . ':</strong>&nbsp;' . $v_inner . '<br><br>';
37
+        echo '<strong>'.$k_inner.':</strong>&nbsp;'.$v_inner.'<br><br>';
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
example/example_advanced_selector.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 HTML;
16 16
 
17 17
 $html = HtmlDomParser::str_get_html($str);
18
-echo $html->find('div div div', 0)->innertext . '<br>'; // result: "ok"
18
+echo $html->find('div div div', 0)->innertext.'<br>'; // result: "ok"
19 19
 
20 20
 // -----------------------------------------------------------------------------
21 21
 // nested selector
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 $html = HtmlDomParser::str_get_html($str);
34 34
 foreach ($html->find('ul') as $ul) {
35 35
     foreach ($ul->find('li') as $li) {
36
-        echo $li->innertext . '<br>';
36
+        echo $li->innertext.'<br>';
37 37
     }
38 38
 }
39 39
 
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 $html = HtmlDomParser::str_get_html($str);
51 51
 foreach ($html->find('input[type=checkbox]') as $checkbox) {
52 52
     if ($checkbox->checked) {
53
-        echo $checkbox->name . ' is checked<br>';
53
+        echo $checkbox->name.' is checked<br>';
54 54
     } else {
55
-        echo $checkbox->name . ' is not checked<br>';
55
+        echo $checkbox->name.' is not checked<br>';
56 56
     }
57 57
 }
Please login to merge, or discard this patch.
example/example_find_image_if_exists.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 $imageOrFalse = $document->findOneOrFalse('#test');
16 16
 if ($imageOrFalse !== false) {
17
-    echo $imageOrFalse->getAttribute('src') . "\n";
17
+    echo $imageOrFalse->getAttribute('src')."\n";
18 18
 }
19 19
 
20 20
 // -----------------------------------------------------------------------------
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 $imageOrFalse = $document->findOneOrFalse('#non_test');
31 31
 if ($imageOrFalse !== false) {
32
-    echo $imageOrFalse->getAttribute('src') . "\n";
32
+    echo $imageOrFalse->getAttribute('src')."\n";
33 33
 }
34 34
 
35 35
 // -----------------------------------------------------------------------------
@@ -46,6 +46,6 @@  discard block
 block discarded – undo
46 46
 $imagesOrFalse = $document->findMultiOrFalse('.image_foo');
47 47
 if ($imagesOrFalse !== false) {
48 48
     foreach ($imagesOrFalse as $image) {
49
-        echo $image->getAttribute('src') . "\n";
49
+        echo $image->getAttribute('src')."\n";
50 50
     }
51 51
 }
Please login to merge, or discard this patch.
build/generate_docs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__ . '/../vendor/autoload.php';
4
-require __DIR__ . '/vendor/autoload.php';
3
+require __DIR__.'/../vendor/autoload.php';
4
+require __DIR__.'/vendor/autoload.php';
5 5
 
6 6
 $readmeText = (new \voku\PhpReadmeHelper\GenerateApi())->generate(
7
-    __DIR__ . '/../src/',
8
-    __DIR__ . '/docs/api.md',
7
+    __DIR__.'/../src/',
8
+    __DIR__.'/docs/api.md',
9 9
     [
10 10
         \voku\helper\DomParserInterface::class,
11 11
         \voku\helper\SimpleHtmlDomNodeInterface::class,
@@ -13,4 +13,4 @@  discard block
 block discarded – undo
13 13
     ]
14 14
 );
15 15
 
16
-file_put_contents(__DIR__ . '/../README_API.md', $readmeText);
16
+file_put_contents(__DIR__.'/../README_API.md', $readmeText);
Please login to merge, or discard this patch.
src/voku/helper/XmlDomParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
example/example_basic_selector.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,36 +9,36 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.