Code Duplication    Length = 9-9 lines in 2 locations

src/Internal/JsonElementWriter.php 1 location

@@ 301-309 (lines=9) @@
298
     */
299
    private function push(JsonElement $value): JsonWritable
300
    {
301
        if (0 === $this->stackSize) {
302
            if (null !== $this->result) {
303
                throw new LogicException('Attempting to write two different types');
304
            }
305
306
            $this->result = $value;
307
308
            return $this;
309
        }
310
311
        switch ($this->stackStates[$this->stackSize - 1]) {
312
            case self::STATE_OBJECT_VALUE:

src/Internal/JsonEncodeWriter.php 1 location

@@ 283-291 (lines=9) @@
280
     */
281
    private function push(&$value): JsonWritable
282
    {
283
        if (0 === $this->stackSize) {
284
            if (null !== $this->result) {
285
                throw new LogicException('Attempting to write two different types');
286
            }
287
288
            $this->result = &$value;
289
290
            return $this;
291
        }
292
293
        switch ($this->stackStates[$this->stackSize - 1]) {
294
            case self::STATE_OBJECT_VALUE: