Code Duplication    Length = 12-12 lines in 2 locations

src/POData/Writers/Json/JsonODataV1Writer.php 1 location

@@ 398-409 (lines=12) @@
395
	        ->writeName(ODataConstants::JSON_RESULT_NAME) // "__results":
396
	    	->startArrayScope(); // [
397
398
        foreach ($bag->propertyContents as $content) {
399
            if ($content instanceof ODataPropertyContent) {
400
                $this->_writer->startObjectScope();
401
                $this->writeProperties($content);
402
                $this->_writer->endScope();
403
            } else {
404
                // retrieving the collection datatype in order
405
                //to write in json specific format, with in chords or not
406
                preg_match('#\((.*?)\)#', $bag->type, $type);
407
                $this->_writer->writeValue($content, $type[1]);
408
            }
409
        }
410
411
412
        $this->_writer

src/POData/Writers/Json/JsonLightODataWriter.php 1 location

@@ 345-356 (lines=12) @@
342
343
			->startArrayScope(); // [
344
345
		foreach ($bag->propertyContents as $content) {
346
			if ($content instanceof ODataPropertyContent) {
347
				$this->_writer->startObjectScope();
348
				$this->writeProperties($content);
349
				$this->_writer->endScope();
350
			} else {
351
				// retrieving the collection datatype in order
352
				//to write in json specific format, with in chords or not
353
				preg_match('#\((.*?)\)#', $bag->type, $type);
354
				$this->_writer->writeValue($content, $type[1]);
355
			}
356
		}
357
358
359
		$this->_writer->endScope();  // ]