mirror of
https://github.com/predis/predis.git
synced 2026-09-15 21:07:08 +00:00
Check values passed to PreprocessorChain::offsetSet().
This commit is contained in:
@@ -47,6 +47,12 @@ class PreprocessorChain implements ICommandPreprocessorChain, \ArrayAccess {
|
||||
}
|
||||
|
||||
public function offsetSet($index, $preprocessor) {
|
||||
if (!$preprocessor instanceof ICommandPreprocessor) {
|
||||
throw new \InvalidArgumentException(
|
||||
'A preprocessor chain can hold only instances of classes implementing '.
|
||||
'the Predis\Commands\Preprocessors\ICommandPreprocessor interface'
|
||||
);
|
||||
}
|
||||
$this->_preprocessors[$index] = $preprocessor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user