From 213e11054ea15d8af90e2c80cfda1a82fc535697 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 27 Nov 2023 21:34:56 +0100 Subject: [PATCH] try to fix an error on callable --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- dcstore.xml | 4 ++-- src/UrlDescriptor.php | 8 +++++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faeeabb..49d7c1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +myUrlHandlers 2023.11.27 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Try to fix an error on callable + myUrlHandlers 2023.10.23 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index aa3bede..422c674 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # README -[![Release](https://img.shields.io/badge/release-2023.10.23-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/myUrlHandlers/releases) -![Date](https://img.shields.io/badge/date-2023.10.23-c44d58.svg) +[![Release](https://img.shields.io/badge/release-2023.11.27-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/myUrlHandlers/releases) +![Date](https://img.shields.io/badge/date-2023.11.27-c44d58.svg) [![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/myUrlHandlers) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/myUrlHandlers/src/branch/master/LICENSE) diff --git a/dcstore.xml b/dcstore.xml index ed0862d..ae56912 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ URL handlers - 2023.10.23 + 2023.11.27 Alex Pirine and contributors Change Dotclear URL handlers - https://git.dotclear.watch/JcDenis/myUrlHandlers/releases/download/v2023.10.23/plugin-myUrlHandlers.zip + https://git.dotclear.watch/JcDenis/myUrlHandlers/releases/download/v2023.11.27/plugin-myUrlHandlers.zip 2.28 https://git.dotclear.watch/JcDenis/myUrlHandlers/src/branch/master/README.md https://git.dotclear.watch/JcDenis/myUrlHandlers/issues diff --git a/src/UrlDescriptor.php b/src/UrlDescriptor.php index 31edc94..3e2803e 100644 --- a/src/UrlDescriptor.php +++ b/src/UrlDescriptor.php @@ -27,16 +27,18 @@ class UrlDescriptor * @param string $id The ID * @param string $url The URL * @param string $representation The representation - * @param ?callable $handler The callback + * @param mixed $handler The callback */ public function __construct( public readonly string $id, public readonly string $url = '', public readonly string $representation = '', - ?callable $handler = null, + mixed $handler = null, ) { // As PHP does not support callable property type. - $this->handler = $handler; + if (is_callable($handler)) { + $this->handler = $handler; + } } /**