FML/Script/Script.php
public function addScriptFunction($name, $text = null)
    {
        if ($name instanceof ScriptFunction) {
            $scriptFunction = $name;
        } else {
            $scriptFunction = new ScriptFunction($name, $text);
        }
        if (!in_array($scriptFunction, $this->functions)) {
            array_push($this->functions, $scriptFunction);
        }
        return $this;
    }
public function addScriptFunction($name, $text = null)
    {
        if ($name instanceof ScriptFunction) {
            $scriptFunction = $name;
        } else {
            $scriptFunction = new ScriptFunction($name, $text);
        }
        if (!in_array($scriptFunction, $this->functions)) {
            array_push($this->functions, $scriptFunction);
        }
        return $this;
    }
public function addScriptFunction ( $ name , $ text = null ) { if ( $ name instanceof ScriptFunction ) { $ scriptFunction = $ name ; } else { $ scriptFunction = new ScriptFunction ( $ name , $ text ) ; } if ( ! in_array ( $ scriptFunction , $ this -> functions ) ) { array_push ( $ this -> functions , $ scriptFunction ) ; } return $ this ; }
Add a Script Function

@api
@param string|ScriptFunction $name Function name or ScriptFunction
@param string                $text Function text
@return static
Add a Script Function