RotateColorGenerator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getNextColor() 0 7 1
1
<?php
2
3
namespace SixtyNine\Cloud\Color;
4
5
class RotateColorGenerator extends ColorGenerator
6
{
7
    protected $current = 0;
8
9
    /**
10
     * @return string
11
     */
12
    public function getNextColor()
13
    {
14
        $colors = $this->palette->getColors();
15
        $color = $colors[$this->current % count($colors)];
16
        $this->current++;
17
        return $color;
18
    }
19
}
20