From b6bc0022a6d70274a7abc692589052b71ab4a731 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 4 Nov 2023 21:55:15 +0100 Subject: [PATCH] code review --- CHANGELOG.md | 6 ++++++ README.md | 8 ++++---- _define.php | 2 +- dcstore.xml | 4 ++-- src/Manage.php | 7 +++++-- src/My.php | 2 +- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b65656..1b2e59a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +testMail 0.7.1 - 2023.11.04 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Code review + testMail 0.7 - 2023.10.13 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index fbb7898..f68b8a2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # README -[![Release](https://img.shields.io/badge/release-0.7-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/testMail/releases) -![Date](https://img.shields.io/badge/date-2023.10.13-c44d58.svg) +[![Release](https://img.shields.io/badge/release-0.7.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/testMail/releases) +![Date](https://img.shields.io/badge/date-2023.11.04-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/testMail) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/testMail/src/branch/master/LICENSE) @@ -10,13 +10,13 @@ _testmail_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org). -> It helps dev to test dotclear mail system. +> Help dev to test dotclear mail system. ## REQUIREMENTS * Dotclear 2.28 * PHP 8.1+ -* super admin permission +* Dotclear super admin permission ## USAGE diff --git a/_define.php b/_define.php index 877c964..fdbd575 100644 --- a/_define.php +++ b/_define.php @@ -18,7 +18,7 @@ $this->registerModule( 'Mail test', 'Send a simple mail from admin', 'Osku and contributors', - '0.7', + '0.7.1', [ 'requires' => [['core', '2.28']], 'permissions' => 'My', diff --git a/dcstore.xml b/dcstore.xml index c35f64b..1196352 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Mail test - 0.7 + 0.7.1 Osku and contributors Send a simple mail from admin - https://git.dotclear.watch/JcDenis/testMail/releases/download/v0.7/plugin-testMail.zip + https://git.dotclear.watch/JcDenis/testMail/releases/download/v0.7.1/plugin-testMail.zip 2.28 https://git.dotclear.watch/JcDenis/testMail/src/branch/master/README.md https://git.dotclear.watch/JcDenis/testMail/issues diff --git a/src/Manage.php b/src/Manage.php index 56e3f6d..9656ee5 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -108,7 +108,7 @@ class Manage extends Process (new Input('mail_to')) ->__call('class', ['maximal']) ->__call('size', [30]) - ->__call('maxlenght', [255]) + ->__call('maxlength', [255]) ->__call('value', ['']), ]]), (new Para()) @@ -118,7 +118,7 @@ class Manage extends Process (new Input('mail_subject')) ->__call('class', ['maximal']) ->__call('size', [30]) - ->__call('maxlenght', [255]) + ->__call('maxlength', [255]) ->__call('value', ['']), ]]), (new Para()) @@ -152,6 +152,9 @@ class Manage extends Process Page::closeModule(); } + /** + * @return array + */ private static function getHeaders(): array { return [ diff --git a/src/My.php b/src/My.php index 529ef80..4d6554b 100644 --- a/src/My.php +++ b/src/My.php @@ -26,8 +26,8 @@ class My extends MyPlugin public static function checkCustomContext(int $context): ?bool { - // Limit to super admin return match ($context) { + // Limit to super admin self::MODULE => App::auth()->isSuperAdmin(), default => null, };