From 4efc0e0c21e2de682b9b25074086282972ed47bd Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 4 Oct 2024 12:48:06 +0200 Subject: [PATCH] Fix PHP 8.4 deprecations --- src/Coverage/Processor/Text.php | 2 +- src/Coverage/Processor/TextSummary.php | 2 +- tests/Unit/Logs/LogParserTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Coverage/Processor/Text.php b/src/Coverage/Processor/Text.php index 8325addf..c158ee35 100644 --- a/src/Coverage/Processor/Text.php +++ b/src/Coverage/Processor/Text.php @@ -9,7 +9,7 @@ class Text extends AbstractText { - public function __construct(OutputInterface $output, bool $showColors, OutputFile $targetFile = null) + public function __construct(OutputInterface $output, bool $showColors, ?OutputFile $targetFile = null) { parent::__construct($output, $showColors, false, $targetFile); } diff --git a/src/Coverage/Processor/TextSummary.php b/src/Coverage/Processor/TextSummary.php index 264cc045..24d7757c 100644 --- a/src/Coverage/Processor/TextSummary.php +++ b/src/Coverage/Processor/TextSummary.php @@ -9,7 +9,7 @@ class TextSummary extends AbstractText { - public function __construct(OutputInterface $output, bool $showColors, OutputFile $targetFile = null) + public function __construct(OutputInterface $output, bool $showColors, ?OutputFile $targetFile = null) { parent::__construct($output, $showColors, true, $targetFile); } diff --git a/tests/Unit/Logs/LogParserTest.php b/tests/Unit/Logs/LogParserTest.php index 19b351c2..ee802e96 100644 --- a/tests/Unit/Logs/LogParserTest.php +++ b/tests/Unit/Logs/LogParserTest.php @@ -81,7 +81,7 @@ public function testParseHandlesTestToBeRetried(): void /** * @param LogData[]|null $logs */ - private function mockLogFetcher(array $logs = null): LogFetcher + private function mockLogFetcher(?array $logs = null): LogFetcher { $logs ??= $this->createLogsForOnePassedTest(); $logLocator = $this->prophesize(LogFetcher::class); @@ -95,7 +95,7 @@ private function mockLogFetcher(array $logs = null): LogFetcher /** * @param class-string|null $eventToBeDispatched */ - private function mockEventDispatcher(string $eventToBeDispatched = null): EventDispatcherInterface + private function mockEventDispatcher(?string $eventToBeDispatched = null): EventDispatcherInterface { $eventDispatcher = $this->prophesize(EventDispatcherInterface::class);