public function type(string $classType)
    {
        $baseType = $this->class ? $this->class->getClassName() : TypedObject::class;
        if (!is_a($classType, $baseType, true)) {
            throw InvalidArgumentException::format(
                'Invalid call to %s: class type must be an subclass of %s, %s given',
                __METHOD__, $baseType, $classType
            );
        }

        /** @var TypedObject $classType */
        $this->class = $classType::definition();
    }
public function type(string $classType)
    {
        $baseType = $this->class ? $this->class->getClassName() : TypedObject::class;
        if (!is_a($classType, $baseType, true)) {
            throw InvalidArgumentException::format(
                'Invalid call to %s: class type must be an subclass of %s, %s given',
                __METHOD__, $baseType, $classType
            );
        }

        /** @var TypedObject $classType */
        $this->class = $classType::definition();
    }
public function type ( string $ classType ) { $ baseType = $ this -> class ? $ this -> class -> getClassName ( ) : TypedObject :: class ; if ( ! is_a ( $ classType , $ baseType , true ) ) { throw InvalidArgumentException :: format ( 'Invalid call to %s: class type must be an subclass of %s, %s given' , __METHOD__ , $ baseType , $ classType ) ; } /** @var TypedObject $classType */ $ this -> class = $ classType :: definition ( ) ; }
Defines the type of mapped class.

@param string $classType

@return void
@throws InvalidArgumentException
Defines the type of mapped class .