Code Duplication    Length = 8-9 lines in 2 locations

src/Internal/JsonDecodeReader.php 1 location

@@ 42-49 (lines=8) @@
39
     * @return void
40
     * @throws \Tebru\Gson\Exception\UnexpectedJsonTokenException If the next token is not BEGIN_ARRAY
41
     */
42
    public function beginArray(): void
43
    {
44
        $this->expect(JsonToken::BEGIN_ARRAY);
45
46
        $array = $this->pop();
47
        $this->push(new ArrayIterator($array), ArrayIterator::class);
48
        $this->pathIndices[$this->stackSize - 1] = 0;
49
    }
50
51
    /**
52
     * Consumes the next token and asserts it's the beginning of a new object

src/Internal/JsonElementReader.php 1 location

@@ 41-49 (lines=9) @@
38
     * @return void
39
     * @throws \Tebru\Gson\Exception\UnexpectedJsonTokenException If the next token is not BEGIN_ARRAY
40
     */
41
    public function beginArray(): void
42
    {
43
        $this->expect(JsonToken::BEGIN_ARRAY);
44
45
        /** @var JsonArray $jsonArray */
46
        $jsonArray = $this->pop();
47
        $this->push($jsonArray->getIterator(), ArrayIterator::class);
48
        $this->pathIndices[$this->stackSize - 1] = 0;
49
    }
50
51
    /**
52
     * Consumes the next token and asserts it's the beginning of a new object