File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ public function getDefaultKeyHashFunction()
268268 */
269269 public function setDefaultKeyHashFunction ($ defaultKeyHashFunction )
270270 {
271- if (!\is_callable ($ defaultKeyHashFunction ) && !\function_exists ($ defaultKeyHashFunction )) {
271+ if (!\is_callable ($ defaultKeyHashFunction ) && ( \is_string ( $ defaultKeyHashFunction ) && !\function_exists ($ defaultKeyHashFunction) )) {
272272 throw new PhpfastcacheInvalidConfigurationException ('defaultKeyHashFunction must be a valid function name string ' );
273273 }
274274 $ this ->defaultKeyHashFunction = $ defaultKeyHashFunction ;
@@ -290,7 +290,7 @@ public function getDefaultFileNameHashFunction()
290290 */
291291 public function setDefaultFileNameHashFunction ($ defaultFileNameHashFunction )
292292 {
293- if (!\function_exists ($ defaultFileNameHashFunction ) || ! \is_callable ($ defaultFileNameHashFunction )) {
293+ if (!\is_callable ($ defaultFileNameHashFunction ) && ( \is_string ( $ defaultFileNameHashFunction ) && ! \function_exists ($ defaultFileNameHashFunction) )) {
294294 throw new PhpfastcacheInvalidConfigurationException ('defaultFileNameHashFunction must be a valid function name string ' );
295295 }
296296 $ this ->defaultFileNameHashFunction = $ defaultFileNameHashFunction ;
Original file line number Diff line number Diff line change 1212
1313chdir (__DIR__ );
1414require_once __DIR__ . '/../vendor/autoload.php ' ;
15- $ testHelper = new TestHelper ('Memcached altyernative configuration syntax ' );
15+ $ testHelper = new TestHelper ('Memcached alternative configuration syntax ' );
1616
1717$ cacheInstanceDefSyntax = CacheManager::getInstance ('Memcached ' );
1818
1919$ cacheInstanceOldSyntax = CacheManager::getInstance ('Memcached ' , new MemcachedConfig ([
2020 'servers ' => [
2121 [
2222 'host ' => '127.0.0.1 ' ,
23- 'path ' => false ,
2423 'port ' => 11211 ,
2524 ]
2625 ]
2726]));
2827
2928$ cacheInstanceNewSyntax = CacheManager::getInstance ('Memcached ' , new MemcachedConfig ([
3029 'host ' => '127.0.0.1 ' ,
31- 'path ' => false ,
3230 'port ' => 11211 ,
3331]));
3432
You can’t perform that action at this time.
0 commit comments