public static function newModel(...$text)
    {
        $model = new Model();
        if (2 == \count($text)) {
            if ('' != $text[0]) {
                $model->loadModel($text[0]);
            }
        } elseif (1 == \count($text)) {
            $model->loadModelFromText($text[0]);
        } elseif (0 != \count($text)) {
            throw new CasbinException('Invalid parameters for model.');
        }

        return $model;
    }