Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/implementation/provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace OpenFeature\implementation\provider;

use DateTime;
use OpenFeature\implementation\common\Metadata;
use OpenFeature\interfaces\common\Metadata as MetadataInterface;
use OpenFeature\interfaces\flags\EvaluationContext;
Expand Down Expand Up @@ -35,11 +34,10 @@ abstract public function resolveIntegerValue(string $flagKey, int $defaultValue,

abstract public function resolveFloatValue(string $flagKey, float $defaultValue, ?EvaluationContext $context = null): ResolutionDetailsInterface;

abstract public function resolveObjectValue(
string $flagKey,
bool | string | int | float | DateTime | array | null $defaultValue,
?EvaluationContext $context = null
): ResolutionDetailsInterface;
/**
* @param mixed[] $defaultValue
*/
abstract public function resolveObjectValue(string $flagKey, array $defaultValue, ?EvaluationContext $context = null): ResolutionDetailsInterface;

/**
* @return Hook[]
Expand Down
10 changes: 3 additions & 7 deletions src/implementation/provider/NoOpProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace OpenFeature\implementation\provider;

use DateTime;
use OpenFeature\interfaces\flags\EvaluationContext;
use OpenFeature\interfaces\provider\Provider;
use OpenFeature\interfaces\provider\ResolutionDetails as ResolutionDetailsInterface;
Expand Down Expand Up @@ -34,13 +33,10 @@ public function resolveFloatValue(string $flagKey, float $defaultValue, ?Evaluat
}

/**
* @param bool|string|int|float|DateTime|mixed[]|null $defaultValue
* @param mixed[] $defaultValue
*/
public function resolveObjectValue(
string $flagKey,
bool | string | int | float | DateTime | array | null $defaultValue,
?EvaluationContext $context = null
): ResolutionDetailsInterface {
public function resolveObjectValue(string $flagKey, array $defaultValue, ?EvaluationContext $context = null): ResolutionDetailsInterface
{
return ResolutionDetailsFactory::fromSuccess($defaultValue);
}
}
9 changes: 2 additions & 7 deletions src/interfaces/provider/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace OpenFeature\interfaces\provider;

use DateTime;
use OpenFeature\interfaces\common\MetadataGetter;
use OpenFeature\interfaces\flags\EvaluationContext;
use OpenFeature\interfaces\hooks\HooksGetter;
Expand Down Expand Up @@ -48,11 +47,7 @@ public function resolveFloatValue(string $flagKey, float $defaultValue, ?Evaluat
/**
* Resolves the flag value for the provided flag key as an object
*
* @param bool|string|int|float|DateTime|mixed[]|null $defaultValue
* @param mixed[] $defaultValue
*/
public function resolveObjectValue(
string $flagKey,
bool | string | int | float | DateTime | array | null $defaultValue,
?EvaluationContext $context = null
): ResolutionDetails;
public function resolveObjectValue(string $flagKey, array $defaultValue, ?EvaluationContext $context = null): ResolutionDetails;
}
5 changes: 2 additions & 3 deletions tests/TestProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace OpenFeature\Test;

use DateTime;
use OpenFeature\implementation\common\Metadata;
use OpenFeature\implementation\provider\ResolutionDetailsFactory;
use OpenFeature\interfaces\common\Metadata as MetadataInterface;
Expand Down Expand Up @@ -59,9 +58,9 @@ public function resolveFloatValue(string $flagKey, float $defaultValue, ?Evaluat
}

/**
* @param bool|string|int|float|DateTime|mixed[]|null $defaultValue
* @param mixed[] $defaultValue
*/
public function resolveObjectValue(string $flagKey, bool | string | int | float | DateTime | array | null $defaultValue, ?EvaluationContext $context = null): ResolutionDetails
public function resolveObjectValue(string $flagKey, array $defaultValue, ?EvaluationContext $context = null): ResolutionDetails
{
return ResolutionDetailsFactory::fromSuccess($defaultValue);
}
Expand Down