Completed
Pull Request — master (#7)
by Pavel
02:43
created

ExtraLazyResponseCollection::getResponse()   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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
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 2
    public function __construct(LazyResponseCollection $collection)
19
    {
20 2
        $this->collection = $collection;
21 2
    }
22
23
    /** {@inheritdoc} */
24 1
    public function getIterator()
25
    {
26 1
        return $this->collection;
27
    }
28
29
    /** {@inheritdoc} */
30 1
    public function getResponse(RpcRequestInterface $request)
31
    {
32 1
        return new ExtraLazyResponseProxy($request, $this->collection);
33
    }
34
}
35