From fd0d75a343abec4bc3e7a1a8e268fd1b417b01a0 Mon Sep 17 00:00:00 2001 From: Dominik Chrastecky Date: Thu, 24 Aug 2023 11:58:58 +0200 Subject: [PATCH 1/3] Chore: Update codebase to php 8.2 --- .github/workflows/tests-8.x.yaml | 29 ++++++++++++++ .github/workflows/tests.yaml | 4 +- .github/workflows/transpile.yaml | 68 ++++++++++---------------------- composer.json | 2 +- rector.73.php | 0 rector.74.php | 0 rector.80.php | 10 +++++ rector.81.php | 10 +++++ 8 files changed, 73 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/tests-8.x.yaml mode change 100644 => 100755 rector.73.php mode change 100644 => 100755 rector.74.php create mode 100644 rector.80.php create mode 100644 rector.81.php diff --git a/.github/workflows/tests-8.x.yaml b/.github/workflows/tests-8.x.yaml new file mode 100644 index 0000000..1f309c5 --- /dev/null +++ b/.github/workflows/tests-8.x.yaml @@ -0,0 +1,29 @@ +name: Tests (8.x) +on: + repository_dispatch: + types: + - trigger-8x-tests + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + version: ['8.0', '8.1'] + steps: + - name: TBD + run: echo 'To be done' +# - name: Setup PHP +# uses: shivammathur/setup-php@v2 +# with: +# php-version: ${{ matrix.version }} +# - name: Checkout Code +# uses: actions/checkout@v2 +# with: +# ref: php-${{ matrix.version }} +# submodules: true +# - name: Install Dependencies +# run: composer install +# - name: Run tests +# run: composer phpunit diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dd46d17..d39aafc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['8.0'] + version: ['8.2'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['8.0'] + version: ['8.2'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/transpile.yaml b/.github/workflows/transpile.yaml index 7504642..cf90269 100644 --- a/.github/workflows/transpile.yaml +++ b/.github/workflows/transpile.yaml @@ -1,4 +1,4 @@ -name: Transpile to 7.x +name: Transpile to older versions on: push: branches: @@ -6,74 +6,48 @@ on: workflow_dispatch: jobs: - transpile_73: - name: Transpile to PHP 7.3 + transpile: + name: Transpile to older versions of PHP runs-on: ubuntu-latest + strategy: + matrix: + version: ['7.3', '7.4', '8.0', '8.1'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.2 - name: Checkout Code uses: actions/checkout@v2 - with: - ref: main - - name: Install Dependencies - run: composer install - - name: Transpile to 7.3 - run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.73.php src - - name: Update composer.json version - run: 'sed -i -e ''s/"php": "\^8.0"/"php": "\^7.3"/'' composer.json' - - name: Update README - run: sed -i '1s/^/# This branch is auto generated\n/' README.md - - name: Commit PHP 7.3 version - uses: actions-x/commit@v6 - with: - files: . - branch: php-7.3 - name: GitHub Actions - email: noreply@github.com - message: Transpiled to PHP 7.3 - force: true - transpile_74: - name: Transpile to PHP 7.4 - runs-on: ubuntu-latest - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.0 - - name: Checkout Code - uses: actions/checkout@v2 - with: - ref: main - name: Install Dependencies run: composer install - - name: Transpile to 7.4 - run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.74.php src + - name: Transpile to ${{ matrix.version }} + run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.$(echo ${{ matrix.version }} | sed -e 's/\.//').php src - name: Update composer.json version - run: 'sed -i -e ''s/"php": "\^8.0"/"php": "\^7.4"/'' composer.json' + run: 'sed -i -e ''s/"php": "\^8.2"/"php": "\^${{ matrix.version }}"/'' composer.json' - name: Update README run: sed -i '1s/^/# This branch is auto generated\n/' README.md - - name: Commit PHP 7.4 version + - name: Commit PHP ${{ matrix.version }} version uses: actions-x/commit@v6 with: files: . - branch: php-7.4 + branch: php-${{ matrix.version }} name: GitHub Actions email: noreply@github.com - message: Transpiled to PHP 7.4 + message: Transpiled to PHP ${{ matrix.version }} force: true - trigger_7x_tests: - name: Trigger 7.x tests + trigger_tests: + name: Trigger tests runs-on: ubuntu-latest needs: - - transpile_73 - - transpile_74 + - transpile + strategy: + matrix: + version: [7x, 8x] steps: - - name: Trigger 7.x tests + - name: Trigger ${{ matrix.version }} tests uses: peter-evans/repository-dispatch@v1 with: token: ${{ secrets.REPO_TOKEN }} - event-type: trigger-7x-tests + event-type: trigger-${{ matrix.version }}-tests client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' diff --git a/composer.json b/composer.json index 1063548..e68b48a 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "symfony/cache": "^5.0 | ^6.0", "nyholm/psr7": "^1.0", "unleash/client": "^1.6", - "php": "^8.0" + "php": "^8.2" }, "autoload": { "psr-4": { diff --git a/rector.73.php b/rector.73.php old mode 100644 new mode 100755 diff --git a/rector.74.php b/rector.74.php old mode 100644 new mode 100755 diff --git a/rector.80.php b/rector.80.php new file mode 100644 index 0000000..a2a687f --- /dev/null +++ b/rector.80.php @@ -0,0 +1,10 @@ +sets([ + DowngradeLevelSetList::DOWN_TO_PHP_80, + ]); +}; diff --git a/rector.81.php b/rector.81.php new file mode 100644 index 0000000..db2212d --- /dev/null +++ b/rector.81.php @@ -0,0 +1,10 @@ +sets([ + DowngradeLevelSetList::DOWN_TO_PHP_81, + ]); +}; From cb9eb8e9e46eb8d1fd352aadbd8a5e384c02a744 Mon Sep 17 00:00:00 2001 From: Dominik Chrastecky Date: Thu, 24 Aug 2023 12:07:19 +0200 Subject: [PATCH 2/3] Chore: Make classes readonly --- src/Attribute/ControllerAttribute.php | 3 +++ src/Attribute/IsEnabled.php | 3 +++ src/Attribute/IsNotEnabled.php | 3 +++ src/Context/SymfonyContextProvider.php | 2 +- src/Context/SymfonyUnleashContext.php | 10 +++++----- src/DependencyInjection/Compiler/BootstrapResolver.php | 5 ++++- .../Compiler/CacheServiceResolverCompilerPass.php | 5 ++++- .../Compiler/HttpServicesResolverCompilerPass.php | 5 ++++- src/DependencyInjection/Configuration.php | 10 +++++++--- .../UnleashSymfonyClientExtension.php | 3 +++ src/Event/BeforeExceptionThrownForAttributeEvent.php | 2 +- src/Event/ContextValueNotFoundEvent.php | 5 +++-- src/Event/UnleashEvents.php | 2 +- src/Listener/ControllerAttributeResolver.php | 2 +- src/Twig/FeatureTagNode.php | 6 +++--- src/Twig/FeatureTagTokenParser.php | 5 +++-- src/Twig/UnleashTwigExtension.php | 10 +++++----- src/Unleash/UnleashDecorator.php | 2 +- 18 files changed, 55 insertions(+), 28 deletions(-) diff --git a/src/Attribute/ControllerAttribute.php b/src/Attribute/ControllerAttribute.php index 9b33c94..49df9f3 100644 --- a/src/Attribute/ControllerAttribute.php +++ b/src/Attribute/ControllerAttribute.php @@ -5,6 +5,9 @@ use JetBrains\PhpStorm\ExpectedValues; use Symfony\Component\HttpFoundation\Response; +/** + * @todo Make internal in next major + */ interface ControllerAttribute { public function getFeatureName(): string; diff --git a/src/Attribute/IsEnabled.php b/src/Attribute/IsEnabled.php index c72b080..124d10e 100644 --- a/src/Attribute/IsEnabled.php +++ b/src/Attribute/IsEnabled.php @@ -6,6 +6,9 @@ use JetBrains\PhpStorm\ExpectedValues; use Symfony\Component\HttpFoundation\Response; +/** + * @todo Make readonly in next major + */ #[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)] final class IsEnabled implements ControllerAttribute { diff --git a/src/Attribute/IsNotEnabled.php b/src/Attribute/IsNotEnabled.php index 9de0f94..cf9efe4 100644 --- a/src/Attribute/IsNotEnabled.php +++ b/src/Attribute/IsNotEnabled.php @@ -6,6 +6,9 @@ use JetBrains\PhpStorm\ExpectedValues; use Symfony\Component\HttpFoundation\Response; +/** + * @todo Make readonly in next major + */ #[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)] final class IsNotEnabled implements ControllerAttribute { diff --git a/src/Context/SymfonyContextProvider.php b/src/Context/SymfonyContextProvider.php index d939e0a..c1c6eec 100644 --- a/src/Context/SymfonyContextProvider.php +++ b/src/Context/SymfonyContextProvider.php @@ -5,7 +5,7 @@ use Unleash\Client\Configuration\Context; use Unleash\Client\ContextProvider\UnleashContextProvider; -final class SymfonyContextProvider implements UnleashContextProvider +final readonly class SymfonyContextProvider implements UnleashContextProvider { public function __construct( private SymfonyUnleashContext $context diff --git a/src/Context/SymfonyUnleashContext.php b/src/Context/SymfonyUnleashContext.php index d087d8f..b99de44 100644 --- a/src/Context/SymfonyUnleashContext.php +++ b/src/Context/SymfonyUnleashContext.php @@ -33,12 +33,12 @@ final class SymfonyUnleashContext implements Context * @param array $customProperties */ public function __construct( - private ?TokenStorageInterface $userTokenStorage, - private ?string $userIdField, + private readonly ?TokenStorageInterface $userTokenStorage, + private readonly ?string $userIdField, private array $customProperties, - private ?RequestStack $requestStack, - private ?ExpressionLanguage $expressionLanguage, - private ?EventDispatcherInterface $eventDispatcher, + private readonly ?RequestStack $requestStack, + private readonly ?ExpressionLanguage $expressionLanguage, + private readonly ?EventDispatcherInterface $eventDispatcher, private ?string $environment = null, ) { } diff --git a/src/DependencyInjection/Compiler/BootstrapResolver.php b/src/DependencyInjection/Compiler/BootstrapResolver.php index e51ad9c..f23ab53 100644 --- a/src/DependencyInjection/Compiler/BootstrapResolver.php +++ b/src/DependencyInjection/Compiler/BootstrapResolver.php @@ -8,7 +8,10 @@ use Symfony\Component\DependencyInjection\Definition; use Unleash\Client\Bootstrap\FileBootstrapProvider; -final class BootstrapResolver implements CompilerPassInterface +/** + * @todo Make internal in next major + */ +final readonly class BootstrapResolver implements CompilerPassInterface { private const TAG = 'unleash.client.bootstrap_provider'; diff --git a/src/DependencyInjection/Compiler/CacheServiceResolverCompilerPass.php b/src/DependencyInjection/Compiler/CacheServiceResolverCompilerPass.php index 6b04e4d..2f55350 100644 --- a/src/DependencyInjection/Compiler/CacheServiceResolverCompilerPass.php +++ b/src/DependencyInjection/Compiler/CacheServiceResolverCompilerPass.php @@ -11,7 +11,10 @@ use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; -final class CacheServiceResolverCompilerPass implements CompilerPassInterface +/** + * @todo Make internal in next major + */ +final readonly class CacheServiceResolverCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { diff --git a/src/DependencyInjection/Compiler/HttpServicesResolverCompilerPass.php b/src/DependencyInjection/Compiler/HttpServicesResolverCompilerPass.php index 99e725c..b0c2cb5 100644 --- a/src/DependencyInjection/Compiler/HttpServicesResolverCompilerPass.php +++ b/src/DependencyInjection/Compiler/HttpServicesResolverCompilerPass.php @@ -12,7 +12,10 @@ use Symfony\Component\HttpClient\Psr18Client; use Symfony\Contracts\HttpClient\HttpClientInterface; -final class HttpServicesResolverCompilerPass implements CompilerPassInterface +/** + * @todo Make internal in next major + */ +final readonly class HttpServicesResolverCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 8cccd3e..94f3f2c 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -12,13 +12,17 @@ use Twig\Extension\ExtensionInterface; use Unleash\Client\Bootstrap\BootstrapProvider; -final class Configuration implements ConfigurationInterface +/** + * @todo Make internal in next major + */ +final readonly class Configuration implements ConfigurationInterface { /** * @param array $defaultStrategyNames */ - public function __construct(private array $defaultStrategyNames) - { + public function __construct( + private array $defaultStrategyNames, + ) { } public function getConfigTreeBuilder(): TreeBuilder diff --git a/src/DependencyInjection/UnleashSymfonyClientExtension.php b/src/DependencyInjection/UnleashSymfonyClientExtension.php index 132dd0b..19e92aa 100644 --- a/src/DependencyInjection/UnleashSymfonyClientExtension.php +++ b/src/DependencyInjection/UnleashSymfonyClientExtension.php @@ -14,6 +14,9 @@ use Twig\Extension\ExtensionInterface; use Unleash\Client\Strategy\StrategyHandler; +/** + * @todo Make internal in next major + */ final class UnleashSymfonyClientExtension extends Extension { /** diff --git a/src/Event/BeforeExceptionThrownForAttributeEvent.php b/src/Event/BeforeExceptionThrownForAttributeEvent.php index 47fa63f..8a540e0 100644 --- a/src/Event/BeforeExceptionThrownForAttributeEvent.php +++ b/src/Event/BeforeExceptionThrownForAttributeEvent.php @@ -17,7 +17,7 @@ public function __construct( Response::HTTP_BAD_REQUEST, Response::HTTP_UNAUTHORIZED, ])] - private int $errorCode + private readonly int $errorCode, ) { } diff --git a/src/Event/ContextValueNotFoundEvent.php b/src/Event/ContextValueNotFoundEvent.php index 21524fd..6a5d057 100644 --- a/src/Event/ContextValueNotFoundEvent.php +++ b/src/Event/ContextValueNotFoundEvent.php @@ -8,8 +8,9 @@ final class ContextValueNotFoundEvent extends Event { private ?string $value = null; - public function __construct(private string $contextName) - { + public function __construct( + private readonly string $contextName + ) { } public function getContextName(): string diff --git a/src/Event/UnleashEvents.php b/src/Event/UnleashEvents.php index ae79068..7ea2bb9 100644 --- a/src/Event/UnleashEvents.php +++ b/src/Event/UnleashEvents.php @@ -2,7 +2,7 @@ namespace Unleash\Client\Bundle\Event; -final class UnleashEvents +final readonly class UnleashEvents { /** * @Event("Unleash\Client\Bundle\Event\ContextValueNotFoundEvent") diff --git a/src/Listener/ControllerAttributeResolver.php b/src/Listener/ControllerAttributeResolver.php index 40f358f..3e57207 100644 --- a/src/Listener/ControllerAttributeResolver.php +++ b/src/Listener/ControllerAttributeResolver.php @@ -25,7 +25,7 @@ use Unleash\Client\Exception\InvalidValueException; use Unleash\Client\Unleash; -final class ControllerAttributeResolver implements EventSubscriberInterface +final readonly class ControllerAttributeResolver implements EventSubscriberInterface { public function __construct( private Unleash $unleash, diff --git a/src/Twig/FeatureTagNode.php b/src/Twig/FeatureTagNode.php index e15c7e9..13f5a34 100644 --- a/src/Twig/FeatureTagNode.php +++ b/src/Twig/FeatureTagNode.php @@ -8,11 +8,11 @@ final class FeatureTagNode extends Node { public function __construct( - private string $featureName, - private Node $content, + private readonly string $featureName, + private readonly Node $content, int $line, string $tag, - private string $extensionClass + private readonly string $extensionClass ) { parent::__construct([], [], $line, $tag); } diff --git a/src/Twig/FeatureTagTokenParser.php b/src/Twig/FeatureTagTokenParser.php index 12abef9..37cbdeb 100644 --- a/src/Twig/FeatureTagTokenParser.php +++ b/src/Twig/FeatureTagTokenParser.php @@ -8,8 +8,9 @@ final class FeatureTagTokenParser extends AbstractTokenParser { - public function __construct(private string $extensionClass) - { + public function __construct( + private readonly string $extensionClass, + ) { } public function parse(Token $token): Node diff --git a/src/Twig/UnleashTwigExtension.php b/src/Twig/UnleashTwigExtension.php index 2943d64..c6cf238 100644 --- a/src/Twig/UnleashTwigExtension.php +++ b/src/Twig/UnleashTwigExtension.php @@ -14,11 +14,11 @@ final class UnleashTwigExtension extends AbstractExtension { public function __construct( - private Unleash $unleash, - private bool $functionsEnabled, - private bool $filtersEnabled, - private bool $testsEnabled, - private bool $tagsEnabled, + private readonly Unleash $unleash, + private readonly bool $functionsEnabled, + private readonly bool $filtersEnabled, + private readonly bool $testsEnabled, + private readonly bool $tagsEnabled, ) { } diff --git a/src/Unleash/UnleashDecorator.php b/src/Unleash/UnleashDecorator.php index 31a555f..af6af32 100644 --- a/src/Unleash/UnleashDecorator.php +++ b/src/Unleash/UnleashDecorator.php @@ -14,7 +14,7 @@ use Unleash\Client\Unleash; use Unleash\Client\Variant\VariantHandler; -final class UnleashDecorator implements Unleash +final readonly class UnleashDecorator implements Unleash { private Unleash $proxy; From 0fd4c0fca9e4d167996704f61c60488247ccd744 Mon Sep 17 00:00:00 2001 From: Dominik Chrastecky Date: Thu, 24 Aug 2023 12:14:45 +0200 Subject: [PATCH 3/3] Chore: Update release script --- .github/workflows/release.yaml | 100 +++++++++++++++++------------ composer.json | 3 +- src/Resources/config/services.yaml | 5 +- tests/check-version.php | 20 ++++++ 4 files changed, 84 insertions(+), 44 deletions(-) create mode 100644 tests/check-version.php diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 448a0d2..0c256b2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,7 +8,8 @@ on: workflow_dispatch: jobs: - build: + release_latest: + name: Release latest PHP version runs-on: ubuntu-latest steps: - name: Extract Version Name @@ -20,69 +21,84 @@ jobs: return context.payload.ref.replace(/refs\/tags\/release-/, ''); - name: Checkout Code uses: actions/checkout@v2 - - name: Create PHP 8 release tag + - name: Check if version is updated in SDK env: VERSION: ${{ steps.extract_name.outputs.result }} - run: git tag v${VERSION}80 - - name: Push PHP 8 release tag + run: php tests/check-version.php $VERSION + - name: Create latest release tag env: VERSION: ${{ steps.extract_name.outputs.result }} - run: git push origin v${VERSION}80 - - - name: Install Dependencies - run: composer install - - name: Transpile 7.3 - run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.73.php src - - name: Update composer.json version - run: 'sed -i -e ''s/"php": "\^8.0"/"php": "\^7.3"/'' composer.json' - - name: Commit PHP 7.3 version - run: | - git config --global --add safe.directory /github/workspace && \ - git config user.email noreply@github.com && \ - git config user.name "GitHub Actions" && \ - git checkout -b tmp-php-7.3-release && \ - git add . -v && \ - git commit -m "Transpile to PHP 7.3" && \ - git push origin tmp-php-7.3-release - - name: Create PHP 7.3 release tag + run: git tag v${VERSION}82 + - name: Push latest release tag env: VERSION: ${{ steps.extract_name.outputs.result }} - run: git tag v${VERSION}73 - - name: Push PHP 7.3 release tag - env: - VERSION: ${{ steps.extract_name.outputs.result }} - run: git push origin v${VERSION}73 - - name: Delete temporary branch - run: git push origin --delete tmp-php-7.3-release - + run: git push origin v${VERSION}82 + release_older: + name: Release older PHP version + runs-on: ubuntu-latest + strategy: + matrix: + version: ['7.3', '7.4', '8.0', '8.1'] + steps: + - name: Extract Version Name + id: extract_name + uses: actions/github-script@v4 + with: + result-encoding: string + script: | + return context.payload.ref.replace(/refs\/tags\/release-/, ''); + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 - name: Checkout Code uses: actions/checkout@v2 - name: Install Dependencies run: composer install - - name: Transpile 7.4 - run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.74.php src + - name: Check if version is updated in SDK + env: + VERSION: ${{ steps.extract_name.outputs.result }} + run: php tests/check-version.php $VERSION + - name: Transpile ${{ matrix.version }} + run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.$(echo ${{ matrix.version }} | sed -e 's/\.//').php src - name: Update composer.json version - run: 'sed -i -e ''s/"php": "\^8.0"/"php": "\^7.4"/'' composer.json' - - name: Commit PHP 7.4 version + run: 'sed -i -e ''s/"php": "\^8.2"/"php": "\^${{ matrix.version }}"/'' composer.json' + - name: Commit PHP ${{ matrix.version }} version run: | git config --global --add safe.directory /github/workspace && \ git config user.email noreply@github.com && \ git config user.name "GitHub Actions" && \ - git checkout -b tmp-php-7.4-release && \ + git checkout -b tmp-php-${{ matrix.version }}-release && \ git add . -v && \ - git commit -m "Transpile to PHP 7.4" && \ - git push origin tmp-php-7.4-release - - name: Create PHP 7.4 release tag + git commit -m "Transpile to PHP ${{ matrix.version }}" && \ + git push origin tmp-php-${{ matrix.version }}-release + - name: Create PHP ${{ matrix.version }} release tag env: VERSION: ${{ steps.extract_name.outputs.result }} - run: git tag v${VERSION}74 - - name: Push PHP 7.4 release tag + run: git tag v${VERSION}$(echo ${{ matrix.version }} | sed -e 's/\.//') + - name: Push PHP ${{ matrix.version }} release tag env: VERSION: ${{ steps.extract_name.outputs.result }} - run: git push origin v${VERSION}74 + run: git push origin v${VERSION}$(echo ${{ matrix.version }} | sed -e 's/\.//') - name: Delete temporary branch - run: git push origin --delete tmp-php-7.4-release + run: git push origin --delete tmp-php-${{ matrix.version }}-release + delete_tag: + name: Delete original tag + runs-on: ubuntu-latest + needs: + - release_latest + - release_older + steps: + - name: Extract Version Name + id: extract_name + uses: actions/github-script@v4 + with: + result-encoding: string + script: | + return context.payload.ref.replace(/refs\/tags\/release-/, ''); + - name: Checkout Code + uses: actions/checkout@v2 - name: Delete original tag env: VERSION: ${{ steps.extract_name.outputs.result }} diff --git a/composer.json b/composer.json index e68b48a..e6a3220 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "jetbrains/phpstorm-attributes": "^1.0", "symfony/security-core": "^5.0 | ^6.0", "symfony/expression-language": "^5.0 | ^6.0", - "twig/twig": "^3.3" + "twig/twig": "^3.3", + "symfony/yaml": "^6.3" }, "suggest": { "symfony/security-bundle": "For integration of Symfony users into Unleash context", diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 0093769..595ffd3 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -1,3 +1,6 @@ +parameters: + unleash.bundle.version: '0.9.14' + services: unleash.client.internal.original_context: @@ -117,7 +120,7 @@ services: - '@unleash.client.internal.request_factory' - '@unleash.client.configuration' - 'unleash-client-symfony' - - '0.9.14' + - '%unleash.bundle.version%' unleash.client.metrics_sender: class: Unleash\Client\Metrics\DefaultMetricsSender diff --git a/tests/check-version.php b/tests/check-version.php new file mode 100644 index 0000000..6541db9 --- /dev/null +++ b/tests/check-version.php @@ -0,0 +1,20 @@ +