Result::setCyclomaticComplexityNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * (c) Jean-François Lépine <https://twitter.com/Halleck45>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Hal\Metrics\Complexity\Component\McCabe;
11
use Hal\Component\Result\ExportableInterface;
12
13
/**
14
 * Representation of McCaybe measure
15
 *
16
 * @author Jean-François Lépine <https://twitter.com/Halleck45>
17
 */
18
class Result implements ExportableInterface {
19
20
    /**
21
     * @var int
22
     */
23
    private $cyclomaticComplexityNumber;
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function asArray() {
29
        return array (
30
            'cyclomaticComplexity' => $this->getCyclomaticComplexityNumber()
31
        );
32
    }
33
34
    /**
35
     * @param int $cyclomaticComplexityNumber
36
     */
37
    public function setCyclomaticComplexityNumber($cyclomaticComplexityNumber)
38
    {
39
        $this->cyclomaticComplexityNumber = (int) $cyclomaticComplexityNumber;
40
    }
41
42
    /**
43
     * @return int
44
     */
45
    public function getCyclomaticComplexityNumber()
46
    {
47
        return $this->cyclomaticComplexityNumber;
48
    }
49
}