Completed
Pull Request — master (#29)
by
unknown
06:43
created

GqlIterator   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 31
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A rewind() 0 4 1
A current() 0 4 1
A key() 0 4 1
A next() 0 4 1
A valid() 0 6 2
1
<?php
2
3
namespace Softonic\GraphQL\Traits;
4
5
trait GqlIterator
6
{
7
    private $arguments;
8
9 48
    public function rewind()
10
    {
11 48
        reset($this->arguments);
12 48
    }
13
14 48
    public function current()
15
    {
16 48
        return current($this->arguments);
17
    }
18
19 48
    public function key()
20
    {
21 48
        return key($this->arguments);
22
    }
23
24 48
    public function next()
25
    {
26 48
        return next($this->arguments);
27
    }
28
29 48
    public function valid()
30
    {
31 48
        $key = key($this->arguments);
32
33 48
        return ($key !== null && $key !== false);
34
    }
35
}
36