We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2875fd7 commit 987c5a0Copy full SHA for 987c5a0
src/Client.php
@@ -141,26 +141,20 @@ private static function makeCallable($result)
141
{
142
switch (true) {
143
case is_callable($result):
144
- $callable = $result;
145
-
146
- break;
+ return $result;
147
case $result instanceof ResponseInterface:
148
- $callable = function () use ($result) {
+ return function () use ($result) {
149
return $result;
150
};
151
152
break;
153
case $result instanceof \Exception:
154
155
throw $result;
156
157
158
159
default:
160
throw new \InvalidArgumentException('Result must be either a response, an exception, or a callable');
161
}
162
163
- return $callable;
164
165
166
/**
0 commit comments