Passed
Push — master ( 5dd2e7...8f9b97 )
by Nicolaas
04:20
created
src/Extensions/PageControllerExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             if ($owner->hasMethod('canCachePage')) {
51 51
                 // if it can cache the page, then it the cache string will remain empty.
52 52
                 $canCache = $owner->canCachePage();
53
-                self::$_can_cache_content_string .=  $canCache ? '' : $this->getRandomKey();
53
+                self::$_can_cache_content_string .= $canCache ? '' : $this->getRandomKey();
54 54
             }
55 55
 
56 56
             //action
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             if ($requestVars) {
77 77
                 $canCache = false;
78 78
                 foreach ($requestVars  as $key => $item) {
79
-                    if (! $item) {
79
+                    if (!$item) {
80 80
                         $item = '';
81 81
                     }
82 82
                     self::$_can_cache_content_string .= serialize($key . '_' . serialize($item));
Please login to merge, or discard this patch.
src/Extensions/DataObjectExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
         // NB.
22 22
         // if the dataobject has the versioned extension then the cache should be invalidated onAfterPublish
23 23
         // hasStages function is part of the Versioned class so safe to check here
24
-        if (! $owner->hasExtension(Versioned::class)) {
24
+        if (!$owner->hasExtension(Versioned::class)) {
25 25
             $this->doUpdateCache();
26
-        } elseif (! $owner->hasStages()) {
26
+        } elseif (!$owner->hasStages()) {
27 27
             $this->doUpdateCache();
28 28
         }
29 29
     }
@@ -94,6 +94,6 @@  discard block
 block discarded – undo
94 94
         }
95 95
         $excludedClasses = (array) Config::inst()->get(DataObjectExtension::class, 'excluded_classes_for_caching');
96 96
 
97
-        return ! in_array($className, $excludedClasses, true);
97
+        return !in_array($className, $excludedClasses, true);
98 98
     }
99 99
 }
Please login to merge, or discard this patch.
src/Extensions/PageExtension.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 ),
37 37
             ]
38 38
         );
39
-        if (! (bool) $owner->NeverCachePublicly) {
39
+        if (!(bool) $owner->NeverCachePublicly) {
40 40
             $fields->addFieldsToTab(
41 41
                 'Root.Cache',
42 42
                 [
@@ -105,7 +105,6 @@  discard block
 block discarded – undo
105 105
     public function PageCanBeCachedEntirelyDuration(): int
106 106
     {
107 107
         return (int) (
108
-            $this->getOwner()->PublicCacheDurationInSeconds ?:
109
-            SiteConfig::current_site_config()->PublicCacheDurationInSeconds);
108
+            $this->getOwner()->PublicCacheDurationInSeconds ?: SiteConfig::current_site_config()->PublicCacheDurationInSeconds);
110 109
     }
111 110
 }
Please login to merge, or discard this patch.
src/Model/ObjectsUpdated.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@
 block discarded – undo
24 24
             ORDER BY "ClassNameLastEdited" ASC
25 25
         ');
26 26
         foreach ($query as $row) {
27
-            $array[$row['ClassNameLastEdited']] =
28
-                Injector::inst()->get($row['ClassNameLastEdited'])->i18n_singular_name() .
29
-                ' (×' . $row['Count'] . ')';
30
-            if ($myClass && $myClass === $row['ClassNameLastEdited']) {
31
-                return $row['Count'];
27
+            $array[ $row[ 'ClassNameLastEdited' ] ] =
28
+                Injector::inst()->get($row[ 'ClassNameLastEdited' ])->i18n_singular_name() .
29
+                ' (×' . $row[ 'Count' ] . ')';
30
+            if ($myClass && $myClass === $row[ 'ClassNameLastEdited' ]) {
31
+                return $row[ 'Count' ];
32 32
             }
33 33
         }
34 34
         return '<br />' . implode('<br> ', $array);
Please login to merge, or discard this patch.
src/Extensions/SimpleTemplateCachingSiteConfigExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 ;');
197 197
                 if ($obj->RecordCacheUpdates) {
198 198
                     $recordId = Injector::inst()
199
-                        ->create(ObjectsUpdated::class, ['ClassNameLastEdited' => $className])
199
+                        ->create(ObjectsUpdated::class, [ 'ClassNameLastEdited' => $className ])
200 200
                         ->write();
201 201
                     DB::query('DELETE FROM "ObjectsUpdated" WHERE "ID" < ' . (int) ($recordId - self::MAX_OBJECTS_UPDATED));
202 202
                 }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 'CSS_JS_CACHE_DIRECTIVE' => $currentSiteConfig->config()->get('css_and_js_cache_directive'),
231 231
             ] as $key => $value
232 232
         ) {
233
-            if (! $currentSiteConfig->HasResourceCaching) {
233
+            if (!$currentSiteConfig->HasResourceCaching) {
234 234
                 $value = '';
235 235
             }
236 236
             $this->updateHtaccess($key, $value);
Please login to merge, or discard this patch.
src/Extensions/ControllerExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             if (!$dataRecord instanceof Page) {
34 34
                 return $this->returnNoCache();
35 35
             }
36
-            if ( $dataRecord->PageCanBeCachedEntirely() !== true) {
36
+            if ($dataRecord->PageCanBeCachedEntirely() !== true) {
37 37
                 return $this->returnNoCache();
38 38
             }
39 39
             if (Security::getCurrentUser()) {
Please login to merge, or discard this patch.