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

GqlIterator::next()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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