From 32333a462f0ccd916b22a6c74e1118a0ba93955b Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 19 Nov 2024 14:00:27 -0800 Subject: [PATCH] CLI-1365: Warn when logs need to be created --- composer.json | 2 +- composer.lock | 206 +++++++++--------- src/Command/Api/ApiBaseCommand.php | 6 +- src/EventListener/ExceptionListener.php | 6 +- tests/phpunit/src/CommandTestBase.php | 4 +- .../src/Commands/Api/ApiCommandTest.php | 9 +- .../src/Commands/Remote/DrushCommandTest.php | 3 - .../src/Misc/LocalMachineHelperTest.php | 1 - 8 files changed, 124 insertions(+), 113 deletions(-) diff --git a/composer.json b/composer.json index 7b9b6f298..631f87fe3 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "symfony/yaml": "^6.3", "thecodingmachine/safe": "^2.4", "typhonius/acquia-logstream": "^0.0.14", - "typhonius/acquia-php-sdk-v2": "^3.3.2", + "typhonius/acquia-php-sdk-v2": "^3.4.0", "vlucas/phpdotenv": "^5.5", "zumba/amplitude-php": "^1.0.4" }, diff --git a/composer.lock b/composer.lock index 1ac072a4d..f1e722ce3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "97c6e43491869640bdc9380ade831447", + "content-hash": "8e18ad1d86e2cea43d906b0ab2b94fc1", "packages": [ { "name": "acquia/drupal-environment-detector", @@ -3923,16 +3923,16 @@ }, { "name": "symfony/console", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b" + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/897c2441ed4eec8a8a2c37b943427d24dba3f26b", - "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b", + "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", "shasum": "" }, "require": { @@ -3997,7 +3997,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.14" + "source": "https://github.com/symfony/console/tree/v6.4.15" }, "funding": [ { @@ -4013,20 +4013,20 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:40+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.4.13", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96" + "reference": "70ab1f65a4516ef741e519ea938e6aa465e6aa36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96", - "reference": "728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/70ab1f65a4516ef741e519ea938e6aa465e6aa36", + "reference": "70ab1f65a4516ef741e519ea938e6aa465e6aa36", "shasum": "" }, "require": { @@ -4078,7 +4078,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.13" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.15" }, "funding": [ { @@ -4094,7 +4094,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-11-09T06:56:25+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4732,16 +4732,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "ba020a321a95519303a3f09ec2824d34d601c388" + "reference": "9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ba020a321a95519303a3f09ec2824d34d601c388", - "reference": "ba020a321a95519303a3f09ec2824d34d601c388", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6", + "reference": "9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6", "shasum": "" }, "require": { @@ -4751,12 +4751,12 @@ "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.3" + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" }, "require-dev": { "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.3|^7.0", + "symfony/cache": "^6.4.12|^7.1.5", "symfony/dependency-injection": "^5.4|^6.0|^7.0", "symfony/expression-language": "^5.4|^6.0|^7.0", "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0", @@ -4789,7 +4789,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.14" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.15" }, "funding": [ { @@ -4805,20 +4805,20 @@ "type": "tidelift" } ], - "time": "2024-11-05T16:39:55+00:00" + "time": "2024-11-08T16:09:24+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "8278a947d0369754a47b758a9e17b72cab970951" + "reference": "b002a5b3947653c5aee3adac2a024ea615fd3ff5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8278a947d0369754a47b758a9e17b72cab970951", - "reference": "8278a947d0369754a47b758a9e17b72cab970951", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b002a5b3947653c5aee3adac2a024ea615fd3ff5", + "reference": "b002a5b3947653c5aee3adac2a024ea615fd3ff5", "shasum": "" }, "require": { @@ -4903,7 +4903,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.14" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.15" }, "funding": [ { @@ -4919,7 +4919,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:45:21+00:00" + "time": "2024-11-13T13:57:37+00:00" }, { "name": "symfony/options-resolver", @@ -5464,16 +5464,16 @@ }, { "name": "symfony/process", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "25214adbb0996d18112548de20c281be9f27279f" + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/25214adbb0996d18112548de20c281be9f27279f", - "reference": "25214adbb0996d18112548de20c281be9f27279f", + "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", + "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", "shasum": "" }, "require": { @@ -5505,7 +5505,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.14" + "source": "https://github.com/symfony/process/tree/v6.4.15" }, "funding": [ { @@ -5521,7 +5521,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:25:01+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "symfony/service-contracts", @@ -5608,16 +5608,16 @@ }, { "name": "symfony/string", - "version": "v6.4.13", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627" + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/38371c60c71c72b3d64d8d76f6b1bb81a2cc3627", - "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { @@ -5674,7 +5674,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.13" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -5690,7 +5690,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-13T13:31:12+00:00" }, { "name": "symfony/translation-contracts", @@ -5772,16 +5772,16 @@ }, { "name": "symfony/validator", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "dc259b85e59a6569e205966d447dec0a7d95facf" + "reference": "7541055cdaf54ff95f0735bf703d313374e8b20b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/dc259b85e59a6569e205966d447dec0a7d95facf", - "reference": "dc259b85e59a6569e205966d447dec0a7d95facf", + "url": "https://api.github.com/repos/symfony/validator/zipball/7541055cdaf54ff95f0735bf703d313374e8b20b", + "reference": "7541055cdaf54ff95f0735bf703d313374e8b20b", "shasum": "" }, "require": { @@ -5849,7 +5849,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.4.14" + "source": "https://github.com/symfony/validator/tree/v6.4.15" }, "funding": [ { @@ -5865,20 +5865,20 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:33:53+00:00" + "time": "2024-11-08T15:28:48+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "93c09246038178717a9c14b809ea8151ffcf7091" + "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/93c09246038178717a9c14b809ea8151ffcf7091", - "reference": "93c09246038178717a9c14b809ea8151ffcf7091", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", + "reference": "38254d5a5ac2e61f2b52f9caf54e7aa3c9d36b80", "shasum": "" }, "require": { @@ -5934,7 +5934,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.14" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.15" }, "funding": [ { @@ -5950,7 +5950,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:40+00:00" + "time": "2024-11-08T15:28:48+00:00" }, { "name": "symfony/var-exporter", @@ -6298,24 +6298,24 @@ }, { "name": "typhonius/acquia-php-sdk-v2", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/typhonius/acquia-php-sdk-v2.git", - "reference": "c6c8370e84e11d1ee18d89a3b5a4d5a8ed0b4474" + "reference": "50018d6c14a8d562698dbd4906cd159fa6bbe518" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/typhonius/acquia-php-sdk-v2/zipball/c6c8370e84e11d1ee18d89a3b5a4d5a8ed0b4474", - "reference": "c6c8370e84e11d1ee18d89a3b5a4d5a8ed0b4474", + "url": "https://api.github.com/repos/typhonius/acquia-php-sdk-v2/zipball/50018d6c14a8d562698dbd4906cd159fa6bbe518", + "reference": "50018d6c14a8d562698dbd4906cd159fa6bbe518", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^7.2", "league/oauth2-client": "^2.4", "php": "^8.0 | ^8.1 | ^8.2", - "symfony/cache": "^5 | ^6", - "symfony/filesystem": "^5.4 | ^6" + "symfony/cache": "^5 | ^6 | ^7", + "symfony/filesystem": "^5.4 | ^6 | ^7" }, "require-dev": { "eloquent/phony": "dev-main as 5.0.2", @@ -6351,7 +6351,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.3.2" + "source": "https://github.com/typhonius/acquia-php-sdk-v2/tree/3.4.0" }, "funding": [ { @@ -6359,7 +6359,7 @@ "type": "github" } ], - "time": "2024-10-10T19:26:23+00:00" + "time": "2024-11-19T20:57:53+00:00" }, { "name": "vlucas/phpdotenv", @@ -7687,16 +7687,16 @@ }, { "name": "composer/composer", - "version": "2.8.2", + "version": "2.8.3", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "6e543d03187c882ea1c6ba43add2467754427803" + "reference": "2a7c71266b2545a3bed9f4860734081963f6e688" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/6e543d03187c882ea1c6ba43add2467754427803", - "reference": "6e543d03187c882ea1c6ba43add2467754427803", + "url": "https://api.github.com/repos/composer/composer/zipball/2a7c71266b2545a3bed9f4860734081963f6e688", + "reference": "2a7c71266b2545a3bed9f4860734081963f6e688", "shasum": "" }, "require": { @@ -7710,7 +7710,7 @@ "justinrainbow/json-schema": "^5.3", "php": "^7.2.5 || ^8.0", "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^3.2", + "react/promise": "^2.11 || ^3.2", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.2", "seld/signal-handler": "^2.0", @@ -7781,7 +7781,7 @@ "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.8.2" + "source": "https://github.com/composer/composer/tree/2.8.3" }, "funding": [ { @@ -7797,7 +7797,7 @@ "type": "tidelift" } ], - "time": "2024-10-29T15:12:11+00:00" + "time": "2024-11-17T12:13:04+00:00" }, { "name": "composer/metadata-minifier", @@ -9035,28 +9035,28 @@ }, { "name": "jean85/pretty-package-versions", - "version": "2.0.6", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -9088,9 +9088,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2024-03-08T09:58:59+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "justinrainbow/json-schema", @@ -9217,16 +9217,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.3.6", + "version": "v1.3.7", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f865a58ea3a0107c336b7045104c75243fa59d96" + "reference": "4f48ade902b94323ca3be7646db16209ec76be3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f865a58ea3a0107c336b7045104c75243fa59d96", - "reference": "f865a58ea3a0107c336b7045104c75243fa59d96", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d", + "reference": "4f48ade902b94323ca3be7646db16209ec76be3d", "shasum": "" }, "require": { @@ -9274,7 +9274,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2024-11-11T17:06:04+00:00" + "time": "2024-11-14T18:34:49+00:00" }, { "name": "league/uri", @@ -10436,26 +10436,27 @@ }, { "name": "phpspec/prophecy", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" @@ -10499,22 +10500,22 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" }, - "time": "2024-02-29T11:52:51+00:00" + "time": "2024-11-19T13:12:41+00:00" }, { "name": "phpspec/prophecy-phpunit", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy-phpunit.git", - "reference": "16e1247e139434bce0bac09848bc5c8d882940fc" + "reference": "8819516c1b489ecee4c60db5f5432fac1ea8ac6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/16e1247e139434bce0bac09848bc5c8d882940fc", - "reference": "16e1247e139434bce0bac09848bc5c8d882940fc", + "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/8819516c1b489ecee4c60db5f5432fac1ea8ac6f", + "reference": "8819516c1b489ecee4c60db5f5432fac1ea8ac6f", "shasum": "" }, "require": { @@ -10522,6 +10523,9 @@ "phpspec/prophecy": "^1.18", "phpunit/phpunit": "^9.1 || ^10.1 || ^11.0" }, + "require-dev": { + "phpstan/phpstan": "^1.10" + }, "type": "library", "extra": { "branch-alias": { @@ -10551,9 +10555,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy-phpunit/issues", - "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.2.0" + "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.3.0" }, - "time": "2024-03-01T08:33:58+00:00" + "time": "2024-11-19T13:24:17+00:00" }, { "name": "phpstan/extension-installer", @@ -10652,16 +10656,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.10", + "version": "1.12.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "fc463b5d0fe906dcf19689be692c65c50406a071" + "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/fc463b5d0fe906dcf19689be692c65c50406a071", - "reference": "fc463b5d0fe906dcf19689be692c65c50406a071", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", + "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", "shasum": "" }, "require": { @@ -10706,7 +10710,7 @@ "type": "github" } ], - "time": "2024-11-11T15:37:09+00:00" + "time": "2024-11-17T14:08:01+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -13195,14 +13199,14 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.1", "ext-json": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "8.1.25" }, diff --git a/src/Command/Api/ApiBaseCommand.php b/src/Command/Api/ApiBaseCommand.php index 2af1251a0..4a6db5e0c 100644 --- a/src/Command/Api/ApiBaseCommand.php +++ b/src/Command/Api/ApiBaseCommand.php @@ -97,6 +97,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi /** * @throws \Acquia\Cli\Exception\AcquiaCliException * @throws \JsonException + * @throws \AcquiaCloudApi\Exception\ApiErrorException */ protected function execute(InputInterface $input, OutputInterface $output): int { @@ -122,8 +123,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $response = $acquiaCloudClient->request($this->method, $path); $exitCode = 0; } catch (ApiErrorException $exception) { - // Ignore PhpStorm warning here. - // @see https://youtrack.jetbrains.com/issue/WI-77190/Exception-is-never-thrown-when-thrown-from-submethod + if ($input->isInteractive()) { + throw $exception; + } $response = $exception->getResponseBody(); $exitCode = 1; } diff --git a/src/EventListener/ExceptionListener.php b/src/EventListener/ExceptionListener.php index d716ca499..039dc8ad7 100644 --- a/src/EventListener/ExceptionListener.php +++ b/src/EventListener/ExceptionListener.php @@ -10,6 +10,7 @@ use Symfony\Component\Console\Event\ConsoleErrorEvent; use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Exception\RuntimeException; +use TypeError; /** * Make exceptions warm and cuddly. @@ -82,6 +83,9 @@ public function onConsoleError(ConsoleErrorEvent $event): void } if ($error instanceof ApiErrorException) { + if (($command = $event->getCommand()) && $error->getResponseBody()->error === 'not_found' && $command->getName() === 'api:environments:log-download') { + $this->helpMessages[] = "You must create logs (api:environments:log-create) prior to downloading them"; + } switch ($errorMessage) { case "There are no available Cloud IDEs for this application.\n": $this->helpMessages[] = "Delete an existing IDE via messagesBgColor;fg=$this->messagesFgColor;options=bold>acli ide:delete or contact your Account Manager or Acquia Sales to purchase additional IDEs."; @@ -96,7 +100,7 @@ public function onConsoleError(ConsoleErrorEvent $event): void } } - if ($error instanceof \TypeError && str_contains($error->getMessage(), 'AcquiaCloudApi\Response')) { + if ($error instanceof TypeError && str_contains($error->getMessage(), 'AcquiaCloudApi\Response')) { $newErrorMessage = 'Cloud Platform API returned an unexpected data type. This could be due to missing permissions or a problem with your Cloud Platform application.'; } diff --git a/tests/phpunit/src/CommandTestBase.php b/tests/phpunit/src/CommandTestBase.php index 1f46fa0ea..c4faf3dbd 100644 --- a/tests/phpunit/src/CommandTestBase.php +++ b/tests/phpunit/src/CommandTestBase.php @@ -81,7 +81,7 @@ protected function setCommand(CommandBase $command): void * An array of strings representing each input passed to the command input * stream. */ - protected function executeCommand(array $args = [], array $inputs = [], int $verbosity = Output::VERBOSITY_VERY_VERBOSE): void + protected function executeCommand(array $args = [], array $inputs = [], int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE, ?bool $interactive = true): void { $cwd = $this->projectDir; $tester = $this->getCommandTester(); @@ -96,7 +96,7 @@ protected function executeCommand(array $args = [], array $inputs = [], int $ver } try { - $tester->execute($args, ['verbosity' => $verbosity]); + $tester->execute($args, ['verbosity' => $verbosity, 'interactive' => $interactive]); } catch (Exception $e) { if (getenv('ACLI_PRINT_COMMAND_OUTPUT')) { print $this->getDisplay(); diff --git a/tests/phpunit/src/Commands/Api/ApiCommandTest.php b/tests/phpunit/src/Commands/Api/ApiCommandTest.php index 761e13656..0e50fd7ba 100644 --- a/tests/phpunit/src/Commands/Api/ApiCommandTest.php +++ b/tests/phpunit/src/Commands/Api/ApiCommandTest.php @@ -10,6 +10,7 @@ use Acquia\Cli\Exception\AcquiaCliException; use Acquia\Cli\Tests\CommandTestBase; use AcquiaCloudApi\Exception\ApiErrorException; +use Overtrue\PHPLint\Output\OutputInterface; use Symfony\Component\Console\Exception\MissingInputException; use Symfony\Component\Filesystem\Path; use Symfony\Component\Yaml\Yaml; @@ -105,6 +106,10 @@ public function testArgumentsInteractionValidationFormat(): void /** * Tests invalid UUID. + * + * @throws \JsonException + * @throws \AcquiaCloudApi\Exception\ApiErrorException + * @throws \Exception */ public function testApiCommandErrorResponse(): void { @@ -117,7 +122,7 @@ public function testApiCommandErrorResponse(): void ->willThrow(new ApiErrorException($mockBody)) ->shouldBeCalled(); - // ApiCommandBase::convertApplicationAliastoUuid() will try to convert the invalid string to a uuid: + // ApiCommandBase::convertApplicationAliasToUuid() will try to convert the invalid string to a UUID: $this->clientProphecy->addQuery('filter', 'hosting=@*:' . $invalidUuid); $this->clientProphecy->request('get', '/applications')->willReturn([]); @@ -128,7 +133,7 @@ public function testApiCommandErrorResponse(): void '0', // Would you like to link the Cloud application Sample application to this repository? 'n', - ]); + ], \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE, false); // Assert. $output = $this->getDisplay(); diff --git a/tests/phpunit/src/Commands/Remote/DrushCommandTest.php b/tests/phpunit/src/Commands/Remote/DrushCommandTest.php index 4bb6ab4bc..379bc9e0f 100644 --- a/tests/phpunit/src/Commands/Remote/DrushCommandTest.php +++ b/tests/phpunit/src/Commands/Remote/DrushCommandTest.php @@ -27,13 +27,11 @@ public static function providerTestRemoteDrushCommand(): array return [ [ [ - '-vvv' => '', 'drush_command' => 'status --fields=db-status', ], ], [ [ - '-vvv' => '', 'drush_command' => 'status --fields=db-status', ], ], @@ -42,7 +40,6 @@ public static function providerTestRemoteDrushCommand(): array /** * @dataProvider providerTestRemoteDrushCommand - * @group serial */ public function testRemoteDrushCommand(array $args): void { diff --git a/tests/phpunit/src/Misc/LocalMachineHelperTest.php b/tests/phpunit/src/Misc/LocalMachineHelperTest.php index 54172807c..a8cfc7714 100644 --- a/tests/phpunit/src/Misc/LocalMachineHelperTest.php +++ b/tests/phpunit/src/Misc/LocalMachineHelperTest.php @@ -40,7 +40,6 @@ public function testExecuteFromCmd(bool $interactive, bool|null $isTty, bool|nul { $localMachineHelper = $this->localMachineHelper; $localMachineHelper->setIsTty($isTty); - $this->input->setInteractive($interactive); $process = $localMachineHelper->executeFromCmd('echo "hello world"', null, null, $printOutput); $this->assertTrue($process->isSuccessful()); assert(is_a($this->output, BufferedOutput::class));