File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -141,26 +141,20 @@ private static function ensureCallable($result)
141
141
{
142
142
switch (true ) {
143
143
case is_callable ($ result ):
144
- $ callable = $ result ;
145
-
146
- break ;
144
+ return $ result ;
147
145
case $ result instanceof ResponseInterface:
148
- $ callable = function () use ($ result ) {
146
+ return function () use ($ result ) {
149
147
return $ result ;
150
148
};
151
149
152
150
break ;
153
151
case $ result instanceof \Exception:
154
- $ callable = function () use ($ result ) {
152
+ return function () use ($ result ) {
155
153
throw $ result ;
156
154
};
157
-
158
- break ;
159
155
default :
160
156
throw new \InvalidArgumentException ('Result must be either a response, an exception, or a callable ' );
161
157
}
162
-
163
- return $ callable ;
164
158
}
165
159
166
160
/**
You can’t perform that action at this time.
0 commit comments