From 50d52afbbe27f18ae717f5997890859de379c443 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 26 Sep 2024 16:41:28 +0200 Subject: [PATCH] chore: add tests for PHP 8.4 and fix deprecations --- .github/workflows/test.yaml | 1 + src/Builder/JsonBuilder.php | 2 +- src/Command/CKEditorInstallerCommand.php | 4 ++-- src/Installer/CKEditorInstaller.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f53131f5..4a53f35a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,6 +15,7 @@ jobs: - 8.1 - 8.2 - 8.3 + - 8.4 dependencies: [highest] steps: diff --git a/src/Builder/JsonBuilder.php b/src/Builder/JsonBuilder.php index f73003b8..26e22551 100644 --- a/src/Builder/JsonBuilder.php +++ b/src/Builder/JsonBuilder.php @@ -68,7 +68,7 @@ public function getValues(): array return $this->values; } - public function setValues(array $values, string $pathPrefix = null): self + public function setValues(array $values, ?string $pathPrefix = null): self { foreach ($values as $key => $value) { $path = sprintf('%s[%s]', $pathPrefix, $key); diff --git a/src/Command/CKEditorInstallerCommand.php b/src/Command/CKEditorInstallerCommand.php index cfaae542..9863c627 100644 --- a/src/Command/CKEditorInstallerCommand.php +++ b/src/Command/CKEditorInstallerCommand.php @@ -290,8 +290,8 @@ private function info(string $message, OutputInterface $output): void private function block( string $message, OutputInterface $output, - string $background = null, - string $font = null + ?string $background = null, + ?string $font = null ): void { $options = []; diff --git a/src/Installer/CKEditorInstaller.php b/src/Installer/CKEditorInstaller.php index e4927ae3..7a983c1d 100644 --- a/src/Installer/CKEditorInstaller.php +++ b/src/Installer/CKEditorInstaller.php @@ -202,7 +202,7 @@ private function getDownloadUrl(array $options): string /** * @return resource */ - private function createStreamContext(callable $notifier = null) + private function createStreamContext(?callable $notifier = null) { $context = []; $proxy = getenv('https_proxy') ?: getenv('http_proxy'); @@ -306,7 +306,7 @@ private function extractFile(string $file, string $rewrite, string $origin, arra } } - private function notify(callable $notifier = null, string $type = null, mixed $data = null): mixed + private function notify(?callable $notifier = null, ?string $type = null, mixed $data = null): mixed { if (null !== $notifier) { return $notifier($type, $data);