From 439477762b33dfd7ba4c767b98e45b7394ef933e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 11:19:41 +0000 Subject: [PATCH] Form rules: declare the nullable parameters as nullable PHP 8.4 deprecates parameters with a type which default to null without being declared nullable ("Implicitly marking parameter $input as nullable is deprecated"). The six form rules declared Registry $input = null, Form $form = null; they now have ?Registry and ?Form, as Joomla's own FormRule::test() has in Joomla 5 and 6. These were the six deprecations the plugin's tests report on Joomla 6 with PHP 8.4. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AFJFMMUpch4LGexEiXN8Nc --- admin/rules/date.php | 2 +- admin/rules/emaillist.php | 2 +- admin/rules/geodbpath.php | 2 +- admin/rules/htaccesspath.php | 2 +- admin/rules/iprange.php | 2 +- admin/rules/iprangeblock.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/rules/date.php b/admin/rules/date.php index 1c196f8..fdf7d46 100644 --- a/admin/rules/date.php +++ b/admin/rules/date.php @@ -13,7 +13,7 @@ class JFormRuleDate extends FormRule { - public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { if ($value === '' || $value === null) { diff --git a/admin/rules/emaillist.php b/admin/rules/emaillist.php index f1d7aed..62923ec 100644 --- a/admin/rules/emaillist.php +++ b/admin/rules/emaillist.php @@ -19,7 +19,7 @@ */ class JFormRuleEmaillist extends FormRule { - public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = trim((string) $value); if ($value === '') diff --git a/admin/rules/geodbpath.php b/admin/rules/geodbpath.php index f8d015d..5acfc25 100644 --- a/admin/rules/geodbpath.php +++ b/admin/rules/geodbpath.php @@ -14,7 +14,7 @@ class JFormRuleGeodbpath extends FormRule { - public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = (string) $value; if ($value === '') diff --git a/admin/rules/htaccesspath.php b/admin/rules/htaccesspath.php index 93dc188..eb1b1e1 100644 --- a/admin/rules/htaccesspath.php +++ b/admin/rules/htaccesspath.php @@ -14,7 +14,7 @@ class JFormRuleHtaccesspath extends FormRule { - public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = (string) $value; if ($value === '') diff --git a/admin/rules/iprange.php b/admin/rules/iprange.php index 256ea36..6a7524c 100644 --- a/admin/rules/iprange.php +++ b/admin/rules/iprange.php @@ -14,7 +14,7 @@ class JFormRuleIprange extends FormRule { - public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { return IpValidateHelper::validIPRange($value); } diff --git a/admin/rules/iprangeblock.php b/admin/rules/iprangeblock.php index 5942d8c..4803942 100644 --- a/admin/rules/iprangeblock.php +++ b/admin/rules/iprangeblock.php @@ -14,7 +14,7 @@ class JFormRuleIprangeblock extends FormRule { - public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { return (IpValidateHelper::validIPRange($value) && !IpValidateHelper::matchesCurrentIP($value)); }