@@ -41,7 +41,7 @@ |
||
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'); |
@@ -336,7 +336,7 @@ |
||
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)) { |
@@ -618,12 +618,11 @@ |
||
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, |
@@ -91,7 +91,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -170,7 +170,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | /** |
@@ -98,7 +98,7 @@ |
||
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'] |
@@ -44,7 +44,7 @@ |
||
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 | /** |