Passed
Push — master ( 5575b8...aa594f )
by Satoshi
02:04
created

CycleDetectorResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addCycle() 0 3 1
A count() 0 3 1
A getCycles() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DependencyAnalyzer\Detector\Responses;
5
6
class CycleDetectorResponse implements \Countable
7
{
8
    private $cycles = [];
9
10
    public function addCycle(array $classes)
11
    {
12
        $this->cycles[] = $classes;
13
    }
14
15
    public function getCycles(): array
16
    {
17
        return $this->cycles;
18
        /**
19
         * Hoge component rule violations
20
         * | hoge.php | Hoge | -> | fuga.php | Fuga |
21
         * | hoge.php | Hoge | -> | fuga.php | Fuga |
22
         *
23
         * | No | file path |
24
         * |---|---|
25
         * | 1  | hoge.php |
26
         * | 2  | fuga.php |
27
         */
28
    }
29
30
    public function count()
31
    {
32
        return count($this->cycles);
33
    }
34
}
35