RepeatIterator   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A rewind() 0 3 1
A current() 0 4 1
A key() 0 4 1
A next() 0 4 1
A valid() 0 4 1
1
<?php
2
3
namespace itertools;
4
5
use Iterator;
6
7
8
class RepeatIterator implements Iterator
9
{
10
	protected $value;
11
	protected $key;
12
13
	public function __construct($value)
14
	{
15
		$this->value = $value;
16
		$this->key = 0;
17
	}
18
19
    public function rewind()
20
	{
21
    }
22
23
    public function current()
24
	{
25
        return $this->value;
26
    }
27
28
    public function key()
29
	{
30
		return $this->key;
31
    }
32
33
    public function next()
34
	{
35
		$this->key += 1;
36
    }
37
38
    public function valid()
39
	{
40
        return true;
41
    }	
42
}
43
44