Passed
Push — master ( d8988b...9b0479 )
by Pavel
02:15
created

ExtraLazyResponseCollection::getInnerCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace ScayTrase\Api\Rpc\Decorators;
4
5
use ScayTrase\Api\Rpc\ResponseCollectionInterface;
6
use ScayTrase\Api\Rpc\RpcRequestInterface;
7
8
final class ExtraLazyResponseCollection implements \IteratorAggregate, ResponseCollectionInterface
9
{
10
    /** @var LazyResponseCollection */
11
    private $collection;
12
13
    /**
14
     * ExtraLazyResponseCollection constructor.
15
     *
16
     * @param LazyResponseCollection $collection
17
     */
18 4
    public function __construct(LazyResponseCollection $collection)
19
    {
20 4
        $this->collection = $collection;
21 4
    }
22
23
    /** {@inheritdoc} */
24 2
    public function getIterator()
25
    {
26 2
        return $this->collection;
27
    }
28
29
    /**
30
     * @return LazyResponseCollection
31
     */
32 4
    public function getInnerCollection()
33
    {
34 4
        return $this->collection;
35
    }
36
37
    /** {@inheritdoc} */
38 1
    public function getResponse(RpcRequestInterface $request)
39
    {
40 1
        return new ExtraLazyResponseProxy($request, $this->collection);
41
    }
42
}
43