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

ExtraLazyResponseCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getIterator() 0 4 1
A getResponse() 0 4 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