Conditions | 4 |
Paths | 8 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
25 | 8 | public function invoke($calls) |
|
26 | { |
||
27 | // Reset collection if previous was already sent |
||
28 | 8 | if ($this->collection->isFrozen()) { |
|
29 | 2 | $this->collection = new LazyResponseCollection($this->decoratedClient); |
|
30 | 2 | } |
|
31 | |||
32 | 8 | if (!is_array($calls)) { |
|
33 | 8 | $calls = [$calls]; |
|
34 | 8 | } |
|
35 | |||
36 | 8 | foreach ($calls as $call) { |
|
37 | 8 | $this->collection->append($call); |
|
38 | 8 | } |
|
39 | |||
40 | 8 | return $this->collection; |
|
41 | } |
||
42 | } |
||
43 |