Passed
Push — master ( 88dde3...10fdf9 )
by Nicolaas
10:12
created
src/Extensions/DataObjectExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
         // NB.
20 20
         // if the dataobject has the versioned extension then the cache should be invalidated onAfterPublish
21 21
         // hasStages function is part of the Versioned class so safe to check here
22
-        if (! $owner->hasExtension(Versioned::class)) {
22
+        if (!$owner->hasExtension(Versioned::class)) {
23 23
             $this->doUpdateCache($className);
24
-        } elseif (! $owner->hasStages()) {
24
+        } elseif (!$owner->hasStages()) {
25 25
             $this->doUpdateCache($className);
26 26
         }
27 27
     }
@@ -93,6 +93,6 @@  discard block
 block discarded – undo
93 93
         }
94 94
         $excludedClasses = (array) Config::inst()->get(self::class, 'excluded_classes_for_caching');
95 95
 
96
-        return ! in_array($className, $excludedClasses, true);
96
+        return !in_array($className, $excludedClasses, true);
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
src/Extensions/SimpleTemplateCachingSiteConfigExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public static function update_cache_key(?string $className = '')
81 81
     {
82 82
         // important - avoid endless loop!
83
-        if(SiteConfig::get()->exists()) {
83
+        if (SiteConfig::get()->exists()) {
84 84
             $howOldIsIt = DB::query('SELECT Created FROM SiteConfig LIMIT 1')->value();
85 85
             if ($howOldIsIt && strtotime((string) $howOldIsIt) > strtotime('-5 minutes')) {
86 86
                 return;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         }
103 103
         if ($obj->RecordCacheUpdates) {
104 104
             $recordId = Injector::inst()
105
-                ->create(ObjectsUpdated::class, ['ClassNameLastEdited' => $className])
105
+                ->create(ObjectsUpdated::class, [ 'ClassNameLastEdited' => $className ])
106 106
                 ->write()
107 107
             ;
108 108
             DB::query('DELETE FROM ObjectsUpdated WHERE ID < ' . (int) ($recordId - self::MAX_OBJECTS_UPDATED));
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 
112 112
     public function requireDefaultRecords()
113 113
     {
114
-        if((int) SiteConfig::get()->count() > 100) {
114
+        if ((int) SiteConfig::get()->count() > 100) {
115 115
             $currentSiteConfig = SiteConfig::current_site_config();
116
-            if($currentSiteConfig) {
116
+            if ($currentSiteConfig) {
117 117
                 DB::alteration_message('Deleting all SiteConfig records except for the current one.', 'deleted');
118 118
                 DB::query('DELETE FROM "SiteConfig" WHERE ID <> ' . $currentSiteConfig->ID);
119 119
             }
Please login to merge, or discard this patch.