Completed
Push — development ( eb9524...db4517 )
by Andrij
28:49 queued 02:09
created

Result   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 47
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addResult() 0 3 1
A getGroupName() 0 3 1
A count() 0 3 1
A getResults() 0 3 1
A toArray() 0 3 1
1
<?php
2
3
namespace xbanners\src\UrlFinder\Results;
4
5
use Countable;
6
7
class Result implements ResultInterface, Countable
8
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
9
10
    /**
11
     * @var string
12
     */
13
    protected $groupName;
14
15
    /**
16
     * @var array
17
     */
18
    protected $urls = [];
19
20
    /**
21
     * @param string $groupName
22
     */
23
    public function __construct($groupName) {
24
        $this->groupName = $groupName;
25
    }
26
27
    public function addResult($name, $url) {
28
        $this->urls[$name] = $url;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getGroupName() {
35
        return $this->groupName;
36
    }
37
38
    public function count() {
39
        return count($this->urls);
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getResults() {
46
        return $this->urls;
47
    }
48
49
    public function toArray() {
50
        return [ $this->getGroupName() => $this->getResults()];
51
    }
52
53
}