FML/Script/Script.php
public function addCustomScriptLabel($name, $text = null)
    {
        if ($name instanceof ScriptLabel) {
            $scriptLabel = $name;
        } else {
            $scriptLabel = new ScriptLabel($name, $text);
        }
        if (!in_array($scriptLabel, $this->customLabels)) {
            array_push($this->customLabels, $scriptLabel);
        }
        return $this;
    }
public function addCustomScriptLabel($name, $text = null)
    {
        if ($name instanceof ScriptLabel) {
            $scriptLabel = $name;
        } else {
            $scriptLabel = new ScriptLabel($name, $text);
        }
        if (!in_array($scriptLabel, $this->customLabels)) {
            array_push($this->customLabels, $scriptLabel);
        }
        return $this;
    }
public function addCustomScriptLabel ( $ name , $ text = null ) { if ( $ name instanceof ScriptLabel ) { $ scriptLabel = $ name ; } else { $ scriptLabel = new ScriptLabel ( $ name , $ text ) ; } if ( ! in_array ( $ scriptLabel , $ this -> customLabels ) ) { array_push ( $ this -> customLabels , $ scriptLabel ) ; } return $ this ; }
Add a custom Script text

@api
@param string|ScriptLabel $name Label name or ScriptLabel
@param string             $text Script text
@return static
Add a custom Script text