Passed
Push — v1 ( fb93bf...b5f651 )
by Andrew
22:46 queued 18:08
created
src/services/AutocompleteService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $this->cacheDuration = 1;
99 99
         }
100 100
         // Invalidate any SectionShorthandFieldsAutocomplete caches whenever any field layout is edited
101
-        Event::on(Fields::class, Fields::EVENT_AFTER_SAVE_FIELD_LAYOUT, function (SectionEvent $e) {
101
+        Event::on(Fields::class, Fields::EVENT_AFTER_SAVE_FIELD_LAYOUT, function(SectionEvent $e) {
102 102
             $this->clearAutocompleteCache(SectionShorthandFieldsAutocomplete::class);
103 103
         });
104 104
     }
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
             $dependency = new TagDependency([
137 137
                 'tags' => [
138 138
                     self::AUTOCOMPLETE_CACHE_TAG,
139
-                    self::AUTOCOMPLETE_CACHE_TAG . $name,
140
-                    self::AUTOCOMPLETE_CACHE_TAG . get_class($autocomplete),
139
+                    self::AUTOCOMPLETE_CACHE_TAG.$name,
140
+                    self::AUTOCOMPLETE_CACHE_TAG.get_class($autocomplete),
141 141
                 ],
142 142
             ]);
143 143
             // Get the autocompletes from the cache, or generate them if they aren't cached
144
-            $autocompleteItems[$name] = $cache->getOrSet($cacheKey, static function () use ($name, $autocomplete) {
144
+            $autocompleteItems[$name] = $cache->getOrSet($cacheKey, static function() use ($name, $autocomplete) {
145 145
                 $autocomplete->generateCompleteItems();
146 146
                 return [
147 147
                     'name' => $name,
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     public function clearAutocompleteCache(string $autocompleteName = ''): void
166 166
     {
167 167
         $cache = Craft::$app->getCache();
168
-        TagDependency::invalidate($cache, self::AUTOCOMPLETE_CACHE_TAG . $autocompleteName);
168
+        TagDependency::invalidate($cache, self::AUTOCOMPLETE_CACHE_TAG.$autocompleteName);
169 169
         Craft::info('Twigfield caches invalidated', __METHOD__);
170 170
     }
171 171
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      */
179 179
     public function getAutocompleteCacheKey(AutocompleteInterface $autocomplete, array $config): string
180 180
     {
181
-        return $this->cacheKeyPrefix . $autocomplete->name . md5(serialize($config));
181
+        return $this->cacheKeyPrefix.$autocomplete->name.md5(serialize($config));
182 182
     }
183 183
 
184 184
     // Protected Methods
Please login to merge, or discard this patch.