diff --git a/README.md b/README.md index 7396f9c..381d93b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +# This branch is auto generated [![Download](https://img.shields.io/packagist/dt/unleash/symfony-client-bundle.svg)](https://packagist.org/packages/unleash/symfony-client-bundle) A Symfony bundle for PHP implementation of the [Unleash protocol](https://www.getunleash.io/) diff --git a/composer.json b/composer.json index 1685e53..3d6db8d 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "symfony/cache": "^5.0 | ^6.0 | ^7.0", "nyholm/psr7": "^1.0", "unleash/client": "^2.4", - "php": "^8.2" + "php": "^8.0" }, "autoload": { "psr-4": { diff --git a/src/Command/TestFlagCommand.php b/src/Command/TestFlagCommand.php index e34598f..7b29384 100644 --- a/src/Command/TestFlagCommand.php +++ b/src/Command/TestFlagCommand.php @@ -18,8 +18,8 @@ final class TestFlagCommand extends Command { public function __construct( string $name, - private readonly Unleash $unleash, - private readonly CacheInterface $cache, + private Unleash $unleash, + private CacheInterface $cache, ) { parent::__construct($name); } diff --git a/src/Context/SymfonyContextProvider.php b/src/Context/SymfonyContextProvider.php index c1c6eec..d939e0a 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 readonly class SymfonyContextProvider implements UnleashContextProvider +final class SymfonyContextProvider implements UnleashContextProvider { public function __construct( private SymfonyUnleashContext $context diff --git a/src/Context/SymfonyUnleashContext.php b/src/Context/SymfonyUnleashContext.php index fd4c965..81b86b2 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 readonly ?TokenStorageInterface $userTokenStorage, - private readonly ?string $userIdField, + private ?TokenStorageInterface $userTokenStorage, + private ?string $userIdField, private array $customProperties, - private readonly ?RequestStack $requestStack, - private readonly ?ExpressionLanguage $expressionLanguage, - private readonly ?EventDispatcherInterface $eventDispatcher, + private ?RequestStack $requestStack, + private ?ExpressionLanguage $expressionLanguage, + private ?EventDispatcherInterface $eventDispatcher, private ?string $environment = null, ) { } diff --git a/src/DependencyInjection/Compiler/BootstrapResolver.php b/src/DependencyInjection/Compiler/BootstrapResolver.php index bf9beed..6411b3f 100644 --- a/src/DependencyInjection/Compiler/BootstrapResolver.php +++ b/src/DependencyInjection/Compiler/BootstrapResolver.php @@ -12,7 +12,7 @@ /** * @todo Make internal in next major */ -final readonly class BootstrapResolver implements CompilerPassInterface +final 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 2f55350..3985375 100644 --- a/src/DependencyInjection/Compiler/CacheServiceResolverCompilerPass.php +++ b/src/DependencyInjection/Compiler/CacheServiceResolverCompilerPass.php @@ -14,7 +14,7 @@ /** * @todo Make internal in next major */ -final readonly class CacheServiceResolverCompilerPass implements CompilerPassInterface +final 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 b0c2cb5..d741992 100644 --- a/src/DependencyInjection/Compiler/HttpServicesResolverCompilerPass.php +++ b/src/DependencyInjection/Compiler/HttpServicesResolverCompilerPass.php @@ -15,7 +15,7 @@ /** * @todo Make internal in next major */ -final readonly class HttpServicesResolverCompilerPass implements CompilerPassInterface +final class HttpServicesResolverCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 674c6a4..86c5d0f 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -15,7 +15,7 @@ /** * @todo Make internal in next major */ -final readonly class Configuration implements ConfigurationInterface +final class Configuration implements ConfigurationInterface { /** * @param array $defaultStrategyNames diff --git a/src/DependencyInjection/Dsn/LateBoundDsnParameter.php b/src/DependencyInjection/Dsn/LateBoundDsnParameter.php index 76d2710..b692d02 100644 --- a/src/DependencyInjection/Dsn/LateBoundDsnParameter.php +++ b/src/DependencyInjection/Dsn/LateBoundDsnParameter.php @@ -4,7 +4,7 @@ use Stringable; -final readonly class LateBoundDsnParameter implements Stringable +final class LateBoundDsnParameter implements Stringable { public function __construct( private string $envName, diff --git a/src/DependencyInjection/Dsn/StaticStringableParameter.php b/src/DependencyInjection/Dsn/StaticStringableParameter.php index 1476477..abc5df2 100644 --- a/src/DependencyInjection/Dsn/StaticStringableParameter.php +++ b/src/DependencyInjection/Dsn/StaticStringableParameter.php @@ -4,7 +4,7 @@ use Stringable; -final readonly class StaticStringableParameter implements Stringable +final class StaticStringableParameter implements Stringable { public function __construct( private string $value, diff --git a/src/Event/BeforeExceptionThrownForAttributeEvent.php b/src/Event/BeforeExceptionThrownForAttributeEvent.php index 8a540e0..281ce50 100644 --- a/src/Event/BeforeExceptionThrownForAttributeEvent.php +++ b/src/Event/BeforeExceptionThrownForAttributeEvent.php @@ -16,8 +16,7 @@ public function __construct( Response::HTTP_FORBIDDEN, Response::HTTP_BAD_REQUEST, Response::HTTP_UNAUTHORIZED, - ])] - private readonly int $errorCode, + ])]private int $errorCode, ) { } diff --git a/src/Event/ContextValueNotFoundEvent.php b/src/Event/ContextValueNotFoundEvent.php index 6a5d057..882d3fa 100644 --- a/src/Event/ContextValueNotFoundEvent.php +++ b/src/Event/ContextValueNotFoundEvent.php @@ -9,7 +9,7 @@ final class ContextValueNotFoundEvent extends Event private ?string $value = null; public function __construct( - private readonly string $contextName + private string $contextName ) { } diff --git a/src/Event/UnleashEvents.php b/src/Event/UnleashEvents.php index 7ea2bb9..ae79068 100644 --- a/src/Event/UnleashEvents.php +++ b/src/Event/UnleashEvents.php @@ -2,7 +2,7 @@ namespace Unleash\Client\Bundle\Event; -final readonly class UnleashEvents +final class UnleashEvents { /** * @Event("Unleash\Client\Bundle\Event\ContextValueNotFoundEvent") diff --git a/src/Listener/ControllerAttributeResolver.php b/src/Listener/ControllerAttributeResolver.php index 3e57207..34c0f0f 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 readonly class ControllerAttributeResolver implements EventSubscriberInterface +final class ControllerAttributeResolver implements EventSubscriberInterface { public function __construct( private Unleash $unleash, @@ -63,12 +63,11 @@ public function onControllerResolved(ControllerEvent $event): void [$class, $method] = $controller; $reflectionClass = new ReflectionClass($class); $reflectionMethod = $reflectionClass->getMethod($method); + $item0Unpacked = $reflectionClass->getAttributes(ControllerAttribute::class, ReflectionAttribute::IS_INSTANCEOF); + $item1Unpacked = $reflectionMethod->getAttributes(ControllerAttribute::class, ReflectionAttribute::IS_INSTANCEOF); /** @var array> $attributes */ - $attributes = [ - ...$reflectionClass->getAttributes(ControllerAttribute::class, ReflectionAttribute::IS_INSTANCEOF), - ...$reflectionMethod->getAttributes(ControllerAttribute::class, ReflectionAttribute::IS_INSTANCEOF), - ]; + $attributes = array_merge($item0Unpacked, $item1Unpacked); foreach ($attributes as $attribute) { $attribute = $attribute->newInstance(); diff --git a/src/Twig/FeatureTagNode.php b/src/Twig/FeatureTagNode.php index 13f5a34..e15c7e9 100644 --- a/src/Twig/FeatureTagNode.php +++ b/src/Twig/FeatureTagNode.php @@ -8,11 +8,11 @@ final class FeatureTagNode extends Node { public function __construct( - private readonly string $featureName, - private readonly Node $content, + private string $featureName, + private Node $content, int $line, string $tag, - private readonly string $extensionClass + private string $extensionClass ) { parent::__construct([], [], $line, $tag); } diff --git a/src/Twig/FeatureTagTokenParser.php b/src/Twig/FeatureTagTokenParser.php index 2ad4594..2bdb9bd 100644 --- a/src/Twig/FeatureTagTokenParser.php +++ b/src/Twig/FeatureTagTokenParser.php @@ -9,7 +9,7 @@ final class FeatureTagTokenParser extends AbstractTokenParser { public function __construct( - private readonly string $extensionClass, + private string $extensionClass, ) { } diff --git a/src/Twig/UnleashTwigExtension.php b/src/Twig/UnleashTwigExtension.php index 168b44a..002142b 100644 --- a/src/Twig/UnleashTwigExtension.php +++ b/src/Twig/UnleashTwigExtension.php @@ -11,10 +11,10 @@ final class UnleashTwigExtension extends AbstractExtension { public function __construct( - private readonly bool $functionsEnabled, - private readonly bool $filtersEnabled, - private readonly bool $testsEnabled, - private readonly bool $tagsEnabled, + private bool $functionsEnabled, + private bool $filtersEnabled, + private bool $testsEnabled, + private bool $tagsEnabled, ) { } diff --git a/src/Twig/UnleashTwigRuntime.php b/src/Twig/UnleashTwigRuntime.php index f477141..4a4ff97 100644 --- a/src/Twig/UnleashTwigRuntime.php +++ b/src/Twig/UnleashTwigRuntime.php @@ -7,7 +7,7 @@ use Unleash\Client\DTO\Variant; use Unleash\Client\Unleash; -final readonly class UnleashTwigRuntime implements RuntimeExtensionInterface +final class UnleashTwigRuntime implements RuntimeExtensionInterface { public function __construct( private Unleash $unleash, diff --git a/src/Unleash/UnleashDecorator.php b/src/Unleash/UnleashDecorator.php index af6af32..940cde1 100644 --- a/src/Unleash/UnleashDecorator.php +++ b/src/Unleash/UnleashDecorator.php @@ -14,8 +14,11 @@ use Unleash\Client\Unleash; use Unleash\Client\Variant\VariantHandler; -final readonly class UnleashDecorator implements Unleash +final class UnleashDecorator implements Unleash { + /** + * @readonly + */ private Unleash $proxy; /**