protected function normalizeModelType($modelType)
    {
        $morphMap = Relation::morphMap();

        if (class_exists($modelType)) {
            $model = new $modelType;
            $modelType = $model->getMorphClass();
        } else {
            if (! isset($morphMap[$modelType])) {
                throw new ModelInvalidException("[$modelType] class and morph map are not found.");
            }

            $modelClass = $morphMap[$modelType];
            $model = new $modelClass;
        }

        if (!$model instanceof RateableContract) {
            throw new ModelInvalidException("[$modelType] not implements Rateable contract.");
        }

        return $modelType;
    }
protected function normalizeModelType($modelType)
    {
        $morphMap = Relation::morphMap();

        if (class_exists($modelType)) {
            $model = new $modelType;
            $modelType = $model->getMorphClass();
        } else {
            if (! isset($morphMap[$modelType])) {
                throw new ModelInvalidException("[$modelType] class and morph map are not found.");
            }

            $modelClass = $morphMap[$modelType];
            $model = new $modelClass;
        }

        if (!$model instanceof RateableContract) {
            throw new ModelInvalidException("[$modelType] not implements Rateable contract.");
        }

        return $modelType;
    }
protected function normalizeModelType ( $ modelType ) { $ morphMap = Relation :: morphMap ( ) ; if ( class_exists ( $ modelType ) ) { $ model = new $ modelType ; $ modelType = $ model -> getMorphClass ( ) ; } else { if ( ! isset ( $ morphMap [ $ modelType ] ) ) { throw new ModelInvalidException ( "[$modelType] class and morph map are not found." ) ; } $ modelClass = $ morphMap [ $ modelType ] ; $ model = new $ modelClass ; } if ( ! $ model instanceof RateableContract ) { throw new ModelInvalidException ( "[$modelType] not implements Rateable contract." ) ; } return $ modelType ; }
Normalize rateable model type.

@param string $modelType
@return string

@throws \InetStudio\Rating\Exceptions\ModelInvalidException
Normalize rateable model type .