Skip to content

Commit

Permalink
Declaring private const types
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Sep 5, 2024
1 parent 374013d commit 97ffb62
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Changelog/BumpAndCommitChangelogVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Changelog/ChangelogReleaseNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Environment/EnvironmentVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/** @psalm-immutable */
class EnvironmentVariables implements Variables
{
private const LOG_LEVELS = [
private const array LOG_LEVELS = [
'100',
'200',
'250',
Expand Down
2 changes: 1 addition & 1 deletion src/Github/CreateReleaseTextViaKeepAChangelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class CreateReleaseTextViaKeepAChangelog implements CreateReleaseText
{
/** @psalm-var non-empty-list<string> */
private const DEFAULT_SECTIONS = [
private const array DEFAULT_SECTIONS = [
'Added',
'Changed',
'Deprecated',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Changelog/ChangelogReleaseNotesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Changelog/ReleaseChangelogViaKeepAChangelogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions test/unit/Github/CreateReleaseTextViaKeepAChangelogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 97ffb62

Please sign in to comment.