Skip to content

Commit 1a0d956

Browse files
authored
tidy up (#3)
1 parent 02df1b4 commit 1a0d956

8 files changed

+20
-16
lines changed

Diff for: composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"symfony/process": "^6.4|^7.0"
1515
},
1616
"require-dev": {
17-
"rector/rector": "^1.1",
18-
"symplify/easy-coding-standard": "^12.3",
19-
"phpstan/phpstan": "^1.11",
20-
"phpunit/phpunit": "^10.5",
21-
"phpstan/phpstan-webmozart-assert": "^1.2.2",
22-
"phpstan/extension-installer": "^1.3",
17+
"rector/rector": "^2.0",
18+
"phpecs/phpecs": "^2.0",
19+
"phpstan/phpstan": "^2.1",
20+
"phpunit/phpunit": "^11.5",
21+
"phpstan/phpstan-webmozart-assert": "^2.0",
22+
"phpstan/extension-installer": "^1.4",
2323
"tracy/tracy": "^2.10"
2424
},
2525
"autoload": {

Diff for: phpstan.neon

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
22
level: 8
3+
treatPhpDocTypesAsCertain: false
34

45
paths:
56
- bin

Diff for: rector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Rector\Config\RectorConfig;
66

77
return RectorConfig::configure()
8-
->withImportNames(true)
8+
->withImportNames()
99
->withPaths([__DIR__ . '/bin', __DIR__ . '/src', __DIR__ . '/tests'])
1010
->withRootFiles()
1111
->withPhpSets()

Diff for: src/ChangelogContentsFactory.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
final class ChangelogContentsFactory
1414
{
1515
/**
16-
* @var array<string, string[]>
16+
* @var array<ChangelogCategory::*, string[]>
1717
*/
1818
private const FILTER_KEYWORDS_BY_CATEGORY = [
1919
ChangelogCategory::SKIPPED => [
@@ -26,10 +26,13 @@ final class ChangelogContentsFactory
2626
'update to',
2727
'[automated]',
2828
'[core]',
29+
'[scope]',
30+
'[scoper]',
31+
'[scoped]',
2932
],
3033
ChangelogCategory::NEW_FEATURES => ['add', 'added', 'improve'],
3134
ChangelogCategory::BUGFIXES => ['fixed', 'fix'],
32-
ChangelogCategory::REMOVED => ['removed', 'deleted', 'remove deprecated', 'remove'],
35+
ChangelogCategory::REMOVED => ['removed', 'deleted', 'remove deprecated', 'remove', 'deprecated'],
3336
];
3437

3538
/**

Diff for: src/ChangelogLineFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Rector\ReleaseNotesGenerator\ValueObject\Commit;
1010
use stdClass;
1111

12-
final class ChangelogLineFactory
12+
final readonly class ChangelogLineFactory
1313
{
1414
/**
1515
* @see https://regex101.com/r/jdT01W/1
@@ -18,7 +18,7 @@ final class ChangelogLineFactory
1818
private const ISSUE_NAME_REGEX = '#(.*?)( \(\#\d+\))?$#ms';
1919

2020
public function __construct(
21-
private readonly GithubApiCaller $githubApiCaller
21+
private GithubApiCaller $githubApiCaller
2222
) {
2323
}
2424

@@ -70,7 +70,7 @@ public function create(Commit $commit, Configuration $configuration): string
7070

7171
return sprintf(
7272
'* %s (%s)%s%s',
73-
(string) $commit,
73+
$commit,
7474
$parenthesis,
7575
$issuesToReference !== [] ? ', ' . implode(', ', $issuesToReference) : '',
7676
$this->createThanks($thanks)

Diff for: src/Command/GenerateCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(
3737
protected function configure(): void
3838
{
3939
$this->setName('generate');
40+
4041
$this->addOption(Option::FROM_COMMIT, null, InputOption::VALUE_REQUIRED);
4142
$this->addOption(Option::TO_COMMIT, null, InputOption::VALUE_REQUIRED);
4243
$this->addOption(Option::GITHUB_TOKEN, null, InputOption::VALUE_REQUIRED);

Diff for: src/Configuration/Configuration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Webmozart\Assert\Assert;
88

9-
final class Configuration
9+
final readonly class Configuration
1010
{
1111
/**
1212
* @var string[]

Diff for: src/ValueObject/ExternalRepositoryChangelog.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Rector\ReleaseNotesGenerator\ValueObject;
66

7-
final class ExternalRepositoryChangelog
7+
final readonly class ExternalRepositoryChangelog
88
{
99
/**
1010
* @param string[] $lines
@@ -33,8 +33,7 @@ public function toString(): string
3333
{
3434
$changelogContents = '## ' . $this->title . PHP_EOL . PHP_EOL;
3535
$changelogContents .= implode(PHP_EOL, $this->lines);
36-
$changelogContents .= PHP_EOL . PHP_EOL;
3736

38-
return $changelogContents;
37+
return $changelogContents . (PHP_EOL . PHP_EOL);
3938
}
4039
}

0 commit comments

Comments
 (0)