Test Failed
Push — master ( cd1027...b5c456 )
by Russell
04:10
created
src/Tool/StaticSiteUtils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      * @param StaticSiteCrawler $crawler (Warning: Pass by reference)
42 42
      * @return array Returns an array of the config options in a format consumable by curl.
43 43
      */
44
-    public function defineProxyOpts(bool $set, StaticSiteCrawler &$crawler = null): array
44
+    public function defineProxyOpts(bool $set, StaticSiteCrawler & $crawler = null): array
45 45
     {
46 46
         if ($set && is_bool($set) && $set !== false) {
47 47
             $proxyOpts = StaticSiteContentExtractor::config()->get('curl_opts_proxy');
Please login to merge, or discard this patch.
src/Tool/StaticSiteContentExtractor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@
 block discarded – undo
336 336
         // Run request
337 337
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
338 338
         // See: http://forums.devshed.com/php-development-5/curlopt-timeout-option-for-curl-calls-isn-t-being-obeyed-605642.html
339
-        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);     // No. seconds to wait while trying to connect.
339
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // No. seconds to wait while trying to connect.
340 340
 
341 341
         // Deal to files, write to them directly and then return
342 342
         if ($this->mimeProcessor->isOfFileOrImage($this->mime)) {
Please login to merge, or discard this patch.
src/Tool/StaticSiteUrlList.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -618,12 +618,11 @@
 block discarded – undo
618 618
              */
619 619
             $sng = singleton(StaticSiteMimeProcessor::class);
620 620
             $mime = $sng->IsOfHtml($processedURLData['mime']) ?
621
-                $processedURLData['mime'] :
622
-                self::$undefined_mime_type;
621
+                $processedURLData['mime'] : self::$undefined_mime_type;
623 622
             $processedURL = $processedURLData['url'];
624 623
         }
625 624
 
626
-        $default = function ($fragment) use ($mime) {
625
+        $default = function($fragment) use ($mime) {
627 626
             return [
628 627
                 'url' => $fragment,
629 628
                 'mime' => $mime,
Please login to merge, or discard this patch.
src/Tool/StaticSiteMimeProcessor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         array_push($mimes['file'], 'text/plain');
92 92
 
93 93
         // Included in Silverstripe's file-based Mime-Types which we don't want
94
-        $mimes['file'] = array_filter($mimes['file'], function ($k, $v) {
94
+        $mimes['file'] = array_filter($mimes['file'], function($k, $v) {
95 95
             return stristr($k, 'htm') ? false : true;
96 96
         }, ARRAY_FILTER_USE_BOTH);
97 97
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $mimeCategories = File::config()->get('app_categories');
174 174
         list($ext, $mime) = [strtolower($ext), strtolower($mime)];
175 175
 
176
-        $notAuthoratative = !isset($httpMimeTypes[$ext]);                   // We've found ourselves a weird extension
176
+        $notAuthoratative = !isset($httpMimeTypes[$ext]); // We've found ourselves a weird extension
177 177
         $notMatch = (!$notAuthoratative && $httpMimeTypes[$ext] !== $mime); // No match found for passed extension in our ext=>mime mapping from config
178 178
 
179 179
         if ($notAuthoratative || $notMatch) {
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
             $coreExts = array_merge($mimeCategories['document'], $mimeCategories['image']);
186 186
             foreach ($coreExts as $coreExt) {
187 187
                 // Make sure we check the correct category so we don't find a match for ms-excel in the image \File category (.cel) !!
188
-                $isFile = in_array($coreExt, $mimeCategories['document']) && singleton(__CLASS__)->isOfFile($mime);     // dirty
189
-                $isImge = in_array($coreExt, $mimeCategories['image']) && singleton(__CLASS__)->isOfImage($mime);   // more dirt
188
+                $isFile = in_array($coreExt, $mimeCategories['document']) && singleton(__CLASS__)->isOfFile($mime); // dirty
189
+                $isImge = in_array($coreExt, $mimeCategories['image']) && singleton(__CLASS__)->isOfImage($mime); // more dirt
190 190
 
191 191
                 if (($isFile || $isImge) && stristr($mime, $coreExt) !== false) {
192 192
                     // "Manually" force "jpg" as the file-suffix to be returned
Please login to merge, or discard this patch.
src/Task/StaticSiteRewriteLinksTask.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         $task = $this;
172 172
         // Callback for URL rewriter, called from StaticSiteLinkRewriter and passed through $callback($url)
173
-        $rewriter = StaticSiteLinkRewriter::create(function ($url) use ($pageLookup, $fileLookup, $task) {
173
+        $rewriter = StaticSiteLinkRewriter::create(function($url) use ($pageLookup, $fileLookup, $task) {
174 174
             $origUrl = $url;
175 175
             $anchor = '';
176 176
 
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     public function linkIsThirdParty($link)
422 422
     {
423 423
         $link = trim($link);
424
-        return (bool)preg_match("#^http(s)?://#", $link);
424
+        return (bool) preg_match("#^http(s)?://#", $link);
425 425
     }
426 426
 
427 427
     /**
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $nonHTTPSchemes = implode('|', self::$non_http_uri_schemes);
436 436
         $badScheme = preg_match("#^($nonHTTPSchemes):#", $link);
437 437
         $alreadyImported = $this->linkIsAlreadyRewritten($link);
438
-        return (bool)($badScheme || $alreadyImported);
438
+        return (bool) ($badScheme || $alreadyImported);
439 439
     }
440 440
 
441 441
     /**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      */
447 447
     public function linkIsNotImported($link)
448 448
     {
449
-        return (bool)(stristr($link, 'sitetree') === false && stristr($link, 'assets') === false);
449
+        return (bool) (stristr($link, 'sitetree') === false && stristr($link, 'assets') === false);
450 450
     }
451 451
 
452 452
     /**
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      */
458 458
     public function linkIsAlreadyRewritten($link)
459 459
     {
460
-        return (bool)(stristr($link, 'sitetree') !== false || stristr($link, 'assets') !== false);
460
+        return (bool) (stristr($link, 'sitetree') !== false || stristr($link, 'assets') !== false);
461 461
     }
462 462
 
463 463
     /**
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
      */
469 469
     public function linkIsJunk($link)
470 470
     {
471
-        return (bool)preg_match("#^[^\[\/a-zA-Z\d].+#", $link);
471
+        return (bool) preg_match("#^[^\[\/a-zA-Z\d].+#", $link);
472 472
     }
473 473
 
474 474
     /**
Please login to merge, or discard this patch.
src/Model/StaticSiteContentSourceImportRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
             foreach (
99 99
                 array_merge(
100 100
                     array_keys(DataObject::config()->get('fixed_fields')),
101
-                    array_filter($fieldList, function ($item) {
101
+                    array_filter($fieldList, function($item) {
102 102
                         return preg_match('#(^Static|ID$)#i', $item);
103 103
                     }),
104 104
                     ['Version']
Please login to merge, or discard this patch.
src/Model/StaticSiteContentSourceImportSchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         "Order" => DBInt::class,
45 45
         "AppliesTo" => DBVarchar::class,
46 46
         "MimeTypes" => DBText::class,
47
-        "Notes" => DBText::class,   // Purely informational. Not used in imports.
47
+        "Notes" => DBText::class, // Purely informational. Not used in imports.
48 48
     ];
49 49
 
50 50
     /**
Please login to merge, or discard this patch.