public static function addScriptFeature(array $scriptFeatures, $newScriptFeatures)
    {
        if (!$newScriptFeatures) {
            return $scriptFeatures;
        }
        if ($newScriptFeatures instanceof ScriptFeature) {
            if (!in_array($newScriptFeatures, $scriptFeatures, true)) {
                array_push($scriptFeatures, $newScriptFeatures);
            }
        } else if (is_array($newScriptFeatures)) {
            foreach ($newScriptFeatures as $newScriptFeature) {
                $scriptFeatures = static::addScriptFeature($scriptFeatures, $newScriptFeature);
            }
        }
        return $scriptFeatures;
    }