Skip to content

Commit 0fde984

Browse files
Merge branch '11.5'
2 parents b27e055 + 284a099 commit 0fde984

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
@@ -617,6 +617,7 @@ private function parseExternal(array &$sections): void
617617
'EXPECTF',
618618
'EXPECTREGEX',
619619
];
620+
620621
$testDirectory = dirname($this->filename) . DIRECTORY_SEPARATOR;
621622

622623
foreach ($allowSections as $section) {
@@ -631,7 +632,11 @@ private function parseExternal(array &$sections): void
631632
);
632633
}
633634

634-
$sections[$section] = file_get_contents($testDirectory . $externalFilename);
635+
$contents = file_get_contents($testDirectory . $externalFilename);
636+
637+
assert($contents !== false && $contents !== '');
638+
639+
$sections[$section] = $contents;
635640
}
636641
}
637642
}
@@ -764,9 +769,11 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co
764769

765770
file_put_contents($files['job'], $job);
766771

767-
$job = $template->render();
772+
$rendered = $template->render();
773+
774+
assert($rendered !== '');
768775

769-
assert($job !== '');
776+
$job = $rendered;
770777
}
771778

772779
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 TestSuiteCollection $testSuite;
153153
private string $includeTestSuite;

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 string 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)