Passed
Push — master ( 1173f0...070f3f )
by Nate
13:41
created

JsonObjectIterator::next()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
namespace Tebru\Gson\Internal;
8
9
use SplQueue;
10
use Tebru\Gson\Element\JsonObject;
11
12
/**
13
 * Class JsonObjectIterator
14
 *
15
 * @author Nate Brunette <[email protected]>
16
 */
17
final class JsonObjectIterator extends AbstractIterator
18
{
19
    /**
20
     * Constructor
21
     *
22
     * @param JsonObject $jsonObject
23
     */
24 7
    public function __construct(JsonObject $jsonObject)
25
    {
26 7
        $this->queue = new SplQueue();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \SplQueue() of type object<SplQueue> is incompatible with the declared type array of property $queue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
27 7
        foreach($jsonObject as $key => $value) {
28 7
            $this->queue[] = [$key, $value];
29 7
            $this->total++;
30
        }
31 7
    }
32
}
33