Code Duplication    Length = 9-10 lines in 3 locations

src/Internal/JsonReader.php 3 locations

@@ 95-104 (lines=10) @@
92
     *
93
     * @return void
94
     */
95
    public function endArray(): void
96
    {
97
        if ($this->stackTypes[$this->stackSize - 1] !== JsonToken::END_ARRAY) {
98
            $this->pathIndices[$this->pathIndex]++;
99
            $this->assertionFailed(JsonToken::END_ARRAY);
100
        }
101
102
        $this->stackSize--;
103
        $this->pathIndex--;
104
    }
105
106
    /**
107
     * Consumes the next token and asserts it's the end of an object
@@ 111-119 (lines=9) @@
108
     *
109
     * @return void
110
     */
111
    public function endObject(): void
112
    {
113
        if ($this->stackTypes[$this->stackSize - 1] !== JsonToken::END_OBJECT) {
114
            $this->assertionFailed(JsonToken::END_OBJECT);
115
        }
116
117
        $this->stackSize--;
118
        $this->pathNames[$this->pathIndex--] = null;
119
    }
120
121
    /**
122
     * Returns true if the array or object has another element
@@ 158-167 (lines=10) @@
155
     *
156
     * @return void
157
     */
158
    public function nextNull(): void
159
    {
160
        $this->pathIndices[$this->pathIndex]++;
161
162
        if ($this->stackTypes[$this->stackSize - 1] !== JsonToken::NULL) {
163
            $this->assertionFailed(JsonToken::NULL);
164
        }
165
166
        $this->stackSize--;
167
    }
168
169
    /**
170
     * Skip the next value.  If the next value is an object or array, all children will