Completed
Push — master ( 6a0101...61ff1f )
by Karel
10:05 queued 08:15
created

HybridPartialResults   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 26
ccs 6
cts 6
cp 1
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 <http://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 HybridPartialResults extends RawPartialResults
21
{
22
    /**
23
     * @var ElasticaToModelTransformerInterface
24
     */
25
    protected $transformer;
26
27
    /**
28
     * @param ResultSet                           $resultSet
29
     * @param ElasticaToModelTransformerInterface $transformer
30
     */
31 2
    public function __construct(ResultSet $resultSet, ElasticaToModelTransformerInterface $transformer)
32
    {
33 2
        parent::__construct($resultSet);
34
35 2
        $this->transformer = $transformer;
36 2
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 1
    public function toArray()
42
    {
43 1
        return $this->transformer->hybridTransform($this->resultSet->getResults());
44
    }
45
}
46