__METHOD__]); } } protected function parseDef(array $__def) { try { $r = parent::parseDef($__def); foreach($r as $k => &$v) { $v = ltrim($v, '\\'); if(FALSE === class_exists($v) && FALSE === interface_exists($v)) throw new ClassOrInterfaceNotFoundException(new ArgumentExpectedException([ 'target' => $this->getName().'['.$k.']', 'expected' => 'class|interface', 'detected' => $t = getType($v), 'value' => is_object($v) ? get_class($v) : ((is_string($v) && (class_exists($v) || interface_exists($v))) || is_scalar($v)) ? $v : $t ]), ['name' => $v]); } if([] === $r) throw new ArgumentLengthZeroException; return $r; } catch(\Exception $E) { throw new ComponentMethodCallException($E, ComponentMethodCallException::ERROR_PARSE_DEF, ['method' => __METHOD__]); } } public function validate($__value) { try { $v = &$__value; $t = getType($v); foreach($this->getGC() as $h) { if(__const_Type::SPL_OBJECT === $t && (class_exists($h) || interface_exists($h)) && (is_subclass_of($v, $h) || $v instanceOf $h)) return TRUE; } return FALSE; } catch(\Exception $E) { throw new ComponentMethodCallException($E, ComponentMethodCallException::ERROR_VALIDATE, ['method' => __METHOD__]); } } } set(new bar); var_dump($d); $d = (new ADV('root\bar'))->set(new baz); var_dump($d); /* object(ILLI\Core\Std\Def\ADV)#6 (1) { ["__data":protected]=> object(root\bar)#10 (0) { } } CHADDR 000000001371a8330000000009eeb411:000000001371a8300000000009eeb411 ECADDR 501:500 RVADDR OUTER 000000001371a8300000000009eeb411: [UNSOLVED] Method Error in ILLI\Core\Std\Def\ADV::set(). FIRED 000000001371a8330000000009eeb411: [UNSOLVED] Expected type ILLI\Core\Std\Def\ADV: root\baz given.