XFeatureCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __invoke() 0 4 1
A onXFeatureEnabled() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the NNTP library.
5
 *
6
 * (c) Robin van der Vleuten <[email protected]>
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 Rvdv\Nntp\Command;
13
14
use Rvdv\Nntp\Response\Response;
15
16
/**
17
 * XFeatureCommand.
18
 *
19
 * @author Robin van der Vleuten <[email protected]>
20
 */
21
class XFeatureCommand extends Command implements CommandInterface
22
{
23
    const COMPRESS_GZIP = 'COMPRESS GZIP';
24
25
    /**
26
     * @var string
27
     */
28
    private $feature;
29
30
    /**
31
     * Constructor.
32
     *
33
     * @param string $feature The feature to enable
34
     */
35 5
    public function __construct($feature)
36
    {
37 5
        $this->feature = $feature;
38
39 5
        parent::__construct();
40 5
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 1
    public function __invoke()
46
    {
47 1
        return sprintf('XFEATURE %s', $this->feature);
48
    }
49
50 1
    public function onXFeatureEnabled(Response $response)
0 ignored issues
show
Unused Code introduced by
The parameter $response is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
51
    {
52 1
        return true;
53
    }
54
}
55