File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -162,14 +162,17 @@ protected static function evaluateCondition($condition)
162
162
if (is_string ($ condition )) {
163
163
// Should be extended for functions, extensions???
164
164
return self ::safeClassExists ($ condition );
165
- } elseif (is_callable ($ condition )) {
166
- return $ condition ();
167
- } elseif (is_bool ($ condition )) {
165
+ }
166
+ if (is_callable ($ condition )) {
167
+ return (bool ) $ condition ();
168
+ }
169
+ if (is_bool ($ condition )) {
168
170
return $ condition ;
169
- } elseif (is_array ($ condition )) {
170
- // Immediately stop execution if the condition is false
171
- for ($ i = 0 ; $ i < count ($ condition ); ++$ i ) {
172
- if (false === static ::evaluateCondition ($ condition [$ i ])) {
171
+ }
172
+ if (is_array ($ condition )) {
173
+ foreach ($ condition as $ c ) {
174
+ if (false === static ::evaluateCondition ($ c )) {
175
+ // Immediately stop execution if the condition is false
173
176
return false ;
174
177
}
175
178
}
You can’t perform that action at this time.
0 commit comments