Skip to content

Commit ae49c88

Browse files
Narrow type
1 parent f44ceb7 commit ae49c88

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/TextUI/Configuration/Xml/LoadedFromFileConfiguration.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
*/
2424
final readonly class LoadedFromFileConfiguration extends Configuration
2525
{
26+
/**
27+
* @psalm-var non-empty-string
28+
*/
2629
private string $filename;
2730
private ValidationResult $validationResult;
2831

@@ -32,6 +35,7 @@
3235
private array $warnings;
3336

3437
/**
38+
* @param non-empty-string $filename
3539
* @param list<non-empty-string> $warnings
3640
*/
3741
public function __construct(string $filename, ValidationResult $validationResult, ExtensionBootstrapCollection $extensions, Source $source, CodeCoverage $codeCoverage, Groups $groups, Logging $logging, Php $php, PHPUnit $phpunit, TestSuiteCollection $testSuite, array $warnings)
@@ -52,6 +56,9 @@ public function __construct(string $filename, ValidationResult $validationResult
5256
);
5357
}
5458

59+
/**
60+
* @psalm-return non-empty-string
61+
*/
5562
public function filename(): string
5663
{
5764
return $this->filename;

src/TextUI/Configuration/Xml/Loader.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public function load(string $filename): LoadedFromFileConfiguration
108108

109109
$configurationFileRealpath = realpath($filename);
110110

111+
assert($configurationFileRealpath !== false && $configurationFileRealpath !== '');
112+
111113
$warnings = [];
112114

113115
return new LoadedFromFileConfiguration(

0 commit comments

Comments
 (0)