Code Duplication    Length = 8-9 lines in 2 locations

src/Internal/JsonDecodeReader.php 1 location

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

src/Internal/JsonElementReader.php 1 location

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