From ca23f6577f5f759241e215d240a32b25d267e656 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Sun, 21 Jan 2024 19:01:41 -0500 Subject: [PATCH] Fix psr/log dependency, bump to PHP 8.0 minimum (#5) --- .github/workflows/ci.yml | 2 +- composer.json | 6 +++--- src/Plugin/SharedLoggerTrait.php | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c6d3a0..85f53ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['7.3', '7.4', '8.0', '8.1'] + php-versions: ['8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout diff --git a/composer.json b/composer.json index 125a570..3153946 100644 --- a/composer.json +++ b/composer.json @@ -25,13 +25,13 @@ "source": "https://github.com/Vectorface/auth" }, "require": { - "php": ">=7.3", - "psr/log": "^1.0" + "php": ">=8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { "phpunit/phpunit": "^9.5.10", "squizlabs/php_codesniffer": "^3.0", - "monolog/monolog": "^1.0" + "monolog/monolog": "^2.0" }, "scripts": { "test": [ diff --git a/src/Plugin/SharedLoggerTrait.php b/src/Plugin/SharedLoggerTrait.php index b5cf45b..930b778 100644 --- a/src/Plugin/SharedLoggerTrait.php +++ b/src/Plugin/SharedLoggerTrait.php @@ -3,6 +3,7 @@ namespace Vectorface\Auth\Plugin; use Psr\Log\LoggerTrait as PsrLoggerTrait; +use Stringable; use Vectorface\Auth\Auth; /** @@ -29,10 +30,10 @@ trait SharedLoggerTrait * Logs with an arbitrary level, or don't if no logger has been set. * * @param mixed $level The log level. A LogLevel::* constant (usually) - * @param string $message The message to log. + * @param Stringable|string $message The message to log. * @param array $context Further information about the context of the log message. */ - protected function log($level, $message, array $context = []) + protected function log($level, Stringable|string $message, array $context = []): void { $logger = null; if (isset($this->logger)) {