CircleProgress   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 8 2
1
<?php
2
3
/**
4
 * This file is part of GitterBot package.
5
 *
6
 * @author Serafim <[email protected]>
7
 * @date 25.09.2015 16:43
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Interfaces\Gitter\Console;
14
15
/**
16
 * Class CircleProgress
17
 */
18
class CircleProgress
19
{
20
    /**
21
     * @var int
22
     */
23
    protected $iterator = 0;
24
25
    /**
26
     * @var array
27
     */
28
    protected static $icons = ['|', '/', '−', '\\'];
29
30
    /**
31
     * @return mixed
32
     */
33
    public function get()
34
    {
35
        if ($this->iterator >= count(static::$icons)) {
36
            $this->iterator = 0;
37
        }
38
39
        return static::$icons[$this->iterator++];
40
    }
41
}
42