Skip to content

Commit 38fcaf2

Browse files
Run Tests on PHP 8.4 (#55)
1 parent ac8936e commit 38fcaf2

26 files changed

+700
-797
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.2, 8.3]
12+
php: [8.2, 8.3, 8.4]
1313

1414
name: P${{ matrix.php }} - ${{ matrix.os }}
1515

app/Actions/AddReleaseNotesToChangelogAction.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public function __construct(
2020
private readonly FindSecondLevelHeadingWithText $findSecondLevelHeadingWithText,
2121
private readonly PlaceReleaseNotesBelowUnreleasedHeadingAction $addNewReleaseNotesWithUnreleasedHeadingToChangelog,
2222
private readonly PlaceReleaseNotesAtTheTopAction $addNewReleaseToChangelog
23-
) {
24-
}
23+
) {}
2524

2625
/**
2726
* @throws Throwable

app/Actions/ExtractPermalinkFragmentFromHeadingAction.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
class ExtractPermalinkFragmentFromHeadingAction
2020
{
21-
public function __construct(private readonly GitHubActionsOutput $gitHubActionsOutput)
22-
{
23-
}
21+
public function __construct(private readonly GitHubActionsOutput $gitHubActionsOutput) {}
2422

2523
public function execute(Heading $releaseHeading): string
2624
{
@@ -62,8 +60,8 @@ protected function prepareCommonmarkEnvironment(): Environment
6260
];
6361

6462
$environment = new Environment($config);
65-
$environment->addExtension(new CommonMarkCoreExtension());
66-
$environment->addExtension(new HeadingPermalinkExtension());
63+
$environment->addExtension(new CommonMarkCoreExtension);
64+
$environment->addExtension(new HeadingPermalinkExtension);
6765

6866
return $environment;
6967
}
@@ -74,12 +72,12 @@ protected function prepareCommonmarkEnvironment(): Environment
7472
*/
7573
protected function attachPermalinkToHeading(Heading $releaseHeading, Environment $environment): Document
7674
{
77-
$document = new Document();
75+
$document = new Document;
7876
$document->appendChild($releaseHeading);
7977

8078
$documentParsedEvent = new DocumentParsedEvent($document);
8179

82-
$processor = (new HeadingPermalinkProcessor());
80+
$processor = (new HeadingPermalinkProcessor);
8381
$processor->setEnvironment($environment);
8482
$processor->__invoke($documentParsedEvent);
8583

@@ -92,7 +90,7 @@ protected function attachPermalinkToHeading(Heading $releaseHeading, Environment
9290
*/
9391
protected function extractLinkFragmentFromRenderedHtml(string $html): ?string
9492
{
95-
$domDocument = new DOMDocument();
93+
$domDocument = new DOMDocument;
9694
$domDocument->loadHTML($html);
9795

9896
/** @var \DOMAttr $hrefAttribute */

app/Actions/InsertReleaseNotesInChangelogAction.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
class InsertReleaseNotesInChangelogAction
1212
{
13-
public function __construct(private readonly PrepareReleaseNotesAction $prepareReleaseNotes)
14-
{
15-
}
13+
public function __construct(private readonly PrepareReleaseNotesAction $prepareReleaseNotes) {}
1614

1715
/**
1816
* @throws ReleaseNotesCanNotBeplacedException
@@ -40,6 +38,6 @@ public function execute(Document $changelog, string $releaseNotes, Heading $newR
4038

4139
// If the CHANGELOG doesn't have any children, we currently don't insert the release notes.
4240
// An exception is thrown and an error message is displayed to the user.
43-
throw new ReleaseNotesCanNotBeplacedException();
41+
throw new ReleaseNotesCanNotBeplacedException;
4442
}
4543
}

app/Actions/ParseAndLinkifyGitHubUsernamesAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public function execute(?string $releaseNotes): ?string
3030
];
3131

3232
$environment = new Environment($config);
33-
$environment->addExtension(new MarkdownRendererExtension());
34-
$environment->addExtension(new MentionExtension());
33+
$environment->addExtension(new MarkdownRendererExtension);
34+
$environment->addExtension(new MentionExtension);
3535

3636
$parser = new CommonmarkMarkdownParser($environment);
3737
$renderer = new CommonmarkRenderer($environment);

app/Actions/PlaceReleaseNotesAtTheTopAction.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public function __construct(
2525
private readonly CreateNewReleaseHeadingWithCompareUrl $createNewReleaseHeadingWithCompareUrl,
2626
private readonly GenerateCompareUrl $generateCompareUrl,
2727
private readonly GitHubActionsOutput $gitHubActionsOutput,
28-
) {
29-
}
28+
) {}
3029

3130
/**
3231
* @throws Throwable

app/Actions/PlaceReleaseNotesBelowUnreleasedHeadingAction.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public function __construct(
2222
private readonly CreateNewReleaseHeadingWithCompareUrl $createNewReleaseHeading,
2323
private readonly GitHubActionsOutput $gitHubActionsOutput,
2424
private readonly InsertReleaseNotesInChangelogAction $insertReleaseNotesInChangelogAction
25-
) {
26-
}
25+
) {}
2726

2827
/**
2928
* @throws Throwable

app/Actions/PrepareReleaseNotesAction.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
class PrepareReleaseNotesAction
1212
{
13-
public function __construct(private readonly Markdown $markdown, private readonly ShiftHeadingLevelInDocumentAction $shiftHeadingLevelInDocument)
14-
{
15-
}
13+
public function __construct(private readonly Markdown $markdown, private readonly ShiftHeadingLevelInDocumentAction $shiftHeadingLevelInDocument) {}
1614

1715
public function execute(string $releaseNotes, Heading $newReleaseHeading): Document
1816
{

app/Actions/ShiftHeadingLevelInDocumentAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ShiftHeadingLevelInDocumentAction
1414

1515
public function execute(Document $document, int $baseHeadingLevel): Document
1616
{
17-
$headings = (new Query())
17+
$headings = (new Query)
1818
->where(Query::type(Heading::class))
1919
->findAll($document);
2020

app/CreateNewReleaseHeading.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
class CreateNewReleaseHeading
1212
{
13-
public function __construct(private readonly ExtractPermalinkFragmentFromHeadingAction $extractPermalinkFragmentFromHeading)
14-
{
15-
}
13+
public function __construct(private readonly ExtractPermalinkFragmentFromHeadingAction $extractPermalinkFragmentFromHeading) {}
1614

1715
public function create(string $text, string $releaseDate, bool $hideDate = false): Heading
1816
{

0 commit comments

Comments
 (0)