Code Duplication    Length = 8-9 lines in 2 locations

src/Internal/JsonDecodeReader.php 1 location

@@ 90-97 (lines=8) @@
87
     * @return void
88
     * @throws \Tebru\Gson\Exception\UnexpectedJsonTokenException If the next token is not BEGIN_ARRAY
89
     */
90
    public function beginArray(): void
91
    {
92
        $this->expect(JsonToken::BEGIN_ARRAY);
93
94
        $array = $this->pop();
95
        $this->push(new ArrayIterator($array), ArrayIterator::class);
96
        $this->pathIndices[$this->stackSize - 1] = 0;
97
    }
98
99
    /**
100
     * Consumes the next token and asserts it's the end of an array

src/Internal/JsonElementReader.php 1 location

@@ 89-97 (lines=9) @@
86
     * @return void
87
     * @throws \Tebru\Gson\Exception\UnexpectedJsonTokenException If the next token is not BEGIN_ARRAY
88
     */
89
    public function beginArray(): void
90
    {
91
        $this->expect(JsonToken::BEGIN_ARRAY);
92
93
        /** @var JsonArray $jsonArray */
94
        $jsonArray = $this->pop();
95
        $this->push($jsonArray->getIterator(), ArrayIterator::class);
96
        $this->pathIndices[$this->stackSize - 1] = 0;
97
    }
98
99
    /**
100
     * Consumes the next token and asserts it's the end of an array