From db83ca812f706d2851729f2cb1e4ee742ec52311 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 21 Jun 2022 15:21:19 +0200 Subject: [PATCH] BaseControl, ControlGroup::getOption() parameter $default is deprecated --- src/Forms/ControlGroup.php | 1 + src/Forms/Controls/BaseControl.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Forms/ControlGroup.php b/src/Forms/ControlGroup.php index b7949cc38..974e862d0 100644 --- a/src/Forms/ControlGroup.php +++ b/src/Forms/ControlGroup.php @@ -105,6 +105,7 @@ public function setOption(string $key, mixed $value): static public function getOption(string $key): mixed { if (func_num_args() > 1) { + trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED); $default = func_get_arg(1); } return $this->options[$key] ?? $default ?? null; diff --git a/src/Forms/Controls/BaseControl.php b/src/Forms/Controls/BaseControl.php index e1149e996..6b52ed247 100644 --- a/src/Forms/Controls/BaseControl.php +++ b/src/Forms/Controls/BaseControl.php @@ -536,6 +536,7 @@ public function setOption($key, mixed $value): static public function getOption($key): mixed { if (func_num_args() > 1) { + trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED); $default = func_get_arg(1); } return $this->options[$key] ?? $default ?? null;