Passed
Push — master ( 17602b...453007 )
by Chris
04:37
created

OneTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: chris
5
 * Date: 19/10/2017
6
 * Time: 4:25 PM
7
 */
8
9
namespace Seufert\Hamle\Model;
10
11
12
trait OneTrait {
13
14
  protected $hamleIndex = 0;
15
16
  function valid() {
17
    return $this->hamleIndex == 0;
18
  }
19
20
  function key() {
21
    return $this->hamleIndex;
22
  }
23
24
  function current() {
25
    return $this;
26
  }
27
28
  function rewind() {
29
    $this->hamleIndex = 0;
30
  }
31
32
  function next() {
33
    $this->hamleIndex++;
34
  }
35
36
}