function SniffLocalCache::setIfNotCached
1 call to SniffLocalCache::setIfNotCached()
- SniffLocalCache::getAndSetIfNotCached in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ SniffLocalCache.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ SniffLocalCache.php, line 36
Class
- SniffLocalCache
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
private static function setIfNotCached(int $fixerLoops, string $internalKey, Closure $lazyValue) : void {
if (array_key_exists($fixerLoops, self::$cache) && array_key_exists($internalKey, self::$cache[$fixerLoops])) {
return;
}
self::$cache[$fixerLoops][$internalKey] = $lazyValue();
if ($fixerLoops > 0) {
unset(self::$cache[$fixerLoops - 1]);
}
}