File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
src/implementation/multiprovider Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace OpenFeature \implementation \multiprovider ;
6+
7+ use OpenFeature \interfaces \provider \Provider ;
8+ use OpenFeature \interfaces \provider \ResolutionDetails ;
9+ use Throwable ;
10+
11+ /**
12+ * Represents the result of evaluating a single provider in a multi-provider setup.
13+ * Contains the resolution details, any error that was thrown, and the source provider information.
14+ */
15+ class ProviderResolutionResult
16+ {
17+ public function __construct (
18+ private string $ providerName ,
19+ private Provider $ provider ,
20+ private ?ResolutionDetails $ details = null ,
21+ private ?Throwable $ error = null ,
22+ ) {
23+ }
24+
25+ public function getProviderName (): string
26+ {
27+ return $ this ->providerName ;
28+ }
29+
30+ public function getProvider (): Provider
31+ {
32+ return $ this ->provider ;
33+ }
34+
35+ public function getDetails (): ?ResolutionDetails
36+ {
37+ return $ this ->details ;
38+ }
39+
40+ public function getError (): ?Throwable
41+ {
42+ return $ this ->error ;
43+ }
44+
45+ public function hasError (): bool
46+ {
47+ return $ this ->error !== null ;
48+ }
49+
50+ public function isSuccessful (): bool
51+ {
52+ return $ this ->details !== null && $ this ->error === null ;
53+ }
54+ }
You can’t perform that action at this time.
0 commit comments