Skip to content

Commit 284a099

Browse files
Merge branch '11.4' into 11.5
2 parents 3aa8ac7 + dbcbf05 commit 284a099

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

src/Logging/TeamCity/TeamCityLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class TeamCityLogger
4949
private readonly Printer $printer;
5050
private bool $isSummaryTestCountPrinted = false;
5151
private ?HRTime $time = null;
52-
private ?int $flowId;
52+
private ?int $flowId = null;
5353

5454
/**
5555
* @throws EventFacadeIsSealedException

src/Runner/PHPT/PhptTestCase.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ private function parseExternal(array &$sections): void
615615
'EXPECTF',
616616
'EXPECTREGEX',
617617
];
618+
618619
$testDirectory = dirname($this->filename) . DIRECTORY_SEPARATOR;
619620

620621
foreach ($allowSections as $section) {
@@ -629,7 +630,11 @@ private function parseExternal(array &$sections): void
629630
);
630631
}
631632

632-
$sections[$section] = file_get_contents($testDirectory . $externalFilename);
633+
$contents = file_get_contents($testDirectory . $externalFilename);
634+
635+
assert($contents !== false && $contents !== '');
636+
637+
$sections[$section] = $contents;
633638
}
634639
}
635640
}
@@ -762,9 +767,11 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co
762767

763768
file_put_contents($files['job'], $job);
764769

765-
$job = $template->render();
770+
$rendered = $template->render();
771+
772+
assert($rendered !== '');
766773

767-
assert($job !== '');
774+
$job = $rendered;
768775
}
769776

770777
private function cleanupForCoverage(): RawCodeCoverageData

src/TextUI/Command/Commands/VersionCheckCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public function execute(): Result
4141

4242
$latestCompatibleVersion = $this->downloader->download('https://phar.phpunit.de/latest-version-of/phpunit-' . $this->majorVersionNumber);
4343

44-
assert($latestCompatibleVersion !== false);
45-
4644
$notLatest = version_compare($latestVersion, $this->versionId, '>');
4745
$notLatestCompatible = false;
4846

src/TextUI/Configuration/Cli/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ public function teamcityLogfile(): string
17951795
}
17961796

17971797
/**
1798-
* @phpstan-assert-if-true !null $this->teamcityPrinter
1798+
* @phpstan-assert-if-true !null $this->teamCityPrinter
17991799
*/
18001800
public function hasTeamCityPrinter(): bool
18011801
{
@@ -1937,7 +1937,7 @@ public function testSuite(): string
19371937
}
19381938

19391939
/**
1940-
* @phpstan-assert-if-true !null $this->excludedTestSuite
1940+
* @phpstan-assert-if-true !null $this->excludeTestSuite
19411941
*/
19421942
public function hasExcludedTestSuite(): bool
19431943
{

src/TextUI/Configuration/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@
142142
/**
143143
* @var list<non-empty-string>
144144
*/
145-
private ?array $groups;
145+
private array $groups;
146146

147147
/**
148148
* @var list<non-empty-string>
149149
*/
150-
private ?array $excludeGroups;
150+
private array $excludeGroups;
151151
private int $randomOrderSeed;
152152
private bool $includeUncoveredFiles;
153153
private TestSuiteCollection $testSuite;

src/TextUI/Help.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class Help
3232
private const LEFT_MARGIN = ' ';
3333
private int $lengthOfLongestOptionName = 0;
3434
private readonly int $columnsAvailableForDescription;
35-
private ?bool $hasColor;
35+
private bool $hasColor;
3636

3737
public function __construct(?int $width = null, ?bool $withColor = null)
3838
{

0 commit comments

Comments
 (0)