From f02c3d228b1c6cc44c9749a6b6ea1d6be6b5e4d7 Mon Sep 17 00:00:00 2001 From: alexmerlin Date: Mon, 17 Nov 2025 15:58:31 +0200 Subject: [PATCH] Issue #30: Remove PHP 8.1 and add PHP 8.4 & 8.5 support Signed-off-by: alexmerlin --- .github/workflows/codecov.yml | 5 +-- .github/workflows/static-analysis.yml | 5 +-- .laminas-ci.json | 3 ++ README.md | 48 +++++++++------------------ SECURITY.md | 30 ++++++----------- composer.json | 7 ++-- docs/book/v3/configuration.md | 4 +-- docs/book/v3/overview.md | 6 ++-- docs/book/v3/renderer.md | 2 +- docs/book/v3/usage.md | 4 +-- 10 files changed, 45 insertions(+), 69 deletions(-) create mode 100644 .laminas-ci.json diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 190b4da..0528ff4 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,13 +15,14 @@ jobs: - ubuntu-latest php: - - "8.1" - "8.2" - "8.3" + - "8.4" + - "8.5" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Install PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 2423564..533df66 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,13 +15,14 @@ jobs: - ubuntu-latest php: - - "8.1" - "8.2" - "8.3" + - "8.4" + - "8.5" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install PHP uses: shivammathur/setup-php@v2 diff --git a/.laminas-ci.json b/.laminas-ci.json new file mode 100644 index 0000000..29216fa --- /dev/null +++ b/.laminas-ci.json @@ -0,0 +1,3 @@ +{ + "backwardCompatibilityCheck": true +} diff --git a/README.md b/README.md index 7988078..629e708 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # dot-flashmessenger Flash messenger library for session messages between redirects. -A flash message, or session message is a piece of text data that survives one requests(available only in the next request). -This library accepts session data as well, not just string messages, with the same behaviour. +A flash message, or session message is a piece of text data that survives one request (available only in the next request). +This library accepts session data as well, not just string messages, with the same behavior. The flash messenger is a convenient way to add data to the session and get it back on the next request without bothering with setting and clearing the data manually. ## Documentation @@ -12,7 +12,7 @@ Documentation is available at: https://docs.dotkernel.org/dot-flashmessenger/. ## Badges ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-flashmessenger) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.6.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.7.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/network) @@ -32,7 +32,7 @@ composer require dotkernel/dot-flashmessenger ``` This will also install `laminas/laminas-session` as session handling is based on this library. -Next, merge the `ConfigProvider` to your application's configuration +Next, merge the `ConfigProvider` to your application's configuration. ## Configuration @@ -44,12 +44,12 @@ return [ ]; ``` -Sets the session namespace to use for all flash messages and data +Sets the session namespace to be used for all flash messages and data. ## Usage If following the installation step, you'll already have a FlashMessenger service in the service manager. -Just inject this service in you classes, wherever you need flash messages. +Inject this service in your classes, wherever you need flash messages. ### Getting the service in a factory @@ -63,7 +63,7 @@ To add and retrieve text messages ```php $this->flashMessenger->addMessage('error', 'This is a error flash message'); -//on the next request you can get all messages from a namespace, or all messages from all namespaces if namespace is omitted +//on the next request you can get all messages from a namespace, or all messages from all namespaces if the namespace is omitted $this->flashMessenger->getMessages('error'); ``` @@ -87,36 +87,20 @@ FlashMessengerInterface::SUCCESS_NAMESPACE using the methods: ```php -/** - * @param string $error - * @return void - */ -public function addError($error); - -/** - * @param string $info - * @return void - */ -public function addInfo($info); - -/** - * @param string $warning - * @return void - */ -public function addWarning($warning); - -/** - * @param string $success - * @return void - */ -public function addSuccess($success); +public function addError(string|array $error); + +public function addInfo(string|array $info); + +public function addWarning(string|array $warning); + +public function addSuccess(string|array $success); ``` ## FlashMessengerRenderer A class that is able to parse the content of the flash messenger service in an HTML format. It uses the TemplateInterface to parse a partial, sending to the partial template the messages, the service and the renderer itself. -There are also a twig extension provided in [dot-twigrenderer](https://github.com/dotkernel/dot-twigrenderer), for easy parsing of messages blocks. +There is also a Twig extension provided in [dot-twigrenderer](https://github.com/dotkernel/dot-twigrenderer), for easy parsing of messages blocks. ## Registered services @@ -129,5 +113,3 @@ The flash messenger service ```php Dot\FlashMessenger\View\RendererInterface::class ``` - -The registered renderer class diff --git a/SECURITY.md b/SECURITY.md index 062564a..210343d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,18 +2,15 @@ ## Supported Versions - -| Version | Supported | PHP Version | -|---------|--------------------|------------------------------------------------------------------------------------------------------------------------| -| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.4.2) | -| <= 2.x | :x: | | - +| Version | Supported | PHP Version | +|---------|--------------------|--------------------------------------------------------------------------------------------------------------------| +| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.7.0) | +| <= 2.x | :x: | | ## Reporting Potential Security Issues -If you have encountered a potential security vulnerability in this project, -please report it to us at . We will work with you to -verify the vulnerability and patch it. +If you have encountered a potential security vulnerability in this project, please report it to us at . +We will work with you to verify the vulnerability and patch it. When reporting issues, please provide the following information: @@ -21,19 +18,12 @@ When reporting issues, please provide the following information: - A description indicating how to reproduce the issue - A summary of the security vulnerability and impact -We request that you contact us via the email address above and give the -project contributors a chance to resolve the vulnerability and issue a new -release prior to any public exposure; this helps protect the project's -users, and provides them with a chance to upgrade and/or update in order to -protect their applications. - +We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure; +this helps protect the project's users and provides them with a chance to upgrade and/or update to protect their applications. ## Policy If we verify a reported security vulnerability, our policy is: -- We will patch the current release branch, as well as the immediate prior minor - release branch. - -- After patching the release branches, we will immediately issue new security - fix releases for each patched release branch. \ No newline at end of file +- We will patch the current release branch, as well as the immediate prior minor release branch. +- After patching the release branches, we will immediately issue new security fix releases for each patched release branch. diff --git a/composer.json b/composer.json index ab83b93..a3a80bb 100644 --- a/composer.json +++ b/composer.json @@ -22,11 +22,10 @@ } }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "psr/http-message": "^1.0 || ^2.0", - "laminas/laminas-servicemanager": "^3.22.1", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "laminas/laminas-session": "^2.17.0", - "mezzio/mezzio-template": "^2.9.0" + "mezzio/mezzio-template": "^2.9.0 || ^3.0.0", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { "laminas/laminas-coding-standard": "^3.0.0", diff --git a/docs/book/v3/configuration.md b/docs/book/v3/configuration.md index 68dfed0..61350af 100644 --- a/docs/book/v3/configuration.md +++ b/docs/book/v3/configuration.md @@ -1,12 +1,12 @@ # Configuration -After installation, merge the `ConfigProvider` to your application's configuration +After installation, merge the `ConfigProvider` to your application's configuration. ```php Dot\FlashMessenger\ConfigProvider::class, ``` -Set the session namespace to use for all flash messages and data +Set the session namespace to be used for all flash messages and data. ```php return [ diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 22e3c4e..3c79d4d 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -2,16 +2,16 @@ `dot-flashmessenger` is a library for session messages, between redirects. -A flash message, or session message is a piece of text data that survives one requests(available only in the next request). +A flash message, or session message is a piece of text data that survives one request (available only in the next request). -This library accepts session data as well, not just string messages, with the same behaviour. +This library accepts session data as well, not just string messages, with the same behavior. The flash messenger is a convenient way to add data to the session and get it back on the next request without bothering with setting and clearing the data manually. ## Badges ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-flashmessenger) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.6.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.7.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/network) diff --git a/docs/book/v3/renderer.md b/docs/book/v3/renderer.md index db7012d..29ed70a 100644 --- a/docs/book/v3/renderer.md +++ b/docs/book/v3/renderer.md @@ -2,7 +2,7 @@ A class that is able to parse the content of the flash messenger service in an HTML format. It uses the TemplateInterface to parse a partial, sending to the partial template the messages, the service and the renderer itself. -There are also a twig extension provided in [dot-twigrenderer](https://github.com/dotkernel/dot-twigrenderer), for easy parsing of messages blocks. +There is also a Twig extension provided in [dot-twigrenderer](https://github.com/dotkernel/dot-twigrenderer), for easy parsing of messages blocks. Partial template example: diff --git a/docs/book/v3/usage.md b/docs/book/v3/usage.md index 52fdee4..e838b1c 100644 --- a/docs/book/v3/usage.md +++ b/docs/book/v3/usage.md @@ -1,7 +1,7 @@ # Usage If following the installation step, you'll already have a FlashMessenger service in the service manager. -Just inject this service in you classes, wherever you need flash messages. +Inject this service in your classes, wherever you need flash messages. ## Using the flash messenger service @@ -10,7 +10,7 @@ To add and retrieve text messages ```php $this->flashMessenger->addMessage('error', 'This is a error flash message'); -//on the next request you can get all messages from a namespace, or all messages from all namespaces if namespace is omitted +//on the next request you can get all messages from a namespace, or all messages from all namespaces if the namespace is omitted $this->flashMessenger->getMessages('error'); ```