public function _matcher($matcherName, $actual)
{
if (!Matcher::exists($matcherName, true)) {
throw new Exception("Unexisting matcher attached to `'{$matcherName}'`.");
}
$matcher = null;
foreach (Matcher::get($matcherName, true) as $target => $value) {
if (!$target) {
$matcher = $value;
continue;
}
if ($actual instanceof $target) {
$matcher = $value;
}
}
if (!$matcher) {
throw new Exception("Unexisting matcher attached to `'{$matcherName}'` for `{$target}`.");
}
return $matcher;
}