From fdae3249709b41f6a4082492c0adaa9aca9798f5 Mon Sep 17 00:00:00 2001 From: Aleksandr Denisyuk Date: Thu, 16 May 2024 20:40:57 +0300 Subject: [PATCH] Fix phpcsfixer issues --- src/Filesystem/Filesystem.php | 2 +- .../GarbageCollectionHandler/Processor/SyncProcessor.php | 2 +- src/TmpFileManagerBuilder.php | 2 +- tests/Event/TmpFileEventSpy.php | 2 +- tests/Event/TmpFileManagerEventSpy.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Filesystem/Filesystem.php b/src/Filesystem/Filesystem.php index e6e191f..662eab8 100644 --- a/src/Filesystem/Filesystem.php +++ b/src/Filesystem/Filesystem.php @@ -12,7 +12,7 @@ final class Filesystem implements FilesystemInterface { private Fs $fs; - public function __construct(Fs $fs = null) + public function __construct(?Fs $fs = null) { $this->fs = $fs ?? new Fs(); } diff --git a/src/Handler/GarbageCollectionHandler/Processor/SyncProcessor.php b/src/Handler/GarbageCollectionHandler/Processor/SyncProcessor.php index 76fc3f2..67e4bd6 100644 --- a/src/Handler/GarbageCollectionHandler/Processor/SyncProcessor.php +++ b/src/Handler/GarbageCollectionHandler/Processor/SyncProcessor.php @@ -11,7 +11,7 @@ final class SyncProcessor implements ProcessorInterface { private Fs $fs; - public function __construct(Fs $fs = null) + public function __construct(?Fs $fs = null) { $this->fs = $fs ?? new Fs(); } diff --git a/src/TmpFileManagerBuilder.php b/src/TmpFileManagerBuilder.php index 5a0b938..f48408b 100644 --- a/src/TmpFileManagerBuilder.php +++ b/src/TmpFileManagerBuilder.php @@ -23,7 +23,7 @@ final class TmpFileManagerBuilder implements TmpFileManagerBuilderInterface private Fs $fs; private EventDispatcherInterface $eventDispatcher; - public function __construct(Fs $fs = null, EventDispatcherInterface $eventDispatcher = null) + public function __construct(?Fs $fs = null, ?EventDispatcherInterface $eventDispatcher = null) { $this->tmpFileDir = sys_get_temp_dir(); $this->tmpFilePrefix = 'php'; diff --git a/tests/Event/TmpFileEventSpy.php b/tests/Event/TmpFileEventSpy.php index 7607dde..f1b9ff5 100644 --- a/tests/Event/TmpFileEventSpy.php +++ b/tests/Event/TmpFileEventSpy.php @@ -29,7 +29,7 @@ public function __invoke(AbstractTmpFileEvent $event): void $this->tmpFiles[$event->getTmpFile()->getFilename()] = $event->getTmpFile(); } - public function getEventsCount(string $className = null): int + public function getEventsCount(?string $className = null): int { if (null === $className) { return array_sum($this->eventsCounter); diff --git a/tests/Event/TmpFileManagerEventSpy.php b/tests/Event/TmpFileManagerEventSpy.php index bd4404a..9d2dd18 100644 --- a/tests/Event/TmpFileManagerEventSpy.php +++ b/tests/Event/TmpFileManagerEventSpy.php @@ -32,7 +32,7 @@ public function __invoke(AbstractTmpFileManagerEvent $event): void $this->tmpFilesCount[$event::class] = $event->getContainer()->count(); } - public function getEventsCount(string $className = null): int + public function getEventsCount(?string $className = null): int { if (null === $className) { return array_sum($this->eventsCounter); @@ -45,7 +45,7 @@ public function getEventsCount(string $className = null): int return $this->eventsCounter[$className]; } - public function getTmpFilesCount(string $className = null): int + public function getTmpFilesCount(?string $className = null): int { if (null === $className) { return array_sum($this->tmpFilesCount);