Completed
Push — master ( 140b40...7cb46a )
by Andrew
03:24
created
src/Configuration.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 
73 73
     /**
74 74
      * @param string $option
75
-     * @param mixed $value
75
+     * @param string $value
76 76
      */
77 77
     public function set($option, $value) {
78 78
         $this->options[$option] = $value;
Please login to merge, or discard this patch.
src/Modules/Extractors/ImageExtractor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             return false;
348 348
         }
349 349
 
350
-        $regex = '@' . implode('|', $this->badFileNames) . '@i';
350
+        $regex = '@'.implode('|', $this->badFileNames).'@i';
351 351
 
352 352
         if (preg_match($regex, $imgSrc)) {
353 353
             return false;
@@ -545,10 +545,10 @@  discard block
 block discarded – undo
545 545
         $knownImage = null;
546 546
 
547 547
         foreach ($knownImgDomNames as $knownName) {
548
-            $known = $this->article()->getRawDoc()->find('#' . $knownName);
548
+            $known = $this->article()->getRawDoc()->find('#'.$knownName);
549 549
 
550 550
             if (!$known->count()) {
551
-                $known = $this->article()->getRawDoc()->find('.' . $knownName);
551
+                $known = $this->article()->getRawDoc()->find('.'.$knownName);
552 552
             }
553 553
 
554 554
             if ($known->count()) {
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
      */
603 603
     private function customSiteMapping() {
604 604
         if (empty(self::$CUSTOM_SITE_MAPPING)) {
605
-            $file = __DIR__ . '/../../../resources/images/known-image-css.txt';
605
+            $file = __DIR__.'/../../../resources/images/known-image-css.txt';
606 606
 
607 607
             $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", file_get_contents($file)));
608 608
 
Please login to merge, or discard this patch.
src/Modules/Extractors/PublishDateExtractor.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     private function getDateFromURL() {
31 31
         // Determine date based on URL
32 32
         if (preg_match('@(?:[\d]{4})(?<delimiter>[/-])(?:[\d]{2})\k<delimiter>(?:[\d]{2})@U', $this->article()->getFinalUrl(), $matches)) {
33
-            $dt = \DateTime::createFromFormat('Y' . $matches['delimiter'] . 'm' . $matches['delimiter'] . 'd', $matches[0]);
33
+            $dt = \DateTime::createFromFormat('Y'.$matches['delimiter'].'m'.$matches['delimiter'].'d', $matches[0]);
34 34
             $dt->setTime(0, 0, 0);
35 35
 
36 36
             if ($dt === false) {
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@  discard block
 block discarded – undo
92 92
                     $dt = new \DateTime($node->getAttribute('content'));
93 93
                     break;
94 94
                 }
95
-            }
96
-            catch (\Exception $e) {
95
+            } catch (\Exception $e) {
97 96
                 // Do nothing here in case the node has unrecognizable date information.
98 97
             }
99 98
         }
@@ -113,8 +112,7 @@  discard block
 block discarded – undo
113 112
                     $dt = new \DateTime($json->datePublished);
114 113
                     break;
115 114
                 }
116
-            }
117
-            catch (\Exception $e) {
115
+            } catch (\Exception $e) {
118 116
                 // Do nothing here in case the node has unrecognizable date information.
119 117
             }
120 118
         }
@@ -141,8 +139,7 @@  discard block
 block discarded – undo
141 139
                     $dt = new \DateTime($node->getAttribute('content'));
142 140
                     break;
143 141
                 }
144
-            }
145
-            catch (\Exception $e) {
142
+            } catch (\Exception $e) {
146 143
                 // Do nothing here in case the node has unrecognizable date information.
147 144
             }
148 145
         }
@@ -174,8 +171,7 @@  discard block
 block discarded – undo
174 171
             if (is_null($dt) && isset($og_data['pubdate'])) {
175 172
                 $dt = new \DateTime($og_data['pubdate']);
176 173
             }
177
-        }
178
-        catch (\Exception $e) {
174
+        } catch (\Exception $e) {
179 175
             // Do nothing here in case the node has unrecognizable date information.
180 176
         }
181 177
 
@@ -207,8 +203,7 @@  discard block
 block discarded – undo
207 203
                     $dt = new \DateTime($json->dateCreated);
208 204
                     break;
209 205
                 }
