Stats   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 51
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A preMergeParams() 0 1 1
A init() 0 4 1
A stats() 0 4 1
A addField() 0 4 1
A addFacet() 0 4 1
1
<?php
2
3
namespace PSolr\Request;
4
5
/**
6
 * @see http://wiki.apache.org/solr/StatsComponent
7
 */
8
class Stats extends SolrRequest implements ComponentInterface
9
{
10
    /**
11
     * {@inheritDoc}
12
     */
13
    public function preMergeParams(SolrRequest $request) {}
14
15
    /**
16
     * {@inheritDoc}
17
     */
18
    public function init()
19
    {
20
        $this->stats();
21
    }
22
23
    /**
24
     * @param bool $stats
25
     *
26
     * @return \PSolr\Request\Stats
27
     *
28
     * @see http://wiki.apache.org/solr/StatsComponent
29
     */
30
    public function stats($stats = true)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
31
    {
32
        return $this->set('stats', (bool) $stats);
33
    }
34
35
    /**
36
     * @param string $field
37
     *
38
     * @return \PSolr\Request\Stats
39
     *
40
     * @see http://wiki.apache.org/solr/StatsComponent
41
     */
42
    public function addField($field)
43
    {
44
        return $this->add('stats.field', $field);
45
    }
46
47
    /**
48
     * @param string $facet
49
     *
50
     * @return \PSolr\Request\Stats
51
     *
52
     * @see http://wiki.apache.org/solr/StatsComponent
53
     */
54
    public function addFacet($facet)
55
    {
56
        return $this->add('stats.facet', $facet);
57
    }
58
}
59