protected function getMatcher($spec)
{
if (is_string($spec) && false !== strpos($spec, '::')) {
list($type, $method) = explode('::', $spec, 2);
return new MethodMatcher($type, $method);
}
if (!is_array($spec) || empty($spec[0]) || empty($spec[1]) || !is_string($spec[1])) {
return null;
}
if (is_object($spec[0])) {
$spec[0] = get_class($spec[0]);
}
if (!is_string($spec[0])) {
return null;
}
return new MethodMatcher($spec[0], $spec[1]);
}