CircleProgress::get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
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