Test Failed
Push — master ( b5c456...132026 )
by Russell
09:39
created
src/Model/StaticSiteImportDataObject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,11 +100,11 @@
 block discarded – undo
100 100
         $relatedFailedRewriteObjects = DataObject::get(FailedURLRewriteObject::class)->filter('ImportID', $this->ID);
101 101
         $relatedFailedRewriteSummaries = DataObject::get(FailedURLRewriteSummary::class)->filter('ImportID', $this->ID);
102 102
 
103
-        $relatedFailedRewriteObjects->each(function ($item) {
103
+        $relatedFailedRewriteObjects->each(function($item) {
104 104
             $item->delete();
105 105
         });
106 106
 
107
-        $relatedFailedRewriteSummaries->each(function ($item) {
107
+        $relatedFailedRewriteSummaries->each(function($item) {
108 108
             $item->delete();
109 109
         });
110 110
     }
Please login to merge, or discard this patch.
src/Report/FailedURLRewriteReport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
         return [
123 123
             'Title' => [
124 124
                 'title' => 'Imported page',
125
-                'formatting' => function ($value, $item) {
125
+                'formatting' => function($value, $item) {
126 126
                     return sprintf(
127 127
                         '<a href="admin/pages/edit/show/%s">%s</a>',
128 128
                         $item->ContainedInID,
Please login to merge, or discard this patch.
src/Extension/StaticSiteExternalContentAdminExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
         }
82 82
 
83 83
         if ($imports) {
84
-            $imports->each(function ($item) {
84
+            $imports->each(function($item) {
85 85
                 $item->delete();
86 86
             });
87 87
             $messageType = 'good';
Please login to merge, or discard this patch.
src/Extension/StaticSiteDataExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     {
61 61
         parent::onAfterDelete();
62 62
         if ($failedRewriteObjects = DataObject::get(FailedURLRewriteObject::class)->filter('ContainedInID', $this->owner->ID)) {
63
-            $failedRewriteObjects->each(function ($item) {
63
+            $failedRewriteObjects->each(function($item) {
64 64
                 $item->delete();
65 65
             });
66 66
         }
Please login to merge, or discard this patch.
src/Tool/StaticSiteUrlList.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -373,7 +373,7 @@
 block discarded – undo
373 373
         foreach ($this->urls['regular'] as $url => $urlData) {
374 374
             // TODO Log this in exodus.log
375 375
             if (empty($urlData['url'])) {
376
-               // echo $urlData['mime'] . "\n";
376
+                // echo $urlData['mime'] . "\n";
377 377
                 continue;
378 378
             }
379 379
 
Please login to merge, or discard this 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/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/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.