File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,20 @@ public function __construct($sdkKey, $options = array()) {
82
82
83
83
$ this ->_eventProcessor = new EventProcessor ($ sdkKey , $ options );
84
84
85
+ $ this ->_featureRequester = $ this ->getFeatureRequester ($ options , $ sdkKey );
86
+ }
87
+
88
+ /**
89
+ * @param mixed[] $options
90
+ * @param string $sdkKey
91
+ * @return FeatureRequester
92
+ */
93
+ private function getFeatureRequester (array $ options , $ sdkKey )
94
+ {
95
+ if (isset ($ options ['feature_requester ' ]) && $ options ['feature_requester ' ] instanceof FeatureRequester) {
96
+ return $ options ['feature_requester ' ];
97
+ }
98
+
85
99
if (isset ($ options ['feature_requester_class ' ])) {
86
100
$ featureRequesterClass = $ options ['feature_requester_class ' ];
87
101
} else {
@@ -91,7 +105,7 @@ public function __construct($sdkKey, $options = array()) {
91
105
if (!is_a ($ featureRequesterClass , FeatureRequester::class, true )) {
92
106
throw new \InvalidArgumentException ;
93
107
}
94
- $ this -> _featureRequester = new $ featureRequesterClass ($ this ->_baseUri , $ sdkKey , $ options );
108
+ return new $ featureRequesterClass ($ this ->_baseUri , $ sdkKey , $ options );
95
109
}
96
110
97
111
/**
You can’t perform that action at this time.
0 commit comments