Skip to content

Commit

Permalink
BaseControl, ControlGroup::getOption() parameter $default is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 5, 2023
1 parent a2a9c8c commit 9ce94e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Forms/ControlGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/Forms/Controls/BaseControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9ce94e7

Please sign in to comment.