210
-            }
211
-            catch (\Exception $e) {
206
+            } catch (\Exception $e) {
212 207
                 // Do nothing here in case the node has unrecognizable date information.
213 208
             }
214 209
         }
@@ -227,8 +222,7 @@  discard block
 block discarded – undo
227 222
                     $dt = new \DateTime($node->getAttribute('content'));
228 223
                     break;
229 224
                 }
230
-            }
231
-            catch (\Exception $e) {
225
+            } catch (\Exception $e) {
232 226
                 // Do nothing here in case the node has unrecognizable date information.
233 227
             }
234 228
         }
@@ -250,8 +244,7 @@  discard block
 block discarded – undo
250 244
                         break;
251 245
                     }
252 246
                 }
253
-            }
254
-            catch (\Exception $e) {
247
+            } catch (\Exception $e) {
255 248
                 // Do nothing here in case the node has unrecognizable date information.
256 249
             }
257 250
         }
Please login to merge, or discard this patch.
src/Modules/Cleaners/DocumentCleaner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         ];
166 166
 
167 167
         $exceptions = array_map(function($value) {
168
-            return ':not(' . $value . ')';
168
+            return ':not('.$value.')';
169 169
         }, $this->exceptionSelectors);
170 170
 
171 171
         $exceptions = implode('', $exceptions);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         foreach ($lists as $expr => $list) {
174 174
             foreach ($list as $value) {
175 175
                 foreach ($attrs as $attr) {
176
-                    $selector = sprintf($expr, $attr, $value) . $exceptions;
176
+                    $selector = sprintf($expr, $attr, $value).$exceptions;
177 177
 
178 178
                     foreach ($this->document()->find($selector) as $node) {
179 179
                         $node->remove();
Please login to merge, or discard this patch.
src/Utils/Helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@
 block discarded – undo
22 22
         $parts = parse_url($urlToCrawl);
23 23
 
24 24
         if ($parts === false) {
25
-            throw new MalformedURLException($urlToCrawl . ' - is a malformed URL and cannot be processed');
25
+            throw new MalformedURLException($urlToCrawl.' - is a malformed URL and cannot be processed');
26 26
         }
27 27
 
28 28
         $prefix = isset($parts['query']) && $parts['query'] ? '&' : '?';
29 29
 
30
-        $finalUrl = str_replace('#!', $prefix . '_escaped_fragment_=', $urlToCrawl);
30
+        $finalUrl = str_replace('#!', $prefix.'_escaped_fragment_=', $urlToCrawl);
31 31
 
32 32
         return (object)[
33 33
             'url' => $urlToCrawl,
Please login to merge, or discard this patch.
src/Text/WordStats.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function __construct($options = []) {
26 26
         foreach ($options as $key => $value) {
27
-            $method = 'set' . ucfirst($key);
27
+            $method = 'set'.ucfirst($key);
28 28
 
29 29
             if (method_exists($this, $method)) {
30 30
                 call_user_func([$this, $method], $value);
Please login to merge, or discard this patch.
src/Text/StopWords.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
      */
67 67
     public function getWordList() {
68 68
         if (empty($this->cached)) {
69
-            $file = sprintf(__DIR__ . '/../../resources/text/stopwords-%s.txt', $this->getLanguage());
69
+            $file = sprintf(__DIR__.'/../../resources/text/stopwords-%s.txt', $this->getLanguage());
70 70
 
71 71
             $this->cached = explode("\n", str_replace(["\r\n", "\r"], "\n", file_get_contents($file)));
72 72
         }
Please login to merge, or discard this patch.
src/Images/LocallyStoredImage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function __construct($options = []) {
26 26
         foreach ($options as $key => $value) {
27
-            $method = 'set' . ucfirst($key);
27
+            $method = 'set'.ucfirst($key);
28 28
 
29 29
             if (method_exists($this, $method)) {
30 30
                 call_user_func([$this, $method], $value);
Please login to merge, or discard this patch.
src/Images/Image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function __construct($options = []) {
26 26
         foreach ($options as $key => $value) {
27
-            $method = 'set' . ucfirst($key);
27
+            $method = 'set'.ucfirst($key);
28 28
 
29 29
             if (method_exists($this, $method)) {
30 30
                 call_user_func([$this, $method], $value);
Please login to merge, or discard this patch.