MethodResult   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 54
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getNamespaceName() 0 4 1
A hasChildResults() 0 4 1
A getChildResults() 0 4 1
A __construct() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of cloak.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace cloak\result;
13
14
use cloak\reflection\MethodReflection;
15
use cloak\result\collection\CoverageResultCollection;
16
17
18
/**
19
 * Class MethodResult
20
 * @package cloak\result
21
 */
22
final class MethodResult implements CoverageResultNode
23
{
24
25
    use CoverageResult;
26
27
    /**
28
     * @var MethodReflection
29
     */
30
    private $reflection;
31
32
33
    /**
34
     * @param MethodReflection $reflection
35
     * @param LineResultSelectable $selector
36
     */
37
    public function __construct(MethodReflection $reflection, LineResultSelectable $selector)
38
    {
39
        $this->reflection = $reflection;
40
        $this->lineResults = $selector->selectByReflection($reflection);
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getName()
47
    {
48
        return $this->reflection->getName();
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getNamespaceName()
55
    {
56
        return $this->reflection->getNamespaceName();
57
    }
58
59
    /**
60
     * @return bool
61
     */
62
    public function hasChildResults()
63
    {
64
        return false;
65
    }
66
67
    /**
68
     * @return \cloak\result\CoverageResultNodeCollection
69
     */
70
    public function getChildResults()
71
    {
72
        return new CoverageResultCollection();
73
    }
74
75
}
76