TransformedPartialResults   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 19
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A toArray() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the FOSElasticaBundle package.
5
 *
6
 * (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\ElasticaBundle\Paginator;
13
14
use Elastica\ResultSet;
15
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
16
17
/**
18
 * Partial transformed result set.
19
 */
20
class TransformedPartialResults extends RawPartialResults
21
{
22
    protected $transformer;
23
24
    public function __construct(ResultSet $resultSet, ElasticaToModelTransformerInterface $transformer)
25
    {
26
        parent::__construct($resultSet);
27
28
        $this->transformer = $transformer;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function toArray()
35
    {
36
        return $this->transformer->transform($this->resultSet->getResults());
37
    }
38
}
39