From 9bf71576576fea9bdd3f753034465d97e7ebe874 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 08:28:58 +0000 Subject: [PATCH 1/4] Update dependency azjezz/psl to v3 | datasource | package | from | to | | ---------- | ---------- | ----- | ----- | | packagist | azjezz/psl | 2.9.1 | 3.0.0 | Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 0be7444..186bd5a 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "BSD-3-Clause", "require": { "php": "~8.2.0", - "azjezz/psl": "^2.9.1", + "azjezz/psl": "^3.0.0", "jwage/changelog-generator": "^1.4.0", "laminas/laminas-diactoros": "^2.26.0", "lcobucci/clock": "^3.2.0", diff --git a/composer.lock b/composer.lock index e9e657b..63f20ad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "07a840e3b7dd8244af5ddb4dd5c8f3e7", + "content-hash": "e7871c5158f439a29e82dc15d46e8604", "packages": [ { "name": "azjezz/psl", - "version": "2.9.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/azjezz/psl.git", - "reference": "1ade4f1a99fe07a8e06f8dee596609aa07585422" + "reference": "d68cd6be64a1fe7355fc02669cc6fa6440294799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/azjezz/psl/zipball/1ade4f1a99fe07a8e06f8dee596609aa07585422", - "reference": "1ade4f1a99fe07a8e06f8dee596609aa07585422", + "url": "https://api.github.com/repos/azjezz/psl/zipball/d68cd6be64a1fe7355fc02669cc6fa6440294799", + "reference": "d68cd6be64a1fe7355fc02669cc6fa6440294799", "shasum": "" }, "require": { @@ -26,20 +26,21 @@ "ext-json": "*", "ext-mbstring": "*", "ext-sodium": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "revolt/event-loop": "^1.0.1" + "php": "~8.2.0 || ~8.3.0", + "revolt/event-loop": "^1.0.6" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.22.0", - "php-coveralls/php-coveralls": "^2.6.0", - "php-standard-library/psalm-plugin": "^2.2.1", - "phpbench/phpbench": "^1.2.14", - "phpunit/phpunit": "^9.6.10", - "roave/infection-static-analysis-plugin": "^1.32.0", - "squizlabs/php_codesniffer": "^3.7.2", - "vimeo/psalm": "^5.13.1" + "friendsofphp/php-cs-fixer": "^3.52.1", + "php-coveralls/php-coveralls": "^2.7.0", + "php-standard-library/psalm-plugin": "^2.3.0", + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^9.6.18", + "roave/infection-static-analysis-plugin": "^1.35.0", + "squizlabs/php_codesniffer": "^3.9.0", + "vimeo/psalm": "^5.23.1" }, "suggest": { + "php-standard-library/phpstan-extension": "PHPStan integration", "php-standard-library/psalm-plugin": "Psalm integration" }, "type": "library", @@ -70,7 +71,7 @@ "description": "PHP Standard Library", "support": { "issues": "https://github.com/azjezz/psl/issues", - "source": "https://github.com/azjezz/psl/tree/2.9.1" + "source": "https://github.com/azjezz/psl/tree/3.0.0" }, "funding": [ { @@ -78,7 +79,7 @@ "type": "github" } ], - "time": "2024-04-05T05:18:37+00:00" + "time": "2024-09-03T14:18:44+00:00" }, { "name": "clue/stream-filter", From 8c6dbea3b2aaaac804fa2e38548003dfa1eef503 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 5 Sep 2024 22:23:59 +0200 Subject: [PATCH 2/4] Removed outdated suppressions --- src/Git/Value/BranchName.php | 1 - .../Api/GraphQL/Query/GetMilestoneChangelog/Response/Label.php | 1 - src/Github/Value/RepositoryName.php | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Git/Value/BranchName.php b/src/Git/Value/BranchName.php index 31f21ad..d12d718 100644 --- a/src/Git/Value/BranchName.php +++ b/src/Git/Value/BranchName.php @@ -19,7 +19,6 @@ private function __construct( /** * @pure - * @psalm-suppress ImpureFunctionCall the {@see \Psl\Type\non_empty_string()} API is pure by design * @psalm-suppress ImpureMethodCall the {@see \Psl\Type\TypeInterface::assert()} API is conditionally pure */ public static function fromName(string $name): self diff --git a/src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Label.php b/src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Label.php index 2fea1b1..1737c71 100644 --- a/src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Label.php +++ b/src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Label.php @@ -30,7 +30,6 @@ private function __construct( * @psalm-pure * * @psalm-suppress ImpureMethodCall {@see https://github.com/azjezz/psl/issues/130} - * @psalm-suppress ImpureFunctionCall {@see https://github.com/azjezz/psl/issues/130} */ public static function fromPayload(array $payload): self { diff --git a/src/Github/Value/RepositoryName.php b/src/Github/Value/RepositoryName.php index 1848d50..560a466 100644 --- a/src/Github/Value/RepositoryName.php +++ b/src/Github/Value/RepositoryName.php @@ -28,7 +28,6 @@ private function __construct( /** * @psalm-pure - * @psalm-suppress ImpureFunctionCall the {@see \Psl\Type\non_empty_string()} API is pure by design * @psalm-suppress ImpureMethodCall the {@see \Psl\Type\TypeInterface::assert()} API is conditionally pure */ public static function fromFullName(string $fullName): self From 374013d9d3840c72c8fbc4545c478735f2e9eae6 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 5 Sep 2024 22:25:13 +0200 Subject: [PATCH 3/4] Upgrading PHP to 8.3.x --- Dockerfile | 2 +- composer.json | 2 +- composer.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2de504c..1692c0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM composer:2 AS composer -FROM php:8.2-alpine +FROM php:8.3-alpine COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/composer.json b/composer.json index 186bd5a..029a553 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "Application that eases release management in the Laminas organisation through GitHub actions", "license": "BSD-3-Clause", "require": { - "php": "~8.2.0", + "php": "~8.3.0", "azjezz/psl": "^3.0.0", "jwage/changelog-generator": "^1.4.0", "laminas/laminas-diactoros": "^2.26.0", diff --git a/composer.lock b/composer.lock index 63f20ad..171b23f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e7871c5158f439a29e82dc15d46e8604", + "content-hash": "b3a750673f7d5baf2d9d6726d2fc2aaa", "packages": [ { "name": "azjezz/psl", @@ -7325,7 +7325,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.2.0" + "php": "~8.3.0" }, "platform-dev": [], "plugin-api-version": "2.6.0" From 97ffb62a525e01cab0c5501ceca117d8703ef9cd Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 5 Sep 2024 22:31:09 +0200 Subject: [PATCH 4/4] Declaring `private const` types --- src/Changelog/BumpAndCommitChangelogVersion.php | 4 ++-- .../BumpAndCommitChangelogVersionViaKeepAChangelog.php | 4 ++-- src/Changelog/ChangelogReleaseNotes.php | 2 +- src/Environment/EnvironmentVariables.php | 2 +- src/Github/CreateReleaseTextViaKeepAChangelog.php | 2 +- .../BumpAndCommitChangelogVersionViaKeepAChangelogTest.php | 2 +- test/unit/Changelog/ChangelogReleaseNotesTest.php | 4 ++-- .../Changelog/ReleaseChangelogViaKeepAChangelogTest.php | 4 ++-- test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php | 6 +++--- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Changelog/BumpAndCommitChangelogVersion.php b/src/Changelog/BumpAndCommitChangelogVersion.php index 25ada33..4dad40f 100644 --- a/src/Changelog/BumpAndCommitChangelogVersion.php +++ b/src/Changelog/BumpAndCommitChangelogVersion.php @@ -10,8 +10,8 @@ interface BumpAndCommitChangelogVersion { - public const BUMP_MINOR = 'bumpMinorVersion'; - public const BUMP_PATCH = 'bumpPatchVersion'; + public const string BUMP_MINOR = 'bumpMinorVersion'; + public const string BUMP_PATCH = 'bumpPatchVersion'; /** * @psalm-param self::BUMP_* $bumpType diff --git a/src/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelog.php b/src/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelog.php index 338fbd9..6f5f7f9 100644 --- a/src/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelog.php +++ b/src/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelog.php @@ -17,9 +17,9 @@ class BumpAndCommitChangelogVersionViaKeepAChangelog implements BumpAndCommitChangelogVersion { - private const CHANGELOG_FILE = 'CHANGELOG.md'; + private const string CHANGELOG_FILE = 'CHANGELOG.md'; - private const COMMIT_TEMPLATE = <<< 'COMMIT' + private const string COMMIT_TEMPLATE = <<< 'COMMIT' Bumps changelog version to %s Updates the %s file to add a changelog entry for a new %s version. diff --git a/src/Changelog/ChangelogReleaseNotes.php b/src/Changelog/ChangelogReleaseNotes.php index 9c188d0..f032e14 100644 --- a/src/Changelog/ChangelogReleaseNotes.php +++ b/src/Changelog/ChangelogReleaseNotes.php @@ -13,7 +13,7 @@ /** @psalm-immutable */ class ChangelogReleaseNotes { - private const CONCATENATION_STRING = "\n\n-----\n\n"; + private const string CONCATENATION_STRING = "\n\n-----\n\n"; /** @psalm-param non-empty-string $changelogFile */ public static function writeChangelogFile(string $changelogFile, self $releaseNotes): void diff --git a/src/Environment/EnvironmentVariables.php b/src/Environment/EnvironmentVariables.php index 87a3731..2cfb2b1 100644 --- a/src/Environment/EnvironmentVariables.php +++ b/src/Environment/EnvironmentVariables.php @@ -15,7 +15,7 @@ /** @psalm-immutable */ class EnvironmentVariables implements Variables { - private const LOG_LEVELS = [ + private const array LOG_LEVELS = [ '100', '200', '250', diff --git a/src/Github/CreateReleaseTextViaKeepAChangelog.php b/src/Github/CreateReleaseTextViaKeepAChangelog.php index ec2cd51..a2d4f6c 100644 --- a/src/Github/CreateReleaseTextViaKeepAChangelog.php +++ b/src/Github/CreateReleaseTextViaKeepAChangelog.php @@ -26,7 +26,7 @@ class CreateReleaseTextViaKeepAChangelog implements CreateReleaseText { /** @psalm-var non-empty-list */ - private const DEFAULT_SECTIONS = [ + private const array DEFAULT_SECTIONS = [ 'Added', 'Changed', 'Deprecated', diff --git a/test/unit/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelogTest.php b/test/unit/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelogTest.php index 7c4f01b..c4bc4a6 100644 --- a/test/unit/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelogTest.php +++ b/test/unit/Changelog/BumpAndCommitChangelogVersionViaKeepAChangelogTest.php @@ -209,7 +209,7 @@ private function createMockChangelog(): string return $changelogFile; } - private const CHANGELOG_STUB = <<< 'CHANGELOG' + private const string CHANGELOG_STUB = <<< 'CHANGELOG' # Changelog All notable changes to this project will be documented in this file, in reverse chronological order by release. diff --git a/test/unit/Changelog/ChangelogReleaseNotesTest.php b/test/unit/Changelog/ChangelogReleaseNotesTest.php index d9498fa..ed27e94 100644 --- a/test/unit/Changelog/ChangelogReleaseNotesTest.php +++ b/test/unit/Changelog/ChangelogReleaseNotesTest.php @@ -161,7 +161,7 @@ public function testMergedInstanceContainsChangelogEntryFromTheInstanceThatHadOn $this->assertEquals($expectedEntry, $reflectionProperty->getValue($merged)); } - private const CHANGELOG_ENTRY = <<< 'ENTRY' + private const string CHANGELOG_ENTRY = <<< 'ENTRY' ## 1.0.1 - %s ### Added @@ -186,7 +186,7 @@ public function testMergedInstanceContainsChangelogEntryFromTheInstanceThatHadOn ENTRY; - private const CHANGELOG_STUB = <<< 'CHANGELOG' + private const string CHANGELOG_STUB = <<< 'CHANGELOG' # Changelog All notable changes to this project will be documented in this file, in reverse chronological order by release. diff --git a/test/unit/Changelog/ReleaseChangelogViaKeepAChangelogTest.php b/test/unit/Changelog/ReleaseChangelogViaKeepAChangelogTest.php index 0d340d4..5bcc90d 100644 --- a/test/unit/Changelog/ReleaseChangelogViaKeepAChangelogTest.php +++ b/test/unit/Changelog/ReleaseChangelogViaKeepAChangelogTest.php @@ -271,7 +271,7 @@ private function checkoutMockRepositoryWithChangelog(string $origin): string return $repo; } - private const INVALID_CHANGELOG = <<< 'END' + private const string INVALID_CHANGELOG = <<< 'END' # NOT A CHANGELOG This file is not a changelog. @@ -282,7 +282,7 @@ private function checkoutMockRepositoryWithChangelog(string $origin): string END; - private const READY_CHANGELOG = <<< 'END' + private const string READY_CHANGELOG = <<< 'END' # Changelog All notable changes to this project will be documented in this file, in reverse chronological order by release. diff --git a/test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php b/test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php index 384a9a0..36b2a06 100644 --- a/test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php +++ b/test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php @@ -209,7 +209,7 @@ private function checkoutMockRepositoryWithChangelog(string $origin): string return $repo; } - private const INVALID_CHANGELOG = <<< 'END' + private const string INVALID_CHANGELOG = <<< 'END' # NOT A CHANGELOG This file is not a changelog. @@ -220,7 +220,7 @@ private function checkoutMockRepositoryWithChangelog(string $origin): string END; - private const READY_CHANGELOG = <<< 'END' + private const string READY_CHANGELOG = <<< 'END' # Changelog All notable changes to this project will be documented in this file, in reverse chronological order by release. @@ -271,7 +271,7 @@ private function checkoutMockRepositoryWithChangelog(string $origin): string END; - private const CHANGELOG_MULTI_SECTION = <<< 'END' + private const string CHANGELOG_MULTI_SECTION = <<< 'END' # Changelog All notable changes to this project will be documented in this file, in reverse chronological order by release.