Skip to content

Commit

Permalink
chore: update psr/log (#74)
Browse files Browse the repository at this point in the history
## 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 <jacem@chaieb.me>
Signed-off-by: Tom Carrio <tom@carrio.dev>
Co-authored-by: Tom Carrio <tom@carrio.dev>
  • Loading branch information
kidager and tcarrio authored May 16, 2023
1 parent a03e6b6 commit f8a67c7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion integration/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeatureClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -393,7 +393,7 @@ private function createProviderEvaluation(
string $key,
mixed $defaultValue,
Provider $provider,
EvaluationContextInterface $context
EvaluationContextInterface $context,
): ResolutionDetails {
switch ($type) {
case FlagValueType::BOOLEAN:
Expand Down
2 changes: 1 addition & 1 deletion src/implementation/flags/NoOpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getObjectValue(
string $flagKey,
array $defaultValue,
?EvaluationContextInterface $context = null,
?EvaluationOptions $options = null
?EvaluationOptions $options = null,
): array {
return $defaultValue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/implementation/hooks/HookContextFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/common/LoggerAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait LoggerAwareTrait
/**
* Sets a logger.
*/
public function setLogger(LoggerInterface $logger)
public function setLogger(LoggerInterface $logger): void
{
$this->logger = $logger;
}
Expand Down

0 comments on commit f8a67c7

Please sign in to comment.