Skip to content

Commit 8a77cd0

Browse files
committed
Fixed ambiguous $badPracticeOmeter counter
1 parent 836db3c commit 8a77cd0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/phpFastCache/CacheManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,13 @@ public static function getInstance($driver = 'auto', array $config = [])
216216
throw new phpFastCacheDriverCheckException($e->getMessage(), $e->getCode(), $e);
217217
}
218218
}
219-
} else if(++$badPracticeOmeter[$driver] >= 5){
219+
} else if($badPracticeOmeter[$driver] >= 5){
220220
trigger_error('[' . $driver . '] Calling many times CacheManager::getInstance() for already instanced drivers is a bad practice and have a significant impact on performances.
221221
See https://github.com/PHPSocialNetwork/phpfastcache/wiki/[V5]-Why-calling-getInstance%28%29-each-time-is-a-bad-practice-%3F');
222222
}
223223

224+
$badPracticeOmeter[$driver]++;
225+
224226
return self::$instances[ $instance ];
225227
}
226228

0 commit comments

Comments
 (0)