fix many PHP 8.4 compatibility issues
This commit is contained in:
@ -41,7 +41,7 @@ class ActionTrigger extends ScriptFeature
|
||||
* @param Control $control (optional) Action Control
|
||||
* @param string $labelName (optional) Script label name
|
||||
*/
|
||||
public function __construct($actionName = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK)
|
||||
public function __construct($actionName = null, ?Control $control = null, $labelName = ScriptLabel::MOUSECLICK)
|
||||
{
|
||||
if ($actionName) {
|
||||
$this->setActionName($actionName);
|
||||
@ -96,7 +96,7 @@ class ActionTrigger extends ScriptFeature
|
||||
* @param Control $control Action Control
|
||||
* @return static
|
||||
*/
|
||||
public function setControl(Control $control = null)
|
||||
public function setControl(?Control $control = null)
|
||||
{
|
||||
if ($control) {
|
||||
$control->checkId();
|
||||
|
@ -66,7 +66,7 @@ class CheckBoxFeature extends ScriptFeature
|
||||
* @param Entry $entry (optional) Hidden Entry
|
||||
* @param bool $default (optional) Default value
|
||||
*/
|
||||
public function __construct(Quad $quad = null, Entry $entry = null, $default = null)
|
||||
public function __construct(?Quad $quad = null, ?Entry $entry = null, $default = null)
|
||||
{
|
||||
if ($quad) {
|
||||
$this->setQuad($quad);
|
||||
|
@ -41,7 +41,7 @@ class Clock extends ScriptFeature
|
||||
* @param bool $showSeconds (optional) Show the seconds
|
||||
* @param bool $showFullDate (optional) Show the date
|
||||
*/
|
||||
public function __construct(Label $label = null, $showSeconds = true, $showFullDate = false)
|
||||
public function __construct(?Label $label = null, $showSeconds = true, $showFullDate = false)
|
||||
{
|
||||
if ($label) {
|
||||
$this->setLabel($label);
|
||||
|
@ -41,7 +41,7 @@ class ControlScript extends ScriptFeature
|
||||
* @param string $scriptText (optional) Script text
|
||||
* @param string $labelName (optional) Script Label name
|
||||
*/
|
||||
public function __construct(Control $control = null, $scriptText = null, $labelName = ScriptLabel::MOUSECLICK)
|
||||
public function __construct(?Control $control = null, $scriptText = null, $labelName = ScriptLabel::MOUSECLICK)
|
||||
{
|
||||
if ($control) {
|
||||
$this->setControl($control);
|
||||
|
@ -35,7 +35,7 @@ class EntrySubmit extends ScriptFeature
|
||||
* @param Entry $entry (optional) Entry Control
|
||||
* @param string $url (optional) Submit url
|
||||
*/
|
||||
public function __construct(Entry $entry = null, $url = null)
|
||||
public function __construct(?Entry $entry = null, $url = null)
|
||||
{
|
||||
if ($entry) {
|
||||
$this->setEntry($entry);
|
||||
|
@ -54,7 +54,7 @@ class GraphCurve extends ScriptFeature
|
||||
* @param Graph $graph (optional) Graph
|
||||
* @param array[] $points (optional) Points
|
||||
*/
|
||||
public function __construct(Graph $graph = null, array $points = null)
|
||||
public function __construct(?Graph $graph = null, ?array $points = null)
|
||||
{
|
||||
if ($graph) {
|
||||
$this->setGraph($graph);
|
||||
@ -200,7 +200,7 @@ class GraphCurve extends ScriptFeature
|
||||
* @param float[] $color (optional) Color
|
||||
* @return static
|
||||
*/
|
||||
public function setColor(array $color = null)
|
||||
public function setColor(?array $color = null)
|
||||
{
|
||||
$this->color = $color;
|
||||
return $this;
|
||||
|
@ -38,7 +38,7 @@ class GraphSettings extends ScriptFeature
|
||||
* @api
|
||||
* @param Graph $graph (optional) Graph
|
||||
*/
|
||||
public function __construct(Graph $graph = null)
|
||||
public function __construct(?Graph $graph = null)
|
||||
{
|
||||
if ($graph) {
|
||||
$this->setGraph($graph);
|
||||
|
@ -35,7 +35,7 @@ class MapInfo extends ScriptFeature
|
||||
* @param Control $control (optional) Map Info Control
|
||||
* @param string $labelName (optional) Script Label name
|
||||
*/
|
||||
public function __construct(Control $control = null, $labelName = ScriptLabel::MOUSECLICK)
|
||||
public function __construct(?Control $control = null, $labelName = ScriptLabel::MOUSECLICK)
|
||||
{
|
||||
if ($control) {
|
||||
$this->setControl($control);
|
||||
|
@ -40,7 +40,7 @@ class Menu extends ScriptFeature
|
||||
* @param Control $control (optional) Toggled Menu Control
|
||||
* @param bool $isStartElement (optional) Whether the Menu should start with the given Element
|
||||
*/
|
||||
public function __construct(Control $item = null, Control $control = null, $isStartElement = true)
|
||||
public function __construct(?Control $item = null, ?Control $control = null, $isStartElement = true)
|
||||
{
|
||||
if ($item && $control) {
|
||||
$this->addItem($item, $control, $isStartElement);
|
||||
@ -116,7 +116,7 @@ class Menu extends ScriptFeature
|
||||
* @param MenuElement $startElement Start Element
|
||||
* @return static
|
||||
*/
|
||||
public function setStartElement(MenuElement $startElement = null)
|
||||
public function setStartElement(?MenuElement $startElement = null)
|
||||
{
|
||||
$this->startElement = $startElement;
|
||||
if ($startElement && !in_array($startElement, $this->elements, true)) {
|
||||
|
@ -32,7 +32,7 @@ class MenuElement
|
||||
* @param Control $item (optional) Item Control in the Menu bar
|
||||
* @param Control $control (optional) Toggled Menu Control
|
||||
*/
|
||||
public function __construct(Control $item = null, Control $control = null)
|
||||
public function __construct(?Control $item = null, ?Control $control = null)
|
||||
{
|
||||
if ($item) {
|
||||
$this->setItem($item);
|
||||
|
@ -73,7 +73,7 @@ class Paging extends ScriptFeature
|
||||
* @param PagingPage[] $pages (optional) Pages
|
||||
* @param PagingButton[] $buttons (optional) Pageing Buttons
|
||||
*/
|
||||
public function __construct(Label $label = null, array $pages = null, array $buttons = null)
|
||||
public function __construct(?Label $label = null, ?array $pages = null, ?array $buttons = null)
|
||||
{
|
||||
if ($label) {
|
||||
$this->setLabel($label);
|
||||
|
@ -32,7 +32,7 @@ class PagingButton
|
||||
* @param Control $control (optional) Paging Control
|
||||
* @param int $pagingCount (optional) Number of browsed pages per click
|
||||
*/
|
||||
public function __construct(Control $control = null, $pagingCount = 1)
|
||||
public function __construct(?Control $control = null, $pagingCount = 1)
|
||||
{
|
||||
if ($control) {
|
||||
$this->setControl($control);
|
||||
|
@ -31,7 +31,7 @@ class PagingPage
|
||||
* @param Control $control (optional) Page Control
|
||||
* @param int $pageNumber (optional) Number of the Page
|
||||
*/
|
||||
public function __construct(Control $control = null, $pageNumber = null)
|
||||
public function __construct(?Control $control = null, $pageNumber = null)
|
||||
{
|
||||
if ($control) {
|
||||
$this->setControl($control);
|
||||
|
@ -46,7 +46,7 @@ class PlayerProfile extends ScriptFeature
|
||||
* @param Control $control (optional) Profile Control
|
||||
* @param string $labelName (optional) Script Label name
|
||||
*/
|
||||
public function __construct($login = null, Control $control = null, $labelName = ScriptLabel::MOUSECLICK, $titleId = "Trackmania")
|
||||
public function __construct($login = null, ?Control $control = null, $labelName = ScriptLabel::MOUSECLICK, $titleId = "Trackmania")
|
||||
{
|
||||
if ($login) {
|
||||
$this->setLogin($login);
|
||||
|
@ -27,7 +27,7 @@ class Preload extends ScriptFeature
|
||||
* @api
|
||||
* @param string[] $imageUrls (optional) Image urls
|
||||
*/
|
||||
public function __construct(array $imageUrls = null)
|
||||
public function __construct(?array $imageUrls = null)
|
||||
{
|
||||
if ($imageUrls) {
|
||||
$this->setImageUrls($imageUrls);
|
||||
|
@ -40,7 +40,7 @@ class RadioButtonGroupFeature extends ScriptFeature
|
||||
* @api
|
||||
* @param Entry $entry (optional) Hidden Entry
|
||||
*/
|
||||
public function __construct(Entry $entry = null)
|
||||
public function __construct(?Entry $entry = null)
|
||||
{
|
||||
if ($entry) {
|
||||
$this->setEntry($entry);
|
||||
|
@ -54,8 +54,8 @@ class Toggle extends ScriptFeature
|
||||
* @param bool $onlyHide (optional) If it should only hide the Control but not toggle
|
||||
*/
|
||||
public function __construct(
|
||||
Control $togglingControl = null,
|
||||
Control $toggledControl = null,
|
||||
?Control $togglingControl = null,
|
||||
?Control $toggledControl = null,
|
||||
$labelName = ScriptLabel::MOUSECLICK,
|
||||
$onlyShow = false,
|
||||
$onlyHide = false
|
||||
|
@ -54,7 +54,7 @@ class Tooltip extends ScriptFeature
|
||||
* @param bool $invert (optional) If the visibility toggling should be inverted
|
||||
* @param string $text (optional) Text to display if the TooltipControl is a Label
|
||||
*/
|
||||
public function __construct(Control $hoverControl = null, Control $tooltipControl = null, $stayOnClick = null, $invert = null, $text = null)
|
||||
public function __construct(?Control $hoverControl = null, ?Control $tooltipControl = null, $stayOnClick = null, $invert = null, $text = null)
|
||||
{
|
||||
if ($hoverControl) {
|
||||
$this->setHoverControl($hoverControl);
|
||||
|
@ -85,7 +85,7 @@ class UISound extends ScriptFeature
|
||||
* @param int $variant (optional) Sound variant
|
||||
* @param string $labelName (optional) Script Label name
|
||||
*/
|
||||
public function __construct($soundName = null, Control $control = null, $variant = 0, $labelName = ScriptLabel::MOUSECLICK)
|
||||
public function __construct($soundName = null, ?Control $control = null, $variant = 0, $labelName = ScriptLabel::MOUSECLICK)
|
||||
{
|
||||
if ($soundName) {
|
||||
$this->setSoundName($soundName);
|
||||
@ -143,7 +143,7 @@ class UISound extends ScriptFeature
|
||||
* @param Control $control (optional) Sound Control
|
||||
* @return static
|
||||
*/
|
||||
public function setControl(Control $control = null)
|
||||
public function setControl(?Control $control = null)
|
||||
{
|
||||
if ($control) {
|
||||
$control->checkId();
|
||||
|
@ -56,7 +56,7 @@ class ValuePickerFeature extends ScriptFeature
|
||||
* @param string[] $values (optional) Possible values
|
||||
* @param string $default (optional) Default value
|
||||
*/
|
||||
public function __construct(Label $label = null, Entry $entry = null, array $values = null, $default = null)
|
||||
public function __construct(?Label $label = null, ?Entry $entry = null, ?array $values = null, $default = null)
|
||||
{
|
||||
if ($label) {
|
||||
$this->setLabel($label);
|
||||
|
Reference in New Issue
Block a user