public function getUserAgentObject($userAgent = null)
    {
        if (!$userAgent) {
            $userAgent = $this->getUserAgentByRequest();
        }
        $objectData = ArrayHelper::merge(
            ['class' => 'yii\useragentparser\UserAgentObject','userAgent'=>$userAgent],
            $this->parseUserAgent($userAgent)
        );

        return Yii::createObject($objectData);
    }