Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Nov 20, 2024
2 parents 91c3f66 + 840c21f commit c684c83
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 54 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/analyse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@ on:

jobs:
tests:
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
php:
- 8.3
dependencies:
- "highest"
php: [8.3]
experimental:
- false

name: PHP${{ matrix.php }} on ${{ matrix.os }} (${{ matrix.dependencies }})
name: PHP:${{ matrix.php }} Code Analysis

steps:
- name: Checkout code
Expand All @@ -35,7 +30,7 @@ jobs:
- name: Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
dependency-versions: "highest"
composer-options: "--prefer-dist --no-cache"

- name: Installed dependencies
Expand All @@ -45,4 +40,4 @@ jobs:
run: vendor/bin/pint --test

- name: Execute Static Code Analysis
run: vendor/bin/phpstan analyse
run: vendor/bin/phpstan analyse --verbose
9 changes: 3 additions & 6 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php:
- 8.2
dependencies:
- "highest"
php: [8.3]
experimental:
- false

name: PHP${{ matrix.php }} on ${{ matrix.os }} (${{ matrix.dependencies }})
name: PHP:${{ matrix.php }} Code Coverage

steps:
- name: Checkout code
Expand All @@ -33,7 +30,7 @@ jobs:
- name: Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
dependency-versions: "highest"
composer-options: "--prefer-dist --prefer-stable"

- name: Installed dependencies
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"guzzlehttp/guzzle": "^7.2",
"symfony/console": "^6.0 || ^7.0",
"symfony/polyfill-ctype": "^1.9",
"symfony/polyfill-php83": "^1.28",
"symfony/polyfill-php83": "^1.31",
"symfony/process": "^6.0 || ^7.0"
},
"require-dev": {
"laravel/dusk": "^6.0 || ^7.0 || ^8.0",
"laravel/pint": "^1.4",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan": "^1.12",
"phpunit/phpunit": "^9.6"
},
"conflict": {
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ parameters:
level: 8

ignoreErrors:
# - identifier: missingType.generics
- identifier: missingType.iterableValue

treatPhpDocTypesAsCertain: false
15 changes: 2 additions & 13 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class Command extends SymfonyCommand
*/
protected bool $withSslVerification = true;

/**
* Configure the command options.
*/
/** {@inheritDoc */
#[\Override]
protected function configure(): void
{
Expand All @@ -47,16 +45,7 @@ protected function configure(): void
->addOption('ssl-no-verify', null, InputOption::VALUE_NONE, 'Bypass SSL certificate verification when installing through a proxy');
}

/**
* Initializes the command after the input has been bound and before the input
* is validated.
*
* This is mainly useful when a lot of commands extends one main command
* where some things need to be initialized based on the input arguments and options.
*
* @see InputInterface::bind()
* @see InputInterface::validate()
*/
/** {@inheritDoc */
#[\Override]
protected function initialize(InputInterface $input, OutputInterface $output): void
{
Expand Down
9 changes: 2 additions & 7 deletions src/Concerns/DetectsChromeVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ protected function installedChromeVersion(string $operatingSystem, ?string $dire
continue;
}

preg_match('/(\d+)\.(\d+)\.(\d+)(\.\d+)?/', $process->getOutput(), $matches);

if (! isset($matches[1])) {
if (preg_match('/(\d+)\.(\d+)\.(\d+)(\.\d+)?/', $process->getOutput(), $matches) === false) {
continue;
}

Expand Down Expand Up @@ -161,10 +159,7 @@ protected function installedChromeDriverVersion(string $operatingSystem, string
$process->run();

if ($process->getExitCode() == 0) {
preg_match('/ChromeDriver\s(\d+)\.(\d+)\.(\d+)(\.\d+)?\s[\w\D]+/', $process->getOutput(), $matches);

if (isset($matches[1])) {
/** @var array{0: string, 1: string, 2: string, 3: string} $matches */
if (preg_match('/ChromeDriver\s(\d+)\.(\d+)\.(\d+)(\.\d+)?\s[\w\D]+/', $process->getOutput(), $matches) !== false) {
$semver = implode('.', [$matches[1], $matches[2], $matches[3]]);

return [
Expand Down
10 changes: 2 additions & 8 deletions src/DetectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
#[AsCommand(name: 'detect', description: 'Detect the installed Chrome/Chromium version.')]
class DetectCommand extends Command
{
/**
* Configure the command options.
*/
/** {@inheritDoc */
#[\Override]
protected function configure(): void
{
Expand All @@ -30,11 +28,7 @@ protected function configure(): void
parent::configure();
}

/**
* Execute the command.
*
* @return int 0 if everything went fine, or an exit code
*/
/** {@inheritDoc */
#[\Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
10 changes: 2 additions & 8 deletions src/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
#[AsCommand(name: 'update', description: 'Install the ChromeDriver binary.')]
class UpdateCommand extends Command
{
/**
* Configure the command options.
*/
/** {@inheritDoc */
#[\Override]
protected function configure(): void
{
Expand All @@ -31,11 +29,7 @@ protected function configure(): void
parent::configure();
}

/**
* Execute the command.
*
* @return int 0 if everything went fine, or an exit code
*/
/** {@inheritDoc */
#[\Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down

0 comments on commit c684c83

Please sign in to comment.