Term   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 48
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A count() 0 3 1
A getSuggestions() 0 3 1
A getIterator() 0 3 1
1
<?php
2
3
namespace Mdiyakov\DoctrineSolrBundle\Query\Suggest\Solarium\Result;
4
5
class Term implements \IteratorAggregate, \Countable
6
{
7
8
    /**
9
     * @var int
10
     */
11
    private $numFound;
12
13
    /**
14
     * @var array
15
     */
16
    private $suggestions;
17
18
    public function __construct($numFound, $suggestions)
19
    {
20
        $this->numFound = $numFound;
21
        $this->suggestions = $suggestions;
22
    }
23
24
25
    /**
26
     * IteratorAggregate implementation
27
     *
28
     * @return \ArrayIterator
29
     */
30
    public function getIterator()
31
    {
32
        return new \ArrayIterator($this->suggestions);
33
    }
34
35
    /**
36
     * Countable implementation
37
     *
38
     * @return int
39
     */
40
    public function count()
41
    {
42
        return count($this->suggestions);
43
    }
44
45
    /**
46
     * Get suggestions
47
     *
48
     * @return array
49
     */
50
    public function getSuggestions()
51
    {
52
        return $this->suggestions;
53
    }
54
55
}