diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58161a7ad..5441f81fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,15 +23,16 @@ jobs: strategy: matrix: os: ['ubuntu-22.04'] - php: ['8.1', '8.2', '8.3'] + php: ['8.1', '8.2', '8.3', '8.4'] coverage: ['none'] include: - os: 'ubuntu-22.04' - php: '8.2' + php: '8.4' coverage: 'pcov' # Only test pre-installed (i.e. fast) versions of PHP on Windows. + # https://github.com/shivammathur/setup-php?tab=readme-ov-file#github-hosted-runners - os: 'windows-2022' - php: '8.2' + php: '8.3' coverage: 'none' steps: - name: Prepare Git diff --git a/composer.json b/composer.json index 631f87fe3..61310ac0b 100644 --- a/composer.json +++ b/composer.json @@ -10,20 +10,29 @@ "role": "Maintainer" } ], + "repositories": [ + { + "type": "vcs", "url": "https://github.com/ruudk/oauth2-client" + }, + { + "type": "vcs", "url": "https://github.com/Ayesh/safe" + } + ], "minimum-stability": "dev", "require": { "php": "^8.1", "ext-json": "*", - "acquia/drupal-environment-detector": "^1.2.0", + "acquia/drupal-environment-detector": "^1.7.0", "bugsnag/bugsnag": "^3.0", "composer/semver": "^3.3", "consolidation/self-update": "^3", "dflydev/dot-access-data": "^3", - "grasmash/expander": "^3", + "grasmash/expander": "^3.0.1", "guzzlehttp/guzzle": "^7.4", "http-interop/http-factory-guzzle": "^1.0", "laminas/laminas-validator": "^2.20.0", "league/csv": "^9.8", + "league/oauth2-client": "dev-patch-1 as 2.7.0", "loophp/phposinfo": "^1.7.2", "ltd-beget/dns-zone-configurator": "^1.3.0", "m4tthumphrey/php-gitlab-api": "^11.5", @@ -45,9 +54,9 @@ "symfony/process": "^6.3", "symfony/validator": "^6.3", "symfony/yaml": "^6.3", - "thecodingmachine/safe": "^2.4", + "thecodingmachine/safe": "dev-php84/nullability as 2.5.0", "typhonius/acquia-logstream": "^0.0.14", - "typhonius/acquia-php-sdk-v2": "^3.4.0", + "typhonius/acquia-php-sdk-v2": "^3.4.1", "vlucas/phpdotenv": "^5.5", "zumba/amplitude-php": "^1.0.4" }, diff --git a/composer.lock b/composer.lock index f1e722ce3..7b6dea3a7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,29 +4,28 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8e18ad1d86e2cea43d906b0ab2b94fc1", + "content-hash": "71b2dc1d9fc88eee892361edecfd0add", "packages": [ { "name": "acquia/drupal-environment-detector", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/acquia/drupal-environment-detector.git", - "reference": "396cc5ed5d7f9d40a8afbdc1800a189c15924450" + "reference": "4666ae67b422d209a8b11c9f886e3ef6d3f16778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acquia/drupal-environment-detector/zipball/396cc5ed5d7f9d40a8afbdc1800a189c15924450", - "reference": "396cc5ed5d7f9d40a8afbdc1800a189c15924450", + "url": "https://api.github.com/repos/acquia/drupal-environment-detector/zipball/4666ae67b422d209a8b11c9f886e3ef6d3f16778", + "reference": "4666ae67b422d209a8b11c9f886e3ef6d3f16778", "shasum": "" }, "conflict": { "acquia/blt": ">=12.0.0 <13.5.2" }, "require-dev": { - "acquia/coding-standards": "^1.0.0", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "phpunit/phpunit": "^9.1" + "acquia/coding-standards": "^3.0.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0" }, "type": "library", "extra": { @@ -55,9 +54,9 @@ "description": "Provides common methods for detecting the current Acquia environment", "support": { "issues": "https://github.com/acquia/drupal-environment-detector/issues", - "source": "https://github.com/acquia/drupal-environment-detector/tree/1.6.0" + "source": "https://github.com/acquia/drupal-environment-detector/tree/1.7.0" }, - "time": "2023-02-28T18:45:28+00:00" + "time": "2024-11-26T19:16:45+00:00" }, { "name": "brick/math", @@ -649,16 +648,16 @@ }, { "name": "grasmash/expander", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/grasmash/expander.git", - "reference": "bb1c1a2430957945cf08c5a62f5d72a6aa6a2c82" + "reference": "eea11b9afb0c32483b18b9009f4ca07b770e39f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grasmash/expander/zipball/bb1c1a2430957945cf08c5a62f5d72a6aa6a2c82", - "reference": "bb1c1a2430957945cf08c5a62f5d72a6aa6a2c82", + "url": "https://api.github.com/repos/grasmash/expander/zipball/eea11b9afb0c32483b18b9009f4ca07b770e39f4", + "reference": "eea11b9afb0c32483b18b9009f4ca07b770e39f4", "shasum": "" }, "require": { @@ -695,9 +694,9 @@ "description": "Expands internal property references in PHP arrays file.", "support": { "issues": "https://github.com/grasmash/expander/issues", - "source": "https://github.com/grasmash/expander/tree/3.0.0" + "source": "https://github.com/grasmash/expander/tree/3.0.1" }, - "time": "2022-05-10T13:14:49+00:00" + "time": "2024-11-25T23:28:05+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1489,16 +1488,16 @@ }, { "name": "league/oauth2-client", - "version": "2.7.0", + "version": "dev-patch-1", "source": { "type": "git", - "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "160d6274b03562ebeb55ed18399281d8118b76c8" + "url": "https://github.com/ruudk/oauth2-client.git", + "reference": "b7cf4b4bf0511210bc0159e400631076facd63f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/160d6274b03562ebeb55ed18399281d8118b76c8", - "reference": "160d6274b03562ebeb55ed18399281d8118b76c8", + "url": "https://api.github.com/repos/ruudk/oauth2-client/zipball/b7cf4b4bf0511210bc0159e400631076facd63f2", + "reference": "b7cf4b4bf0511210bc0159e400631076facd63f2", "shasum": "" }, "require": { @@ -1513,17 +1512,16 @@ "squizlabs/php_codesniffer": "^2.3 || ^3.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "League\\OAuth2\\Client\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "League\\OAuth2\\Client\\Test\\": "test/src/" + } + }, "license": [ "MIT" ], @@ -1542,20 +1540,19 @@ ], "description": "OAuth 2.0 Client Library", "keywords": [ - "Authentication", - "SSO", + "authentication", "authorization", "identity", "idp", "oauth", "oauth2", - "single sign on" + "single sign on", + "sso" ], "support": { - "issues": "https://github.com/thephpleague/oauth2-client/issues", - "source": "https://github.com/thephpleague/oauth2-client/tree/2.7.0" + "source": "https://github.com/ruudk/oauth2-client/tree/patch-1" }, - "time": "2023-04-16T18:19:15+00:00" + "time": "2024-10-31T09:22:57+00:00" }, { "name": "loophp/phposinfo", @@ -6103,16 +6100,16 @@ }, { "name": "thecodingmachine/safe", - "version": "v2.5.0", + "version": "dev-php84/nullability", "source": { "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" + "url": "https://github.com/Ayesh/safe.git", + "reference": "e75af75bd026b45b4a526499d324c5202224c570" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "url": "https://api.github.com/repos/Ayesh/safe/zipball/e75af75bd026b45b4a526499d324c5202224c570", + "reference": "e75af75bd026b45b4a526499d324c5202224c570", "shasum": "" }, "require": { @@ -6131,6 +6128,13 @@ } }, "autoload": { + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "deprecated/Exceptions/", + "generated/Exceptions/" + ], "files": [ "deprecated/apc.php", "deprecated/array.php", @@ -6220,25 +6224,27 @@ "generated/yaz.php", "generated/zip.php", "generated/zlib.php" + ] + }, + "scripts": { + "phpstan": [ + "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv" ], - "classmap": [ - "lib/DateTime.php", - "lib/DateTimeImmutable.php", - "lib/Exceptions/", - "deprecated/Exceptions/", - "generated/Exceptions/" + "cs-fix": [ + "phpcbf" + ], + "cs-check": [ + "phpcs" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHP core functions that throw exceptions instead of returning FALSE on error", "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" + "source": "https://github.com/Ayesh/safe/tree/php84/nullability" }, - "time": "2023-04-05T11:54:14+00:00" + "time": "2024-03-18T13:27:28+00:00" }, { "name": "typhonius/acquia-logstream", @@ -6298,16 +6304,16 @@ }, { "name": "typhonius/acquia-php-sdk-v2", - "version": "3.4.0", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/typhonius/acquia-php-sdk-v2.git", - "reference": "50018d6c14a8d562698dbd4906cd159fa6bbe518" + "reference": "c3acefe27f4abd39111c43b96e9c35d672df6f4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/typhonius/acquia-php-sdk-v2/zipball/50018d6c14a8d562698dbd4906cd159fa6bbe518", - "reference": "50018d6c14a8d562698dbd4906cd159fa6bbe518", + "url": "https://api.github.com/repos/typhonius/acquia-php-sdk-v2/zipball/c3acefe27f4abd39111c43b96e9c35d672df6f4e", + "reference": "c3acefe27f4abd39111c43b96e9c35d672df6f4e", "shasum": "" }, "require": { @@ -6351,7 +6357,7 @@ "description": "A PHP SDK for Acquia CloudAPI v2", "support": { "issues": "https://github.com/typhonius/acquia-php-sdk-v2/issues", - "source": "https://github.com/typhonius/acquia-php-sdk-v2/tree/3.4.0" + "source": "https://github.com/typhonius/acquia-php-sdk-v2/tree/3.4.1" }, "funding": [ { @@ -6359,7 +6365,7 @@ "type": "github" } ], - "time": "2024-11-19T20:57:53+00:00" + "time": "2024-11-25T23:17:17+00:00" }, { "name": "vlucas/phpdotenv", @@ -7614,16 +7620,16 @@ }, { "name": "composer/class-map-generator", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "98bbf6780e56e0fd2404fe4b82eb665a0f93b783" + "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/98bbf6780e56e0fd2404fe4b82eb665a0f93b783", - "reference": "98bbf6780e56e0fd2404fe4b82eb665a0f93b783", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915", + "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915", "shasum": "" }, "require": { @@ -7632,10 +7638,10 @@ "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { - "phpstan/phpstan": "^1.6", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-phpunit": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1.1 || ^2", "phpunit/phpunit": "^8", "symfony/filesystem": "^5.4 || ^6" }, @@ -7667,7 +7673,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.4.0" + "source": "https://github.com/composer/class-map-generator/tree/1.5.0" }, "funding": [ { @@ -7683,7 +7689,7 @@ "type": "tidelift" } ], - "time": "2024-10-03T18:14:00+00:00" + "time": "2024-11-25T16:11:06+00:00" }, { "name": "composer/composer", @@ -13197,9 +13203,25 @@ "time": "2022-06-03T18:03:27+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "league/oauth2-client", + "version": "dev-patch-1", + "alias": "2.7.0", + "alias_normalized": "2.7.0.0" + }, + { + "package": "thecodingmachine/safe", + "version": "dev-php84/nullability", + "alias": "2.5.0", + "alias_normalized": "2.5.0.0" + } + ], "minimum-stability": "dev", - "stability-flags": {}, + "stability-flags": { + "league/oauth2-client": 20, + "thecodingmachine/safe": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/src/AcsfApi/AcsfConnector.php b/src/AcsfApi/AcsfConnector.php index 69b1d3af2..56c8ade07 100644 --- a/src/AcsfApi/AcsfConnector.php +++ b/src/AcsfApi/AcsfConnector.php @@ -12,10 +12,8 @@ class AcsfConnector extends Connector { /** * @param array $config - * @param string|null $baseUri - * @param string|null $urlAccessToken */ - public function __construct(array $config, string $baseUri = null, string $urlAccessToken = null) + public function __construct(array $config, ?string $baseUri = null, ?string $urlAccessToken = null) { parent::__construct($config, $baseUri, $urlAccessToken); diff --git a/src/CloudApi/AccessTokenConnector.php b/src/CloudApi/AccessTokenConnector.php index 3642f0661..54a343c64 100644 --- a/src/CloudApi/AccessTokenConnector.php +++ b/src/CloudApi/AccessTokenConnector.php @@ -21,7 +21,7 @@ class AccessTokenConnector extends Connector /** * @param array $config */ - public function __construct(array $config, string $baseUri = null, string $urlAccessToken = null) + public function __construct(array $config, ?string $baseUri = null, ?string $urlAccessToken = null) { $this->accessToken = new AccessToken(['access_token' => $config['access_token']]); parent::__construct($config, $baseUri, $urlAccessToken); diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index 3b1649ab7..8cf13e379 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -146,7 +146,7 @@ private function exportDatabaseToArchiveDir( $this->fs->rename($dumpTempFilepath, $dumpFilepath); } - private function compressArchiveDirectory(string $archiveDir, string|bool|array|null $destinationDir, Closure $outputCallback = null): string + private function compressArchiveDirectory(string $archiveDir, string|bool|array|null $destinationDir, ?Closure $outputCallback = null): string { $destinationFilename = basename($archiveDir) . '.tar.gz'; $destinationFilepath = Path::join($destinationDir, $destinationFilename); diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 61918edbb..68e719fa4 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -524,10 +524,9 @@ protected function getLocalFilesDir(string $site): string } /** - * @param string|null $site * @return DatabaseResponse[] */ - protected function determineCloudDatabases(Client $acquiaCloudClient, EnvironmentResponse $chosenEnvironment, string $site = null, bool $multipleDbs = false): array + protected function determineCloudDatabases(Client $acquiaCloudClient, EnvironmentResponse $chosenEnvironment, ?string $site = null, bool $multipleDbs = false): array { $databasesRequest = new Databases($acquiaCloudClient); $databases = $databasesRequest->getAll($chosenEnvironment->uuid); @@ -1592,7 +1591,7 @@ private function composerInstall(?callable $outputCallback): void } } - protected function getDrushDatabaseConnectionStatus(Closure $outputCallback = null): bool + protected function getDrushDatabaseConnectionStatus(?Closure $outputCallback = null): bool { if (isset($this->drushHasActiveDatabaseConnection)) { return $this->drushHasActiveDatabaseConnection; @@ -1619,7 +1618,7 @@ protected function getDrushDatabaseConnectionStatus(Closure $outputCallback = nu return $this->drushHasActiveDatabaseConnection; } - protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string $dbName, string $dbPassword, Closure $outputCallback = null): string + protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string $dbName, string $dbPassword, ?Closure $outputCallback = null): string { $this->localMachineHelper->checkRequiredBinariesExist([ 'mysqldump', @@ -1857,7 +1856,7 @@ protected function checkAuthentication(): void } } - protected function waitForNotificationToComplete(Client $acquiaCloudClient, string $uuid, string $message, callable $success = null): bool + protected function waitForNotificationToComplete(Client $acquiaCloudClient, string $uuid, string $message, ?callable $success = null): bool { $notificationsResource = new Notifications($acquiaCloudClient); $notification = null; diff --git a/src/Command/Pull/PullCommandBase.php b/src/Command/Pull/PullCommandBase.php index c1edd15cf..387c35cde 100644 --- a/src/Command/Pull/PullCommandBase.php +++ b/src/Command/Pull/PullCommandBase.php @@ -176,7 +176,7 @@ protected function pullFiles(InputInterface $input, OutputInterface $output, Env $this->checklist->completePreviousItem(); } - private function pullCodeFromCloud(EnvironmentResponse $chosenEnvironment, Closure $outputCallback = null): void + private function pullCodeFromCloud(EnvironmentResponse $chosenEnvironment, ?Closure $outputCallback = null): void { $isDirty = $this->isLocalGitRepoDirty(); if ($isDirty) { @@ -195,7 +195,7 @@ private function pullCodeFromCloud(EnvironmentResponse $chosenEnvironment, Closu /** * Checks out the matching branch from a source environment. */ - private function checkoutBranchFromEnv(EnvironmentResponse $environment, Closure $outputCallback = null): void + private function checkoutBranchFromEnv(EnvironmentResponse $environment, ?Closure $outputCallback = null): void { $this->localMachineHelper->checkRequiredBinariesExist(['git']); $this->localMachineHelper->execute([ @@ -211,7 +211,7 @@ private function doImportRemoteDatabase( string $databaseName, string $databasePassword, string $localFilepath, - Closure $outputCallback = null + ?Closure $outputCallback = null ): void { $this->dropDbTables($databaseHost, $databaseUser, $databaseName, $databasePassword, $outputCallback); $this->importDatabaseDump($localFilepath, $databaseHost, $databaseUser, $databaseName, $databasePassword, $outputCallback); @@ -222,7 +222,7 @@ private function downloadDatabaseBackup( EnvironmentResponse $environment, DatabaseResponse $database, BackupResponse $backupResponse, - callable $outputCallback = null + ?callable $outputCallback = null ): string { if ($outputCallback) { $outputCallback('out', "Downloading backup $backupResponse->id"); @@ -357,7 +357,7 @@ protected function waitForBackup(string $notificationUuid, Client $acquiaCloudCl } } - private function connectToLocalDatabase(string $dbHost, string $dbUser, string $dbName, string $dbPassword, callable $outputCallback = null): void + private function connectToLocalDatabase(string $dbHost, string $dbUser, string $dbName, string $dbPassword, ?callable $outputCallback = null): void { if ($outputCallback) { $outputCallback('out', "Connecting to database $dbName"); @@ -425,7 +425,7 @@ private function dropDbTables(string $dbHost, string $dbUser, string $dbName, st } } - private function importDatabaseDump(string $localDumpFilepath, string $dbHost, string $dbUser, string $dbName, string $dbPassword, Closure $outputCallback = null): void + private function importDatabaseDump(string $localDumpFilepath, string $dbHost, string $dbUser, string $dbName, string $dbPassword, ?Closure $outputCallback = null): void { if ($outputCallback) { $outputCallback('out', "Importing downloaded file to database $dbName"); @@ -601,7 +601,7 @@ private function printDatabaseBackupInfo( } } - private function importRemoteDatabase(DatabaseResponse $database, string $localFilepath, Closure $outputCallback = null): void + private function importRemoteDatabase(DatabaseResponse $database, string $localFilepath, ?Closure $outputCallback = null): void { if ($database->flags->default) { // Easy case, import the default db into the default db. diff --git a/src/Command/Push/PushFilesCommand.php b/src/Command/Push/PushFilesCommand.php index 376002571..e60ef31bf 100644 --- a/src/Command/Push/PushFilesCommand.php +++ b/src/Command/Push/PushFilesCommand.php @@ -44,7 +44,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } - private function rsyncFilesToCloud(EnvironmentResponse $chosenEnvironment, callable $outputCallback = null, string $site = null): void + private function rsyncFilesToCloud(EnvironmentResponse $chosenEnvironment, ?callable $outputCallback = null, ?string $site = null): void { $sourceDir = $this->getLocalFilesDir($site); $destinationDir = $chosenEnvironment->sshUrl . ':' . $this->getCloudFilesDir($chosenEnvironment, $site); diff --git a/src/Command/Ssh/SshKeyCommandBase.php b/src/Command/Ssh/SshKeyCommandBase.php index 27398b5d5..b340b31a2 100644 --- a/src/Command/Ssh/SshKeyCommandBase.php +++ b/src/Command/Ssh/SshKeyCommandBase.php @@ -329,8 +329,9 @@ private function keyHasUploaded(Client $acquiaCloudClient, string $publicKey): b /** * @return array + * @throws \Acquia\Cli\Exception\AcquiaCliException */ - protected function determinePublicSshKey(string $filepath = null): array + protected function determinePublicSshKey(?string $filepath = null): array { if ($filepath) { $filepath = $this->localMachineHelper->getLocalFilepath($filepath); diff --git a/src/DataStore/JsonDataStore.php b/src/DataStore/JsonDataStore.php index 896e99831..659fae004 100644 --- a/src/DataStore/JsonDataStore.php +++ b/src/DataStore/JsonDataStore.php @@ -10,10 +10,8 @@ class JsonDataStore extends Datastore { /** * Creates a new store. - * - * @param \Symfony\Component\Config\Definition\ConfigurationInterface|null $configDefinition */ - public function __construct(string $path, ConfigurationInterface $configDefinition = null) + public function __construct(string $path, ?ConfigurationInterface $configDefinition = null) { parent::__construct($path); if ($this->fileSystem->exists($path)) { diff --git a/src/DataStore/YamlStore.php b/src/DataStore/YamlStore.php index c9040bda3..e021e666c 100644 --- a/src/DataStore/YamlStore.php +++ b/src/DataStore/YamlStore.php @@ -11,10 +11,8 @@ class YamlStore extends Datastore { /** * Creates a new store. - * - * @param \Symfony\Component\Config\Definition\ConfigurationInterface|null $configDefinition */ - public function __construct(string $path, ConfigurationInterface $configDefinition = null) + public function __construct(string $path, ?ConfigurationInterface $configDefinition = null) { parent::__construct($path); if ($this->fileSystem->exists($path)) { diff --git a/src/Helpers/LocalMachineHelper.php b/src/Helpers/LocalMachineHelper.php index 1712bb36b..fc2022a8d 100644 --- a/src/Helpers/LocalMachineHelper.php +++ b/src/Helpers/LocalMachineHelper.php @@ -79,7 +79,7 @@ public function checkRequiredBinariesExist(array $binaries = []): void /** * Executes a buffered command. */ - public function execute(array $cmd, callable $callback = null, string $cwd = null, ?bool $printOutput = true, float $timeout = null, array $env = null, bool $stdin = true): Process + public function execute(array $cmd, ?callable $callback = null, ?string $cwd = null, ?bool $printOutput = true, ?float $timeout = null, ?array $env = null, bool $stdin = true): Process { $process = new Process($cmd); $process = $this->configureProcess($process, $cwd, $printOutput, $timeout, $env, $stdin); @@ -95,12 +95,9 @@ public function execute(array $cmd, callable $callback = null, string $cwd = nul * * Windows does not support prepending commands with environment variables. * - * @param callable|null $callback - * @param string|null $cwd - * @param int|null $timeout * @param array|null $env */ - public function executeFromCmd(string $cmd, callable $callback = null, string $cwd = null, ?bool $printOutput = true, int $timeout = null, array $env = null): Process + public function executeFromCmd(string $cmd, ?callable $callback = null, ?string $cwd = null, ?bool $printOutput = true, ?int $timeout = null, ?array $env = null): Process { $process = Process::fromShellCommandline($cmd); $process = $this->configureProcess($process, $cwd, $printOutput, $timeout, $env); @@ -109,10 +106,9 @@ public function executeFromCmd(string $cmd, callable $callback = null, string $c } /** - * @param string|null $cwd * @param array|null $env */ - private function configureProcess(Process $process, string $cwd = null, ?bool $printOutput = true, float $timeout = null, array $env = null, bool $stdin = true): Process + private function configureProcess(Process $process, ?string $cwd = null, ?bool $printOutput = true, ?float $timeout = null, ?array $env = null, bool $stdin = true): Process { if (function_exists('posix_isatty') && $stdin && !@posix_isatty(STDIN)) { $process->setInput(STDIN); @@ -131,7 +127,7 @@ private function configureProcess(Process $process, string $cwd = null, ?bool $p return $process; } - private function executeProcess(Process $process, callable $callback = null, ?bool $printOutput = true): Process + private function executeProcess(Process $process, ?callable $callback = null, ?bool $printOutput = true): Process { if ($callback === null && $printOutput !== false) { $callback = function (mixed $type, mixed $buffer): void { @@ -366,7 +362,7 @@ public function isBrowserAvailable(): bool * by the user or a default browser could not be found. * @infection-ignore-all */ - public function startBrowser(string $uri = null, string $browser = null): bool + public function startBrowser(?string $uri = null, ?string $browser = null): bool { // We can only open a browser if we have a DISPLAY environment variable on // POSIX or are running Windows or OS X. diff --git a/src/Helpers/SshHelper.php b/src/Helpers/SshHelper.php index e1471e597..5ee12d357 100644 --- a/src/Helpers/SshHelper.php +++ b/src/Helpers/SshHelper.php @@ -28,10 +28,8 @@ public function __construct( /** * Execute the command in a remote environment. - * - * @param int|null $timeout */ - public function executeCommand(string $sshUrl, array $commandArgs, bool $printOutput = true, int $timeout = null): Process + public function executeCommand(string $sshUrl, array $commandArgs, bool $printOutput = true, ?int $timeout = null): Process { $commandSummary = $this->getCommandSummary($commandArgs);