From 9d3500fc20d71361067308ee0aa055a2408225b9 Mon Sep 17 00:00:00 2001 From: "steven.lewis" Date: Thu, 10 Oct 2024 10:00:56 +0100 Subject: [PATCH 1/2] Compatability with php 8.4 (Deprecate implicitly nullable parameter types) https://wiki.php.net/rfc/deprecate-implicitly-nullable-types --- composer.json | 2 +- src/Template/Func.php | 2 +- src/Template/Template.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 98451032..307d4f03 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } ], "require" : { - "php": "^7.0|^8.0" + "php": "^7.1|^8.0" }, "require-dev": { "mikey179/vfsstream": "^1.6", diff --git a/src/Template/Func.php b/src/Template/Func.php index 79141f46..3d6685cb 100644 --- a/src/Template/Func.php +++ b/src/Template/Func.php @@ -93,7 +93,7 @@ public function getCallback() * @param array $arguments * @return mixed */ - public function call(Template $template = null, $arguments = array()) + public function call(?Template $template = null, $arguments = array()) { if (is_array($this->callback) and isset($this->callback[0]) and diff --git a/src/Template/Template.php b/src/Template/Template.php index db11a9f1..28ad1b00 100644 --- a/src/Template/Template.php +++ b/src/Template/Template.php @@ -112,7 +112,7 @@ public function __toString() * @param array $data * @return mixed */ - public function data(array $data = null) + public function data(?array $data = null) { if (is_null($data)) { return $this->data; From d906ab0ea0c18358ed84b190aaa7cb835696d203 Mon Sep 17 00:00:00 2001 From: "steven.lewis" Date: Thu, 10 Oct 2024 10:06:42 +0100 Subject: [PATCH 2/2] Compatability with php 8.4 (Deprecate implicitly nullable parameter types) https://wiki.php.net/rfc/deprecate-implicitly-nullable-types --- src/Template/Func.php | 4 ++-- src/Template/Template.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Template/Func.php b/src/Template/Func.php index 3d6685cb..5ff50936 100644 --- a/src/Template/Func.php +++ b/src/Template/Func.php @@ -89,8 +89,8 @@ public function getCallback() /** * Call the function. - * @param Template $template - * @param array $arguments + * @param Template|null $template + * @param array $arguments * @return mixed */ public function call(?Template $template = null, $arguments = array()) diff --git a/src/Template/Template.php b/src/Template/Template.php index 28ad1b00..5473c9e0 100644 --- a/src/Template/Template.php +++ b/src/Template/Template.php @@ -109,8 +109,8 @@ public function __toString() /** * Assign or get template data. - * @param array $data - * @return mixed + * @param array|null $data + * @return array|void */ public function data(?array $data = null) {