@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->cacheDuration = 1; |
| 99 | 99 | } |
| 100 | 100 | // Invalidate any SectionShorthandFieldsAutocomplete caches whenever any section is edited |
| 101 | - Event::on(Sections::class, Sections::EVENT_AFTER_SAVE_SECTION, function (SectionEvent $e) { |
|
| 101 | + Event::on(Sections::class, Sections::EVENT_AFTER_SAVE_SECTION, function(SectionEvent $e) { |
|
| 102 | 102 | $this->clearAutocompleteCache(SectionShorthandFieldsAutocomplete::class); |
| 103 | 103 | }); |
| 104 | 104 | } |
@@ -136,12 +136,12 @@ discard block |
||
| 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 . $autocomplete::class, |
|
| 139 | + self::AUTOCOMPLETE_CACHE_TAG.$name, |
|
| 140 | + self::AUTOCOMPLETE_CACHE_TAG.$autocomplete::class, |
|
| 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 |
||
| 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 |
||
| 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 |