From 9ce94e744b865f2f3e2eff1b66a6a1c6c16b7687 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 0ce6c5db6..b78821caa 100644 --- a/src/Forms/ControlGroup.php +++ b/src/Forms/ControlGroup.php @@ -106,6 +106,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 1171fc69d..827f85a11 100644 --- a/src/Forms/Controls/BaseControl.php +++ b/src/Forms/Controls/BaseControl.php @@ -543,6 +543,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;