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 Jan 30, 2024
1 parent a271230 commit 6e0ece8
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 @@ -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;
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 @@ -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;
Expand Down

0 comments on commit 6e0ece8

Please sign in to comment.