@@ -23,10 +23,10 @@ class Featurevisor
2323 * sticky?: array<string, mixed>,
2424 * hooks?: array<array{
2525 * name: string,
26- * before: Closure,
27- * after: Closure,
28- * bucketKey: Closure,
29- * bucketValue: Closure
26+ * before? : Closure,
27+ * after? : Closure,
28+ * bucketKey? : Closure,
29+ * bucketValue? : Closure
3030 * }>
3131 * } $options
3232 * @return self
@@ -560,20 +560,18 @@ public function getAllEvaluations(array $context = [], array $featureKeys = [],
560560 'flagEvaluation ' => $ flagEvaluation ,
561561 ]);
562562 // variation
563- if (method_exists ( $ this -> datafileReader , ' hasVariations ' ) && $ this ->datafileReader ->hasVariations ($ featureKey )) {
563+ if ($ this ->datafileReader ->hasVariations ($ featureKey )) {
564564 $ variation = $ this ->getVariation ($ featureKey , $ context , $ opts );
565565 if ($ variation !== null ) {
566566 $ evaluatedFeature ['variation ' ] = $ variation ;
567567 }
568568 }
569569 // variables
570- if (method_exists ($ this ->datafileReader , 'getVariableKeys ' )) {
571- $ variableKeys = $ this ->datafileReader ->getVariableKeys ($ featureKey );
572- if (!empty ($ variableKeys )) {
573- $ evaluatedFeature ['variables ' ] = [];
574- foreach ($ variableKeys as $ variableKey ) {
575- $ evaluatedFeature ['variables ' ][$ variableKey ] = $ this ->getVariable ($ featureKey , $ variableKey , $ context , $ opts );
576- }
570+ $ variableKeys = $ this ->datafileReader ->getVariableKeys ($ featureKey );
571+ if (!empty ($ variableKeys )) {
572+ $ evaluatedFeature ['variables ' ] = [];
573+ foreach ($ variableKeys as $ variableKey ) {
574+ $ evaluatedFeature ['variables ' ][$ variableKey ] = $ this ->getVariable ($ featureKey , $ variableKey , $ context , $ opts );
577575 }
578576 }
579577 $ evaluations [$ featureKey ] = $ evaluatedFeature ;
0 commit comments