From 86a99bedea5f776d7e2d99d2c74b68e8c17ddb9d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 21 May 2026 07:52:49 +0200 Subject: [PATCH] PHPStan: cleanup setup --- phpstan.neon | 11 +++++++++-- src/Configuration.php | 3 +++ tests/bootstrap.php | 5 +---- tests/constants.php | 7 +++++++ 4 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 tests/constants.php diff --git a/phpstan.neon b/phpstan.neon index 5bb654de6..962b0c2d5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,9 +9,16 @@ parameters: - recipe - contrib + bootstrapFiles: + - tests/constants.php + + dynamicConstantNames: + DEPLOYER_VERSION: string + DEPLOYER_BIN: string + MASTER_ENDPOINT: string + MASTER_TOKEN: string + ignoreErrors: - - "#^Constant DEPLOYER_VERSION not found\\.$#" - - "#^Constant DEPLOYER_BIN not found\\.$#" - "#^Constant MASTER_ENDPOINT not found\\.$#" - "#^Constant MASTER_TOKEN not found\\.$#" - "#CpanelPhp#" diff --git a/src/Configuration.php b/src/Configuration.php index 4f0a85f4b..d0deced73 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -17,6 +17,9 @@ use function Deployer\Support\is_closure; use function Deployer\Support\normalize_line_endings; +/** + * @implements \ArrayAccess + */ class Configuration implements \ArrayAccess { private ?Configuration $parent; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 0495692ab..d21521f43 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -21,10 +21,7 @@ set_include_path(__DIR__ . '/..' . PATH_SEPARATOR . get_include_path()); putenv('DEPLOYER_LOCAL_WORKER=true'); -define('DEPLOYER_BIN', __DIR__ . '/../bin/dep'); -define('__FIXTURES__', __DIR__ . '/fixtures'); -define('__REPOSITORY__', __DIR__ . '/fixtures/repository'); -define('__TEMP_DIR__', sys_get_temp_dir() . '/deployer'); +require_once __DIR__ . '/constants.php'; require_once __DIR__ . '/spec/SpecTest.php'; diff --git a/tests/constants.php b/tests/constants.php new file mode 100644 index 000000000..eba0049b6 --- /dev/null +++ b/tests/constants.php @@ -0,0 +1,7 @@ +