Code Duplication    Length = 13-13 lines in 2 locations

src/Parser/JsonParser.php 1 location

@@ 12-24 (lines=13) @@
9
 */
10
final class JsonParser extends AbstractParser
11
    {
12
    private function parseValues(array $json)
13
        {
14
        $values = array();
15
        if(array_key_exists('values', $this->mapping))
16
            {
17
            foreach($this->mapping['values'] as $key => $item)
18
                {
19
                $values[$key] = $json[$item['json']['field']];
20
                }
21
            }
22
23
        return $values;
24
        }
25
26
    private function parseArrays(array $json)
27
        {

src/Parser/XmlParser.php 1 location

@@ 12-24 (lines=13) @@
9
 */
10
final class XmlParser extends AbstractParser
11
    {
12
    private function parseValues(\SimpleXMLElement $xml)
13
        {
14
        $values = array();
15
        if(array_key_exists('values', $this->mapping))
16
            {
17
            foreach($this->mapping['values'] as $key => $item)
18
                {
19
                $values[$key] = (string)$xml->{$item['xml']['field']};
20
                }
21
            }
22
23
        return $values;
24
        }
25
26
    private function parseArrays(\SimpleXMLElement $xml)
27
        {