Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
php: [8.1, 8.2, 8.3]
php: [8.1, 8.2, 8.3, 8.4]
dependencies: [locked]
include:
- os: ubuntu-latest
Expand All @@ -54,6 +54,9 @@ jobs:
- os: ubuntu-latest
php: 8.3
dependencies: lowest
- os: ubuntu-latest
php: 8.4
dependencies: lowest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
Expand Down
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,17 @@
"symfony/console": "^6.0",
"symfony/filesystem": "^6.0",
"symfony/http-client": "^6.0",
"symfony/polyfill-php80": "^1.28",
"symfony/process": "^6.0",
"thecodingmachine/safe": "^2.0"
"thecodingmachine/safe": "^3.0"
},
"require-dev": {
"doctrine/coding-standard": "^12.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^10.0",
"roave/security-advisories": "dev-latest",
"thecodingmachine/phpstan-safe-rule": "^1.2",
"thecodingmachine/phpstan-strict-rules": "^1.0"
"thecodingmachine/phpstan-safe-rule": "^1.2"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 2 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: max
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for lowering the level? Max always defaults to the highest level available in the release. (Being level 10 as of PHPStan 2.0)

Copy link
Copy Markdown
Contributor Author

@ddebin ddebin Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New level max is equivalent to 10 and needs a lot of warnings fixed (mostly dealing with mixed and untyped arrays), maybe outside the scope of this PR.
https://phpstan.org/blog/phpstan-2-0-released-level-10-elephpants#level-10

Copy link
Copy Markdown
Contributor

@KevinVanSonsbeek KevinVanSonsbeek Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative would be to keep it on max, but for the time being baseline the new warnings.

That way the new errors are atleast tracked, and the new checks would be applied to any new logic added to the repository in the future. But i'm not sure what @dbrekelmans his view is on that

(edit, fixed the mention)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it's outside the scope of this PR, but it would be best to go back up to max level. It doesn't need to block this PR from being merged. If either of you is willing to produce a follow-up PR where we go back up to max level (and ideally fix the new warnings), that would be greatly appreciated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can propose this next PR.

level: 9
paths:
- src
- tests
Expand All @@ -8,5 +8,4 @@ parameters:
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
2 changes: 1 addition & 1 deletion src/Command/DetectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($innerReturnCode > $returnCode) {
$returnCode = $innerReturnCode;
}
} catch (Throwable $exception) { // @phpstan-ignore-line
} catch (Throwable $exception) {
if ($io->isVerbose()) {
$io->warning(sprintf('Could not execute command "%s".', $commandName));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Input/CpuArchitectureOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function description(): string
);
}

public function default(): string|null
public function default(): string
{
return CpuArchitecture::detectFromPhp()->value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Input/InstallPathArgument.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function description(): string
return 'Location where the driver will be installed';
}

public function default(): string|null
public function default(): string
{
return '.';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Input/OperatingSystemOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function description(): string
);
}

public function default(): string|null
public function default(): string
{
return OperatingSystem::fromFamily(Family::from(PHP_OS_FAMILY))->value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Input/VersionOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function description(): string
return 'Driver version to install';
}

public function default(): string|null
public function default(): string
{
return self::LATEST;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Driver/GeckoDriver/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use DBrekelmans\BrowserDriverInstaller\Driver\Downloader as DownloaderInterface;
use DBrekelmans\BrowserDriverInstaller\Driver\Driver;
use DBrekelmans\BrowserDriverInstaller\Driver\DriverName;
use DBrekelmans\BrowserDriverInstaller\Exception\NotImplemented;
use DBrekelmans\BrowserDriverInstaller\OperatingSystem\OperatingSystem;
use RuntimeException;
use Safe\Exceptions\FilesystemException;
Expand Down Expand Up @@ -47,7 +46,7 @@ public function download(Driver $driver, string $location): string
{
try {
$archive = $this->downloadArchive($driver);
} catch (NotImplemented | FilesystemException | IOException | TransportExceptionInterface $exception) {
} catch (FilesystemException | IOException | TransportExceptionInterface $exception) {
throw new RuntimeException('Something went wrong downloading the geckodriver archive.', 0, $exception);
}

Expand Down
1 change: 1 addition & 0 deletions src/Driver/GeckoDriver/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use RuntimeException;
use Symfony\Contracts\HttpClient\HttpClientInterface;

use function krsort;
use function Safe\json_decode;
use function sprintf;

Expand Down
8 changes: 4 additions & 4 deletions src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public static function fromString(string $versionString): self
}

return new self(
(string) $matches['major'],
(string) $matches['minor'],
isset($matches['patch']) ? (string) $matches['patch'] : null,
isset($matches['build']) ? (string) $matches['build'] : null,
$matches['major'],
$matches['minor'],
$matches['patch'] ?? null,
$matches['build'] ?? null,
);
} catch (PcreException $exception) {
throw new InvalidArgumentException(
Expand Down