Skip to content

Commit bbf86fe

Browse files
committed
Fixed broken build...
1 parent 7f86ce4 commit bbf86fe

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/Phpfastcache/Config/ConfigurationOption.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

tests/MemcachedAlternativeConfigurationSynax.test.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@
1212

1313
chdir(__DIR__);
1414
require_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

0 commit comments

Comments
 (0)