diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index c05c31fd..74164788 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.2', '8.3', '8.4', '8.5'] + php-versions: ['8.3', '8.4', '8.5'] steps: - name: Setup PHP Action uses: shivammathur/setup-php@v2 diff --git a/README.md b/README.md index 1c3686ee..f1beac23 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ ErrorHeroModule [![PHPStan](https://img.shields.io/badge/style-level%20max-brightgreen.svg?style=flat-square&label=phpstan)](https://github.com/phpstan/phpstan) [![Downloads](https://poser.pugx.org/samsonasik/error-hero-module/downloads)](https://packagist.org/packages/samsonasik/error-hero-module) -> This is README for version ^6.0 which only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.2. +> This is README for version ^7.0 which bump laminas-diactoros to ^3.8 and bump doctrine-orm-module to ^6.3, and only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.3 -> For version ^5.0, you can read at [version 5 readme](https://github.com/samsonasik/ErrorHeroModule/tree/5.x.x) which only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.1. +> For version ^6.0, you can read at [version 6 readme](https://github.com/samsonasik/ErrorHeroModule/tree/6.x.x) which only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.2. -> For version ^4.0, you can read at [version 4 readme](https://github.com/samsonasik/ErrorHeroModule/tree/4.x.x) which only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.0. +> For version ^5.0, you can read at [version 5 readme](https://github.com/samsonasik/ErrorHeroModule/tree/5.x.x) which only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.1. Introduction ------------ diff --git a/composer.json b/composer.json index a6ab8d7a..21d0fc3b 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ } ], "require": { - "php": "^8.2", + "php": "^8.3", "laminas/laminas-db": "^2.20.0", "laminas/laminas-diactoros": "^3.8", "laminas/laminas-log": "^2.17.1", diff --git a/src/Command/BaseLoggingCommand.php b/src/Command/BaseLoggingCommand.php index 3ccdef19..4e96139f 100644 --- a/src/Command/BaseLoggingCommand.php +++ b/src/Command/BaseLoggingCommand.php @@ -6,6 +6,7 @@ use ErrorHeroModule\Handler\Logging; use ErrorHeroModule\HeroTrait; +use Override; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; @@ -18,8 +19,7 @@ abstract class BaseLoggingCommand extends Command { use HeroTrait; - /** @var string */ - private const DISPLAY_SETTINGS = 'display-settings'; + private const string DISPLAY_SETTINGS = 'display-settings'; private array $errorHeroModuleConfig; @@ -36,6 +36,7 @@ public function init(array $errorHeroModuleConfig, Logging $logging): void $this->logging = $logging; } + #[Override] public function run(InputInterface $input, OutputInterface $output): int { try { diff --git a/src/Compat/LoggerAbstractServiceFactory.php b/src/Compat/LoggerAbstractServiceFactory.php index 50e655f4..062647aa 100644 --- a/src/Compat/LoggerAbstractServiceFactory.php +++ b/src/Compat/LoggerAbstractServiceFactory.php @@ -4,6 +4,7 @@ namespace ErrorHeroModule\Compat; +use Override; use Psr\Container\ContainerInterface; class LoggerAbstractServiceFactory extends \Laminas\Log\LoggerAbstractServiceFactory @@ -11,6 +12,7 @@ class LoggerAbstractServiceFactory extends \Laminas\Log\LoggerAbstractServiceFac /** * {@inheritdoc} */ + #[Override] public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) { $config = $this->getConfig($container); diff --git a/src/Handler/Formatter/Json.php b/src/Handler/Formatter/Json.php index 6c77d6fd..ede228ea 100644 --- a/src/Handler/Formatter/Json.php +++ b/src/Handler/Formatter/Json.php @@ -7,6 +7,7 @@ use DateTime; use Laminas\Log\Formatter\FormatterInterface; use Laminas\Log\Formatter\Json as BaseJson; +use Override; use function json_encode; use function str_replace; @@ -18,13 +19,13 @@ final class Json extends BaseJson implements FormatterInterface { - /** @var string */ - private const TIMESTAMP = 'timestamp'; + private const string TIMESTAMP = 'timestamp'; /** * @param array $event event data * @return string formatted line to write to the log */ + #[Override] public function format($event): string { static $timestamp; diff --git a/src/Handler/Logging.php b/src/Handler/Logging.php index 3502a01f..7d6e23fb 100644 --- a/src/Handler/Logging.php +++ b/src/Handler/Logging.php @@ -40,26 +40,19 @@ final class Logging private readonly string $emailSender; - /** @var string */ - private const PRIORITY = 'priority'; + private const string PRIORITY = 'priority'; - /** @var string */ - private const ERROR_TYPE = 'errorType'; + private const string ERROR_TYPE = 'errorType'; - /** @var string */ - private const ERROR_FILE = 'errorFile'; + private const string ERROR_FILE = 'errorFile'; - /** @var string */ - private const ERROR_LINE = 'errorLine'; + private const string ERROR_LINE = 'errorLine'; - /** @var string */ - private const TRACE = 'trace'; + private const string TRACE = 'trace'; - /** @var string */ - private const ERROR_MESSAGE = 'errorMessage'; + private const string ERROR_MESSAGE = 'errorMessage'; - /** @var string */ - private const SERVER_URL = 'server_url'; + private const string SERVER_URL = 'server_url'; public function __construct( private readonly Logger $logger, diff --git a/src/Handler/Writer/Checker/Db.php b/src/Handler/Writer/Checker/Db.php index 722c0941..193436e0 100644 --- a/src/Handler/Writer/Checker/Db.php +++ b/src/Handler/Writer/Checker/Db.php @@ -14,14 +14,11 @@ final readonly class Db { - /** @var string */ - private const OPTIONS = 'options'; + private const string OPTIONS = 'options'; - /** @var string */ - private const COLUMN = 'column'; + private const string COLUMN = 'column'; - /** @var string */ - private const EXTRA = 'extra'; + private const string EXTRA = 'extra'; public function __construct( private DbWriter $dbWriter, diff --git a/src/Handler/Writer/Mail.php b/src/Handler/Writer/Mail.php index 39c58881..94d77ff4 100644 --- a/src/Handler/Writer/Mail.php +++ b/src/Handler/Writer/Mail.php @@ -13,6 +13,7 @@ use Laminas\Mime\Message as MimeMessage; use Laminas\Mime\Mime; use Laminas\Mime\Part; +use Override; use function fopen; use function implode; @@ -26,8 +27,7 @@ final class Mail extends BaseMail { - /** @var string */ - private const NAME = 'name'; + private const string NAME = 'name'; /** * @throws LogException\InvalidArgumentException @@ -45,6 +45,7 @@ public function __construct( * * Override with apply attachment whenever there is $_FILES data */ + #[Override] public function shutdown(): void { // Always provide events to mail as plaintext. diff --git a/src/HeroConstant.php b/src/HeroConstant.php index 1cda192f..723387e4 100644 --- a/src/HeroConstant.php +++ b/src/HeroConstant.php @@ -22,7 +22,7 @@ final class HeroConstant { /** @var array */ - public const ERROR_TYPE = [ + public const array ERROR_TYPE = [ E_ERROR => 'E_ERROR', E_WARNING => 'E_WARNING', E_PARSE => 'E_PARSE', diff --git a/src/Listener/Mvc.php b/src/Listener/Mvc.php index fa44b10a..0ea9b8f6 100644 --- a/src/Listener/Mvc.php +++ b/src/Listener/Mvc.php @@ -26,11 +26,9 @@ final class Mvc extends AbstractListenerAggregate private ?MvcEvent $mvcEvent = null; - /** @var string */ - private const DISPLAY_SETTINGS = 'display-settings'; + private const string DISPLAY_SETTINGS = 'display-settings'; - /** @var string */ - private const MESSAGE = 'message'; + private const string MESSAGE = 'message'; public function __construct( private readonly array $errorHeroModuleConfig, diff --git a/src/Middleware/Mezzio.php b/src/Middleware/Mezzio.php index 6ba7e07a..e3416c5b 100644 --- a/src/Middleware/Mezzio.php +++ b/src/Middleware/Mezzio.php @@ -31,8 +31,7 @@ final class Mezzio implements MiddlewareInterface private ?ServerRequestInterface $request = null; - /** @var string */ - private const DISPLAY_SETTINGS = 'display-settings'; + private const string DISPLAY_SETTINGS = 'display-settings'; /** * @param array{exclude-exceptions: array, enable: bool, display-settings: array} $errorHeroModuleConfig diff --git a/src/Middleware/MezzioFactory.php b/src/Middleware/MezzioFactory.php index 5007ccc5..9d2559f8 100644 --- a/src/Middleware/MezzioFactory.php +++ b/src/Middleware/MezzioFactory.php @@ -25,7 +25,7 @@ final class MezzioFactory { /** @var array */ - private const CONTAINERS_TRANSFORM = [ + private const array CONTAINERS_TRANSFORM = [ ContainerBuilder::class => SymfonyService::class, Psr11PimpleContainer::class => PimpleService::class, ]; diff --git a/src/Transformer/TransformerAbstract.php b/src/Transformer/TransformerAbstract.php index 2899c541..ecbadafe 100644 --- a/src/Transformer/TransformerAbstract.php +++ b/src/Transformer/TransformerAbstract.php @@ -9,8 +9,7 @@ abstract class TransformerAbstract { - /** @var string */ - private const DB = 'db'; + private const string DB = 'db'; /** * @return array{array{name: string, options: array}}