FML/Script/Features/ScriptFeature.php
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;
    }
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;
    }
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 ; }
Add one or more Script Features to an Array of Features if they are not already contained

@param array $scriptFeatures
@param ScriptFeature||ScriptFeature[] $newScriptFeatures
@return array
Add one or more Script Features to an Array of Features if they are not already contained