Skip to content

Commit ca38551

Browse files
jderussenicolas-grekas
authored andcommitted
[Cache] Fix trigger_error
1 parent bcf8b68 commit ca38551

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Cache/Traits/MemcachedTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ public static function createConnection($servers, array $options = array())
7373
} elseif (!is_array($servers)) {
7474
throw new InvalidArgumentException(sprintf('MemcachedAdapter::createClient() expects array or string as first argument, %s given.', gettype($servers)));
7575
}
76+
if (!static::isSupported()) {
77+
throw new CacheException('Memcached >= 2.2.0 is required');
78+
}
7679
set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); });
7780
try {
78-
if (!static::isSupported()) {
79-
throw new trigger_error('Memcached >= 2.2.0 is required');
80-
}
8181
$options += static::$defaultClientOptions;
8282
$client = new \Memcached($options['persistent_id']);
8383
$username = $options['username'];

0 commit comments

Comments
 (0)