From 4a428412afdb67385d1f097b0bcf7df43b8a3474 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 17:40:46 +0100 Subject: [PATCH 1/7] Only store build info on disk --- CHANGELOG.md | 6 ++++++ src/BuildInfo/BuildInfoStorage.php | 10 +++------- src/Deployment/Task/ResetBuildInfoTask.php | 4 ++-- src/Listener/ValidateAppListener.php | 3 +-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a2c98..7968767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +4.1.1 +===== + +* (improvement) Don't store build info in cache. + + 4.1.0 ===== diff --git a/src/BuildInfo/BuildInfoStorage.php b/src/BuildInfo/BuildInfoStorage.php index a8c5912..f09021d 100644 --- a/src/BuildInfo/BuildInfoStorage.php +++ b/src/BuildInfo/BuildInfoStorage.php @@ -10,14 +10,13 @@ final class BuildInfoStorage { - private const CACHE_KEY = "hosting.build-info"; + private ?BuildInfo $cache = null; /** */ public function __construct ( private readonly EventDispatcherInterface $dispatcher, private readonly Filesystem $filesystem, - private readonly CacheInterface $cache, private readonly string $filePath, ) {} @@ -25,10 +24,7 @@ public function __construct ( */ public function getBuildInfo () : BuildInfo { - return $this->cache->get( - self::CACHE_KEY, - $this->loadBuildInfo(...), - ); + return $this->cache ??= $this->loadBuildInfo(); } /** @@ -78,7 +74,7 @@ public function refresh () : void { // remove existing file $this->filesystem->remove($this->filePath); - $this->cache->delete(self::CACHE_KEY); + $this->cache = null; // refetch build info $event = new CollectBuildInfoEvent(); diff --git a/src/Deployment/Task/ResetBuildInfoTask.php b/src/Deployment/Task/ResetBuildInfoTask.php index 0ea5ab1..076e115 100644 --- a/src/Deployment/Task/ResetBuildInfoTask.php +++ b/src/Deployment/Task/ResetBuildInfoTask.php @@ -7,7 +7,7 @@ use Torr\Hosting\Deployment\TaskCli; /** - * Refreshes the build info. Should run as first task. + * Refreshes the build info. Should run as the first task. */ final readonly class ResetBuildInfoTask implements BuildHookInterface { @@ -29,6 +29,6 @@ public function getLabel () : string public function runPostBuild (TaskCli $io) : void { $this->buildInfo->refresh(); - $io->done("Build info reset"); + $io->done("build info stored"); } } diff --git a/src/Listener/ValidateAppListener.php b/src/Listener/ValidateAppListener.php index bf7852f..43f60de 100644 --- a/src/Listener/ValidateAppListener.php +++ b/src/Listener/ValidateAppListener.php @@ -20,8 +20,7 @@ public function __construct ( public function onValidateApp (ValidateAppEvent $event) : void { // Technically this can't happen, as we can't set anything besides the - // correct type as tier. However we want to force parsing of the hosting tier, - // so that we catch invalid tiers. + // correct type as tier. However, we want to force parsing of the hosting tier so that we catch invalid tier values. // @phpstan-ignore-next-line instanceof.alwaysTrue (this is a dummy check, please read above for the explanation) if (!$this->environment->getTier() instanceof HostingTier) { From f4bece78f3bc3f0640d822935e5c2da8295b2edb Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:35:07 +0100 Subject: [PATCH 2/7] Bump cli --- composer.json | 2 +- src/Deployment/TaskCli.php | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/composer.json b/composer.json index cd69eff..2054242 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "ext-json": "*", "ext-mbstring": "*", "21torr/bundle-helpers": "^2.2", - "21torr/cli": "^1.2.3", + "21torr/cli": "^1.2.4", "psr/log": "^3.0", "symfony/cache": "^7.1", "symfony/cache-contracts": "^3.5", diff --git a/src/Deployment/TaskCli.php b/src/Deployment/TaskCli.php index 33ffdc1..75d0ea0 100644 --- a/src/Deployment/TaskCli.php +++ b/src/Deployment/TaskCli.php @@ -6,14 +6,4 @@ final class TaskCli extends TorrStyle { - /** - * - */ - public function done (string $message) : void - { - $this->write(\sprintf( - "✓ %s", - $message, - )); - } } From fff453e24f657fbfd3ed8999680c5a4c50c29210 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:36:37 +0100 Subject: [PATCH 3/7] Bump dependencies --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 1 + composer.json | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 408e2f2..d50fd21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: ['8.3'] + php: ['8.4'] steps: - name: Checkout Code diff --git a/CHANGELOG.md b/CHANGELOG.md index 7968767..7276a5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ===== * (improvement) Don't store build info in cache. +* (improvement) Bump dependencies. 4.1.0 diff --git a/composer.json b/composer.json index 2054242..2800ec9 100644 --- a/composer.json +++ b/composer.json @@ -11,31 +11,31 @@ ], "homepage": "https://github.com/21TORR/hosting-bundle", "require": { - "php": ">= 8.3", + "php": ">= 8.4", "ext-ctype": "*", "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", - "21torr/bundle-helpers": "^2.2", + "21torr/bundle-helpers": "^2.3.1", "21torr/cli": "^1.2.4", "psr/log": "^3.0", - "symfony/cache": "^7.1", - "symfony/cache-contracts": "^3.5", - "symfony/clock": "^7.1", - "symfony/config": "^7.1", - "symfony/console": "^7.1", - "symfony/dependency-injection": "^7.1", - "symfony/event-dispatcher-contracts": "^3.5", - "symfony/filesystem": "^7.1", - "symfony/framework-bundle": "^7.1", - "symfony/process": "^7.1" + "symfony/cache": "^7.4 || ^8.0", + "symfony/cache-contracts": "^3.6", + "symfony/clock": "^7.4 || ^8.0", + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/event-dispatcher-contracts": "^3.6", + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/process": "^7.4 || ^8.0" }, "require-dev": { "21torr/janus": "^1.4", "bamarni/composer-bin-plugin": "^1.8", - "doctrine/orm": "^3.0", + "doctrine/orm": "^3.6", "roave/security-advisories": "dev-latest", - "symfony/phpunit-bridge": "^7.1" + "symfony/phpunit-bridge": "^7.4 || ^8.0" }, "replace": { "symfony/polyfill-ctype": "*", From a9a887431e2d211c522326ec527a98c81ed4b6a6 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:37:55 +0100 Subject: [PATCH 4/7] Bump Janus --- composer.json | 203 +++++++++++++++--------------- phpstan.neon | 17 ++- vendor-bin/c-norm/composer.json | 2 +- vendor-bin/cs-fixer/composer.json | 2 +- vendor-bin/phpstan/composer.json | 14 +-- 5 files changed, 126 insertions(+), 112 deletions(-) diff --git a/composer.json b/composer.json index 2800ec9..b3718da 100644 --- a/composer.json +++ b/composer.json @@ -1,102 +1,103 @@ { - "name": "21torr/hosting", - "description": "Base bundle for hosting any Symfony-based application.", - "license": "MIT", - "type": "symfony-bundle", - "authors": [ - { - "name": "21TORR", - "homepage": "https://www.21torr.com/" - } - ], - "homepage": "https://github.com/21TORR/hosting-bundle", - "require": { - "php": ">= 8.4", - "ext-ctype": "*", - "ext-intl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "21torr/bundle-helpers": "^2.3.1", - "21torr/cli": "^1.2.4", - "psr/log": "^3.0", - "symfony/cache": "^7.4 || ^8.0", - "symfony/cache-contracts": "^3.6", - "symfony/clock": "^7.4 || ^8.0", - "symfony/config": "^7.4 || ^8.0", - "symfony/console": "^7.4 || ^8.0", - "symfony/dependency-injection": "^7.4 || ^8.0", - "symfony/event-dispatcher-contracts": "^3.6", - "symfony/filesystem": "^7.4 || ^8.0", - "symfony/framework-bundle": "^7.4 || ^8.0", - "symfony/process": "^7.4 || ^8.0" - }, - "require-dev": { - "21torr/janus": "^1.4", - "bamarni/composer-bin-plugin": "^1.8", - "doctrine/orm": "^3.6", - "roave/security-advisories": "dev-latest", - "symfony/phpunit-bridge": "^7.4 || ^8.0" - }, - "replace": { - "symfony/polyfill-ctype": "*", - "symfony/polyfill-iconv": "*", - "symfony/polyfill-intl-grapheme": "*", - "symfony/polyfill-intl-icu": "*", - "symfony/polyfill-intl-idn": "*", - "symfony/polyfill-intl-messageformatter": "*", - "symfony/polyfill-intl-normalizer": "*", - "symfony/polyfill-mbstring": "*", - "symfony/polyfill-php70": "*", - "symfony/polyfill-php71": "*", - "symfony/polyfill-php72": "*", - "symfony/polyfill-php73": "*", - "symfony/polyfill-php74": "*", - "symfony/polyfill-php80": "*", - "symfony/polyfill-php81": "*", - "symfony/polyfill-php82": "*", - "symfony/polyfill-php83": "*" - }, - "suggest": { - "doctrine/orm": "For automatic integration of health checks" - }, - "autoload": { - "psr-4": { - "Torr\\Hosting\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Torr\\Hosting\\": "tests/" - } - }, - "config": { - "allow-plugins": { - "bamarni/composer-bin-plugin": true - }, - "sort-packages": true - }, - "extra": { - "bamarni-bin": { - "bin-links": false, - "forward-command": true - }, - "branch-alias": { - "4.x-dev": "4.99.x-dev", - "dev-next": "4.99.x-dev" - } - }, - "scripts": { - "fix-lint": [ - "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --ansi", - "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer fix --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --no-interaction --ansi" - ], - "lint": [ - "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --dry-run --ansi", - "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --no-interaction --ansi" - ], - "test": [ - "simple-phpunit", - "vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v" - ] - } -} + "name": "21torr/hosting", + "description": "Base bundle for hosting any Symfony-based application.", + "license": "MIT", + "type": "symfony-bundle", + "authors": [ + { + "name": "21TORR", + "homepage": "https://www.21torr.com/" + } + ], + "homepage": "https://github.com/21TORR/hosting-bundle", + "require": { + "php": ">= 8.4", + "ext-ctype": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "21torr/bundle-helpers": "^2.3.1", + "21torr/cli": "^1.2.4", + "psr/log": "^3.0", + "symfony/cache": "^7.4 || ^8.0", + "symfony/cache-contracts": "^3.6", + "symfony/clock": "^7.4 || ^8.0", + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/event-dispatcher-contracts": "^3.6", + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/process": "^7.4 || ^8.0" + }, + "require-dev": { + "21torr/janus": "^2.0.2", + "bamarni/composer-bin-plugin": "^1.8.2", + "doctrine/orm": "^3.6", + "roave/security-advisories": "dev-latest", + "symfony/phpunit-bridge": "^7.4 || ^8.0" + }, + "replace": { + "symfony/polyfill-ctype": "*", + "symfony/polyfill-iconv": "*", + "symfony/polyfill-intl-grapheme": "*", + "symfony/polyfill-intl-icu": "*", + "symfony/polyfill-intl-idn": "*", + "symfony/polyfill-intl-messageformatter": "*", + "symfony/polyfill-intl-normalizer": "*", + "symfony/polyfill-mbstring": "*", + "symfony/polyfill-php70": "*", + "symfony/polyfill-php71": "*", + "symfony/polyfill-php72": "*", + "symfony/polyfill-php73": "*", + "symfony/polyfill-php74": "*", + "symfony/polyfill-php80": "*", + "symfony/polyfill-php81": "*", + "symfony/polyfill-php82": "*", + "symfony/polyfill-php83": "*" + }, + "suggest": { + "doctrine/orm": "For automatic integration of health checks" + }, + "autoload": { + "psr-4": { + "Torr\\Hosting\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\Torr\\Hosting\\": "tests/" + } + }, + "config": { + "allow-plugins": { + "21torr/janus": true, + "bamarni/composer-bin-plugin": true + }, + "sort-packages": true + }, + "extra": { + "bamarni-bin": { + "bin-links": false, + "forward-command": true + }, + "branch-alias": { + "4.x-dev": "4.99.x-dev", + "dev-next": "4.99.x-dev" + } + }, + "scripts": { + "fix-lint": [ + "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --ansi", + "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer fix --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" + ], + "lint": [ + "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --dry-run --ansi", + "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" + ], + "test": [ + "simple-phpunit", + "vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v" + ] + } +} \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index 7b95bf7..fd17d4b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,5 +2,18 @@ includes: - vendor/21torr/janus/phpstan/lib.neon parameters: - bootstrapFiles: - - vendor/bin/.phpunit/phpunit/vendor/autoload.php + +# If you use simple-phpunit, you need to uncomment the following line. +# Always make sure to first run simple-phpunit and then PHPStan. +# bootstrapFiles: +# - vendor/bin/.phpunit/phpunit/vendor/autoload.php + +# These are temporarily copied here, as normally they should be in the lib.neon of janus. +# However, due to a bug in PHPStan, this currently doesn't work (https://github.com/phpstan/phpstan/issues/12844) + excludePaths: + analyse: + - vendor + analyseAndScan: + - node_modules (?) + - var (?) + - vendor-bin diff --git a/vendor-bin/c-norm/composer.json b/vendor-bin/c-norm/composer.json index 29d96fe..43031c1 100644 --- a/vendor-bin/c-norm/composer.json +++ b/vendor-bin/c-norm/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "ergebnis/composer-normalize": "^2.42", + "ergebnis/composer-normalize": "^2.47", "roave/security-advisories": "dev-latest" }, "config": { diff --git a/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json index ceadfce..42e20ab 100644 --- a/vendor-bin/cs-fixer/composer.json +++ b/vendor-bin/cs-fixer/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "21torr/php-cs-fixer": "^1.1.1", + "21torr/php-cs-fixer": "^1.1.5", "roave/security-advisories": "dev-latest" } } diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index cf165ff..4eb9387 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -3,14 +3,14 @@ "php": "^8.3" }, "require-dev": { - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-deprecation-rules": "^1.2", - "phpstan/phpstan-doctrine": "^1.4", - "phpstan/phpstan-phpunit": "^1.4", - "phpstan/phpstan-symfony": "^1.4", + "phpstan/extension-installer": "^1.4.2", + "phpstan/phpstan": "^2.1.11", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-doctrine": "^2.0.2", + "phpstan/phpstan-phpunit": "^2.0.6", + "phpstan/phpstan-symfony": "^2.0.4", "roave/security-advisories": "dev-latest", - "staabm/phpstan-todo-by": "^0.1.25" + "staabm/phpstan-todo-by": "^0.2" }, "config": { "sort-packages": true, From e578881a17fa1cd1e59f9bfff733f567dd36f456 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:38:34 +0100 Subject: [PATCH 5/7] Require PHP 8.4+ --- CHANGELOG.md | 1 + composer.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7276a5a..006a839 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * (improvement) Don't store build info in cache. * (improvement) Bump dependencies. +* (improvement) Require PHP 8.4+ 4.1.0 diff --git a/composer.json b/composer.json index b3718da..edaf238 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,8 @@ "symfony/polyfill-php80": "*", "symfony/polyfill-php81": "*", "symfony/polyfill-php82": "*", - "symfony/polyfill-php83": "*" + "symfony/polyfill-php83": "*", + "symfony/polyfill-php84": "*" }, "suggest": { "doctrine/orm": "For automatic integration of health checks" From 903e309851aacd2d8ee32fe8421330042e69cb2a Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:42:21 +0100 Subject: [PATCH 6/7] Bump PHPUnit --- .gitignore | 2 +- composer.json | 4 +-- phpunit.xml | 38 +++++++++++------------- tests/BuildInfo/BuildInfoTest.php | 3 +- tests/Hosting/HostingEnvironmentTest.php | 3 +- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index b7c0b54..f523218 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.editorconfig /.php-cs-fixer.cache -/.phpunit.result.cache +/.phpunit.cache /composer.lock /vendor /vendor-bin/*/composer.lock diff --git a/composer.json b/composer.json index edaf238..766e898 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "doctrine/orm": "^3.6", "roave/security-advisories": "dev-latest", - "symfony/phpunit-bridge": "^7.4 || ^8.0" + "phpunit/phpunit": "^12.5" }, "replace": { "symfony/polyfill-ctype": "*", @@ -97,7 +97,7 @@ "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" ], "test": [ - "simple-phpunit", + "phpunit", "vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v" ] } diff --git a/phpunit.xml b/phpunit.xml index d9842ec..63270d1 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,25 +1,21 @@ - - - - - - - - - - - tests - tests/fixtures - - - - - - + + + + + + + + + + tests + tests/fixtures + + diff --git a/tests/BuildInfo/BuildInfoTest.php b/tests/BuildInfo/BuildInfoTest.php index 8554782..d170066 100644 --- a/tests/BuildInfo/BuildInfoTest.php +++ b/tests/BuildInfo/BuildInfoTest.php @@ -2,6 +2,7 @@ namespace Tests\Torr\Hosting\BuildInfo; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Clock\MockClock; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -31,8 +32,8 @@ public static function provideBuildInfoGitIntegration () : iterable } /** - * @dataProvider provideBuildInfoGitIntegration */ + #[DataProvider("provideBuildInfoGitIntegration")] public function testBuildInfoGitIntegration (?array $data, array $expected) : void { $versionFetcher = $this->createMock(GitVersionFetcher::class); diff --git a/tests/Hosting/HostingEnvironmentTest.php b/tests/Hosting/HostingEnvironmentTest.php index 2cf692c..d7be673 100644 --- a/tests/Hosting/HostingEnvironmentTest.php +++ b/tests/Hosting/HostingEnvironmentTest.php @@ -2,6 +2,7 @@ namespace Tests\Torr\Hosting\Hosting; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Torr\Hosting\Hosting\HostingEnvironment; use Torr\Hosting\Tier\HostingTier; @@ -45,8 +46,8 @@ public static function provideHostingTiers () : iterable } /** - * @dataProvider provideHostingTiers */ + #[DataProvider("provideHostingTiers")] public function testHostingTiers (string|HostingTier $value, HostingTier $expected) : void { $environment = new HostingEnvironment($value, false, "installation"); From 9c617ff563e358b397e91ed136213dac38e3082e Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 22 Jan 2026 18:43:36 +0100 Subject: [PATCH 7/7] Fix type issues --- composer.json | 204 ++++++++++++++--------------- src/BuildInfo/BuildInfoStorage.php | 2 +- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/composer.json b/composer.json index 766e898..57ebdd9 100644 --- a/composer.json +++ b/composer.json @@ -1,104 +1,104 @@ { - "name": "21torr/hosting", - "description": "Base bundle for hosting any Symfony-based application.", - "license": "MIT", - "type": "symfony-bundle", - "authors": [ - { - "name": "21TORR", - "homepage": "https://www.21torr.com/" - } - ], - "homepage": "https://github.com/21TORR/hosting-bundle", - "require": { - "php": ">= 8.4", - "ext-ctype": "*", - "ext-intl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "21torr/bundle-helpers": "^2.3.1", - "21torr/cli": "^1.2.4", - "psr/log": "^3.0", - "symfony/cache": "^7.4 || ^8.0", - "symfony/cache-contracts": "^3.6", - "symfony/clock": "^7.4 || ^8.0", - "symfony/config": "^7.4 || ^8.0", - "symfony/console": "^7.4 || ^8.0", - "symfony/dependency-injection": "^7.4 || ^8.0", - "symfony/event-dispatcher-contracts": "^3.6", - "symfony/filesystem": "^7.4 || ^8.0", - "symfony/framework-bundle": "^7.4 || ^8.0", - "symfony/process": "^7.4 || ^8.0" - }, - "require-dev": { - "21torr/janus": "^2.0.2", - "bamarni/composer-bin-plugin": "^1.8.2", - "doctrine/orm": "^3.6", - "roave/security-advisories": "dev-latest", - "phpunit/phpunit": "^12.5" - }, - "replace": { - "symfony/polyfill-ctype": "*", - "symfony/polyfill-iconv": "*", - "symfony/polyfill-intl-grapheme": "*", - "symfony/polyfill-intl-icu": "*", - "symfony/polyfill-intl-idn": "*", - "symfony/polyfill-intl-messageformatter": "*", - "symfony/polyfill-intl-normalizer": "*", - "symfony/polyfill-mbstring": "*", - "symfony/polyfill-php70": "*", - "symfony/polyfill-php71": "*", - "symfony/polyfill-php72": "*", - "symfony/polyfill-php73": "*", - "symfony/polyfill-php74": "*", - "symfony/polyfill-php80": "*", - "symfony/polyfill-php81": "*", - "symfony/polyfill-php82": "*", - "symfony/polyfill-php83": "*", - "symfony/polyfill-php84": "*" - }, - "suggest": { - "doctrine/orm": "For automatic integration of health checks" - }, - "autoload": { - "psr-4": { - "Torr\\Hosting\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Torr\\Hosting\\": "tests/" - } - }, - "config": { - "allow-plugins": { - "21torr/janus": true, - "bamarni/composer-bin-plugin": true - }, - "sort-packages": true - }, - "extra": { - "bamarni-bin": { - "bin-links": false, - "forward-command": true - }, - "branch-alias": { - "4.x-dev": "4.99.x-dev", - "dev-next": "4.99.x-dev" - } - }, - "scripts": { - "fix-lint": [ - "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --ansi", - "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer fix --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" - ], - "lint": [ - "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --dry-run --ansi", - "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" - ], - "test": [ - "phpunit", - "vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v" - ] - } + "name": "21torr/hosting", + "description": "Base bundle for hosting any Symfony-based application.", + "license": "MIT", + "type": "symfony-bundle", + "authors": [ + { + "name": "21TORR", + "homepage": "https://www.21torr.com/" + } + ], + "homepage": "https://github.com/21TORR/hosting-bundle", + "require": { + "php": ">= 8.4", + "ext-ctype": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "21torr/bundle-helpers": "^2.3.1", + "21torr/cli": "^1.2.4", + "psr/log": "^3.0", + "symfony/cache": "^7.4 || ^8.0", + "symfony/cache-contracts": "^3.6", + "symfony/clock": "^7.4 || ^8.0", + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/event-dispatcher-contracts": "^3.6", + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/process": "^7.4 || ^8.0" + }, + "require-dev": { + "21torr/janus": "^2.0.2", + "bamarni/composer-bin-plugin": "^1.8.2", + "doctrine/orm": "^3.6", + "phpunit/phpunit": "^12.5", + "roave/security-advisories": "dev-latest" + }, + "replace": { + "symfony/polyfill-ctype": "*", + "symfony/polyfill-iconv": "*", + "symfony/polyfill-intl-grapheme": "*", + "symfony/polyfill-intl-icu": "*", + "symfony/polyfill-intl-idn": "*", + "symfony/polyfill-intl-messageformatter": "*", + "symfony/polyfill-intl-normalizer": "*", + "symfony/polyfill-mbstring": "*", + "symfony/polyfill-php70": "*", + "symfony/polyfill-php71": "*", + "symfony/polyfill-php72": "*", + "symfony/polyfill-php73": "*", + "symfony/polyfill-php74": "*", + "symfony/polyfill-php80": "*", + "symfony/polyfill-php81": "*", + "symfony/polyfill-php82": "*", + "symfony/polyfill-php83": "*", + "symfony/polyfill-php84": "*" + }, + "suggest": { + "doctrine/orm": "For automatic integration of health checks" + }, + "autoload": { + "psr-4": { + "Torr\\Hosting\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\Torr\\Hosting\\": "tests/" + } + }, + "config": { + "allow-plugins": { + "21torr/janus": true, + "bamarni/composer-bin-plugin": true + }, + "sort-packages": true + }, + "extra": { + "bamarni-bin": { + "bin-links": false, + "forward-command": true + }, + "branch-alias": { + "4.x-dev": "4.99.x-dev", + "dev-next": "4.99.x-dev" + } + }, + "scripts": { + "fix-lint": [ + "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --ansi", + "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer fix --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" + ], + "lint": [ + "@composer bin c-norm normalize \"$(pwd)/composer.json\" --indent-style tab --indent-size 1 --dry-run --ansi", + "vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --allow-unsupported-php-version=yes --no-interaction --ansi" + ], + "test": [ + "phpunit", + "vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v" + ] + } } \ No newline at end of file diff --git a/src/BuildInfo/BuildInfoStorage.php b/src/BuildInfo/BuildInfoStorage.php index f09021d..9d55877 100644 --- a/src/BuildInfo/BuildInfoStorage.php +++ b/src/BuildInfo/BuildInfoStorage.php @@ -3,7 +3,6 @@ namespace Torr\Hosting\BuildInfo; use Symfony\Component\Filesystem\Filesystem; -use Symfony\Contracts\Cache\CacheInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Torr\Hosting\Event\CollectBuildInfoEvent; use Torr\Hosting\Exception\InvalidBuildInfoException; @@ -56,6 +55,7 @@ private function loadBuildInfo () : BuildInfo // sort info before passing it to build info uksort($data, "strnatcasecmp"); + /** @var array $data */ return new BuildInfo($data); } catch (\JsonException $exception)