Passed
Push — master ( 28894b...85e017 )
by Mariano
05:13
created

JsonPathConditionIterator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 9 2
A key() 0 3 1
1
<?php
2
3
namespace Mcustiel\Phiremock\Domain\Condition\Conditions;
4
5
use Mcustiel\Phiremock\Domain\AbstractArrayIterator;
6
use Mcustiel\Phiremock\Domain\Http\JsonPathName;
7
8
/** @method JsonPathCondition current() */
9
final class JsonPathConditionIterator extends AbstractArrayIterator
10
{
11
    public function __toString()
12
    {
13
        $string = '';
14
        /** @var JsonPathName $pathName */
15
        /** @var JsonPathCondition $condition */
16
        foreach ($this as $pathName => $condition) {
17
            $string .= $pathName->asString() . ' => ' . $condition->__toString();
18
        }
19
        return $string;
20
    }
21
22
    /** @return JsonPathName */
23
    public function key()
24
    {
25
        return new JsonPathName(parent::key());
26
    }
27
}
28