Skip to content

Commit 9145fbc

Browse files
Assert assumptions
1 parent b5228fe commit 9145fbc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/TextUI/Command/Commands/VersionCheckCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace PHPUnit\TextUI\Command;
1111

1212
use const PHP_EOL;
13+
use function assert;
1314
use function sprintf;
1415
use function version_compare;
1516
use PHPUnit\Util\Http\Downloader;
@@ -34,9 +35,14 @@ public function __construct(Downloader $downloader, int $majorVersionNumber, str
3435

3536
public function execute(): Result
3637
{
37-
$latestVersion = $this->downloader->download('https://phar.phpunit.de/latest-version-of/phpunit');
38+
$latestVersion = $this->downloader->download('https://phar.phpunit.de/latest-version-of/phpunit');
39+
40+
assert($latestVersion !== false);
41+
3842
$latestCompatibleVersion = $this->downloader->download('https://phar.phpunit.de/latest-version-of/phpunit-' . $this->majorVersionNumber);
3943

44+
assert($latestCompatibleVersion !== false);
45+
4046
$notLatest = version_compare($latestVersion, $this->versionId, '>');
4147
$notLatestCompatible = version_compare($latestCompatibleVersion, $this->versionId, '>');
4248

0 commit comments

Comments
 (0)