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