From f8a67c7279ddc05c29615ecf04b7cfad71f03068 Mon Sep 17 00:00:00 2001 From: Jacem Chaieb Date: Tue, 16 May 2023 23:51:20 +0200 Subject: [PATCH] chore: update psr/log (#74) ## This PR - updates the `psr/log` version requirements ### Notes Some projects require other versions of `psr/log` than `1.*` Example: On a fresh Laravel 9 project, running `composer require open-feature/sdk` yields the following error: ``` Info from https://repo.packagist.org: #StandWithUkraine ./composer.json has been updated Running composer update open-feature/sdk Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires open-feature/sdk * -> satisfiable by open-feature/sdk[0.0.2, ..., 0.1.1, 1.0.0, ..., 1.3.1]. - open-feature/sdk[0.0.2, ..., 0.1.1, 1.0.0, ..., 1.3.1] require psr/log ^1.1 -> found psr/log[1.1.0, ..., 1.1.4] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require open-feature/sdk:*" to figure out if any version is installable, or "composer require open-feature/sdk:^2.1" if you know which you need. Installation failed, reverting ./composer.json and ./composer.lock to their original content. ``` --------- Signed-off-by: Jacem Chaieb Signed-off-by: Tom Carrio Co-authored-by: Tom Carrio --- composer.json | 2 +- integration/composer.json | 2 +- src/OpenFeatureClient.php | 4 ++-- src/implementation/flags/NoOpClient.php | 2 +- src/implementation/hooks/HookContextFactory.php | 2 +- src/interfaces/common/LoggerAwareTrait.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 1f272b4..7b449e3 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": "^8", "myclabs/php-enum": "^1.8", - "psr/log": "^1.1" + "psr/log": "^2.0 || ^3.0" }, "require-dev": { "behat/behat": "^3.11", diff --git a/integration/composer.json b/integration/composer.json index 81caea5..906f60d 100644 --- a/integration/composer.json +++ b/integration/composer.json @@ -17,7 +17,7 @@ "require": { "php": "^8", "open-feature/sdk": "^2.0.0", - "open-feature/flagd-provider": "^0.4.0", + "open-feature/flagd-provider": "^0.7.0", "guzzlehttp/guzzle": "^7.5", "guzzlehttp/psr7": "^2.4" }, diff --git a/src/OpenFeatureClient.php b/src/OpenFeatureClient.php index 8a4432b..4181a60 100644 --- a/src/OpenFeatureClient.php +++ b/src/OpenFeatureClient.php @@ -294,7 +294,7 @@ private function evaluateFlag( string $flagKey, bool | string | int | float | DateTime | array | null $defaultValue, ?EvaluationContextInterface $invocationContext = null, - ?EvaluationOptionsInterface $options = null + ?EvaluationOptionsInterface $options = null, ): EvaluationDetailsInterface { $api = $this->api; $provider = $api->getProvider(); @@ -393,7 +393,7 @@ private function createProviderEvaluation( string $key, mixed $defaultValue, Provider $provider, - EvaluationContextInterface $context + EvaluationContextInterface $context, ): ResolutionDetails { switch ($type) { case FlagValueType::BOOLEAN: diff --git a/src/implementation/flags/NoOpClient.php b/src/implementation/flags/NoOpClient.php index e5135ca..792e262 100644 --- a/src/implementation/flags/NoOpClient.php +++ b/src/implementation/flags/NoOpClient.php @@ -64,7 +64,7 @@ public function getObjectValue( string $flagKey, array $defaultValue, ?EvaluationContextInterface $context = null, - ?EvaluationOptions $options = null + ?EvaluationOptions $options = null, ): array { return $defaultValue; } diff --git a/src/implementation/hooks/HookContextFactory.php b/src/implementation/hooks/HookContextFactory.php index 1317dfc..1d22e69 100644 --- a/src/implementation/hooks/HookContextFactory.php +++ b/src/implementation/hooks/HookContextFactory.php @@ -21,7 +21,7 @@ public static function from( bool | string | int | float | DateTime | array | null $defaultValue, ?EvaluationContextInterface $evaluationContext, Metadata $clientMetadata, - Metadata $providerMetadata + Metadata $providerMetadata, ): HookContext { $builder = new HookContextBuilder(); diff --git a/src/interfaces/common/LoggerAwareTrait.php b/src/interfaces/common/LoggerAwareTrait.php index c807c94..7df720c 100644 --- a/src/interfaces/common/LoggerAwareTrait.php +++ b/src/interfaces/common/LoggerAwareTrait.php @@ -22,7 +22,7 @@ trait LoggerAwareTrait /** * Sets a logger. */ - public function setLogger(LoggerInterface $logger) + public function setLogger(LoggerInterface $logger): void { $this->logger = $logger; }