private function ensureIsValidMatcherClass($class)
{
if (!class_exists($class)) {
throw new InvalidConfigurationException(sprintf('Custom matcher %s does not exist.', $class));
}
if (!is_subclass_of($class, Matcher::class)) {
throw new InvalidConfigurationException(sprintf('Custom matcher %s must implement %s interface, but it does not.', $class, Matcher::class));
}
}