Completed
Pull Request — master (#75)
by Lars
14:19
created
src/voku/helper/SimpleHtmlDom.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
             $tmpStr = $this->normalizeStringForComparision($string);
418 418
             if ($tmpDomString !== $tmpStr) {
419 419
                 throw new \RuntimeException(
420
-                    'Not valid HTML fragment!' . "\n" .
421
-                    $tmpDomString . "\n" .
420
+                    'Not valid HTML fragment!'."\n".
421
+                    $tmpDomString."\n".
422 422
                     $tmpStr
423 423
                 );
424 424
             }
@@ -490,8 +490,8 @@  discard block
 block discarded – undo
490 490
         $tmpStr = $this->normalizeStringForComparision($string);
491 491
         if ($tmpDomOuterTextString !== $tmpStr) {
492 492
             throw new \RuntimeException(
493
-                'Not valid HTML fragment!' . "\n"
494
-                . $tmpDomOuterTextString . "\n" .
493
+                'Not valid HTML fragment!'."\n"
494
+                . $tmpDomOuterTextString."\n".
495 495
                 $tmpStr
496 496
             );
497 497
         }
Please login to merge, or discard this patch.
src/voku/helper/AbstractDomParser.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments);
84 84
         }
85 85
 
86
-        throw new \BadMethodCallException('Method does not exist: ' . $name);
86
+        throw new \BadMethodCallException('Method does not exist: '.$name);
87 87
     }
88 88
 
89 89
     /**
@@ -389,12 +389,12 @@  discard block
 block discarded – undo
389 389
         $regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU';
390 390
         $htmlTmp = \preg_replace_callback(
391 391
             $regExSpecialScript,
392
-            static function ($scripts) {
392
+            static function($scripts) {
393 393
                 if (empty($scripts['content'])) {
394 394
                     return $scripts[0];
395 395
                 }
396 396
 
397
-                return '<script' . $scripts['attr'] . '>' . \str_replace('</', '<\/', $scripts['content']) . '</script>';
397
+                return '<script'.$scripts['attr'].'>'.\str_replace('</', '<\/', $scripts['content']).'</script>';
398 398
             },
399 399
             $html
400 400
         );
@@ -423,14 +423,14 @@  discard block
 block discarded – undo
423 423
                 self::$domReplaceHelper['orig']
424 424
             );
425 425
 
426
-            $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>';
427
-            $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>';
426
+            $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>';
427
+            $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>';
428 428
 
429 429
             $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = '';
430 430
             $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = '';
431 431
 
432
-            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper;
433
-            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>';
432
+            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper;
433
+            $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>';
434 434
 
435 435
             $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script';
436 436
             $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>';
Please login to merge, or discard this patch.
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.