/** * Constructor * * @param var ref either a class name, a ReflectionClass instance or an object */ public function __construct($ref) { if ($ref instanceof \ReflectionClass) { $this->_class = $ref->getName(); } else { if (is_object($ref)) { $this->_class = get_class($ref); } else { $this->_class = (string) $ref; } } parent::__construct(self::nameOf($this->_class), null); }
/** * Constructor * * @param var ref either a class name, a ReflectionClass instance or an object */ public function __construct($ref) { if ($ref instanceof \ReflectionClass) { $this->_class = $ref->getName(); } else { if ($ref instanceof \__PHP_Incomplete_Class) { throw new ClassCastException('Cannot use incomplete classes in reflection'); } else { if (is_object($ref)) { $this->_class = get_class($ref); } else { $this->_class = (string) $ref; } } } parent::__construct(self::nameOf($this->_class), null); }