<?php
if (is_object($in)) {
$class = get_class($in);
if ($class !== $this->type) {
$reflection = new ReflectionClass($class);
return $reflection->isSubclassOf($this->type) ||
$reflection->implementsInterface($this->type);
}
return true;
}
return gettype($in) === $this->type;