From 54d2cf55984ec59201f18a682f3e9a6d417332f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C3=B3jcik?= Date: Tue, 29 Sep 2026 09:08:39 +0200 Subject: [PATCH 1/2] feat: support Symfony 5.4 and 6.4 --- .gitattributes | 3 + .github/workflows/ci.yaml | 63 +++++++++++++++++++ composer.json | 7 ++- .../DependencyInjection/HubSpotBundleTest.php | 48 ++++++++++++++ 4 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yaml create mode 100644 tests/DependencyInjection/HubSpotBundleTest.php diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cb445a2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +/.github export-ignore +/tests export-ignore +/phpunit.xml.dist export-ignore diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6abf34e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,63 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + tests: + name: PHP ${{ matrix.php }}, ${{ matrix.name }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + # monolith-app composer.lock + - name: monolith-app lock + php: '7.4' + pins: symfony/config:4.4.44 symfony/dependency-injection:3.4.47 symfony/http-kernel:3.4.49 symfony/yaml:4.4.45 hubspot/hubspot-php:3.2.1 guzzlehttp/guzzle:6.5.8 guzzlehttp/psr7:1.9.1 + - name: lowest deps + php: '7.4' + flags: --prefer-lowest --prefer-stable + - name: Symfony 3.4 + php: '7.4' + pins: symfony/config:3.4.* symfony/dependency-injection:3.4.* symfony/http-kernel:3.4.* symfony/yaml:3.4.* + - name: Symfony 4.4 + php: '7.4' + pins: symfony/config:4.4.* symfony/dependency-injection:4.4.* symfony/http-kernel:4.4.* symfony/yaml:4.4.* + - name: Symfony 4.4 + php: '8.1' + pins: symfony/config:4.4.* symfony/dependency-injection:4.4.* symfony/http-kernel:4.4.* symfony/yaml:4.4.* + - name: Symfony 5.4 + php: '8.1' + pins: symfony/config:5.4.* symfony/dependency-injection:5.4.* symfony/http-kernel:5.4.* symfony/yaml:5.4.* + - name: Symfony 6.4 + php: '8.2' + pins: symfony/config:6.4.* symfony/dependency-injection:6.4.* symfony/http-kernel:6.4.* symfony/yaml:6.4.* + - name: latest deps + php: '8.3' + env: + PINS: ${{ matrix.pins }} + COMPOSER_NO_SECURITY_BLOCKING: 1 + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: none + + - name: Install dependencies + run: | + if [ -n "$PINS" ]; then composer require --no-update --no-interaction $PINS; fi + composer update --no-interaction --no-progress ${{ matrix.flags }} + composer show | grep -E '^(hubspot/hubspot-php|symfony/(config|dependency-injection|http-kernel|yaml)) ' + + - name: PHPUnit + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 8e39caf..046ad63 100644 --- a/composer.json +++ b/composer.json @@ -19,9 +19,10 @@ ], "require": { "php": "^7.4 || ^8.0", - "symfony/dependency-injection": "^2.8 || ^3.0 || ^4.0", - "symfony/config": "^2.8 || ^3.0 || ^4.0", - "symfony/http-kernel": "^2.8 || ^3.0 || ^4.0", + "symfony/dependency-injection": "^2.8 || ^3.0 || ^4.0 || ^5.4 || ^6.4", + "symfony/config": "^2.8 || ^3.0 || ^4.0 || ^5.4 || ^6.4", + "symfony/http-kernel": "^2.8 || ^3.0 || ^4.0 || ^5.4 || ^6.4", + "symfony/yaml": "^2.8 || ^3.0 || ^4.0 || ^5.4 || ^6.4", "hubspot/hubspot-php": "^3.1" }, "require-dev": { diff --git a/tests/DependencyInjection/HubSpotBundleTest.php b/tests/DependencyInjection/HubSpotBundleTest.php new file mode 100644 index 0000000..8a155a1 --- /dev/null +++ b/tests/DependencyInjection/HubSpotBundleTest.php @@ -0,0 +1,48 @@ +registerExtension($bundle->getContainerExtension()); + $container->loadFromExtension('hub_spot', [ + 'key' => 'legacy-key', + 'proxy' => [ + 'custom_url' => 'https://proxy.example.com/hubspot-gateway', + 'custom_headers' => ['x-api-key' => 'test-api-key', 'Authorization' => 'Bearer token'], + ], + ]); + $bundle->build($container); + $container->addCompilerPass(new PublicHubSpotPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION); + $container->compile(); + + self::assertStringContainsString('class HubSpotTestContainer', (new PhpDumper($container))->dump(['class' => 'HubSpotTestContainer'])); + + $factory = $container->get('hubspot'); + self::assertInstanceOf(ProxyAwareFactory::class, $factory); + $client = new \ReflectionProperty(ProxyAwareFactory::class, 'client'); + $client->setAccessible(true); + self::assertInstanceOf(ProxyClient::class, $client->getValue($factory)); + } +} + +final class PublicHubSpotPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container) + { + $container->getDefinition('hubspot')->setPublic(true); + } +} From e88cdc2fb915f6c487d0cc121b422bfbae46e7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C3=B3jcik?= Date: Sun, 18 Oct 2026 11:00:23 +0200 Subject: [PATCH 2/2] ci: drop the pinned mixed-version leg --- .github/workflows/ci.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6abf34e..8e50e21 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,10 +17,6 @@ jobs: fail-fast: false matrix: include: - # monolith-app composer.lock - - name: monolith-app lock - php: '7.4' - pins: symfony/config:4.4.44 symfony/dependency-injection:3.4.47 symfony/http-kernel:3.4.49 symfony/yaml:4.4.45 hubspot/hubspot-php:3.2.1 guzzlehttp/guzzle:6.5.8 guzzlehttp/psr7:1.9.1 - name: lowest deps php: '7.4' flags: --prefer-lowest --prefer-stable