Code Duplication    Length = 5-7 lines in 2 locations

src/Graviton/AnalyticsBundle/Helper/JsonMapper.php 1 location

@@ 42-48 (lines=7) @@
39
            );
40
        }
41
42
        foreach ($json as $key => $jvalue) {
43
            $key = $this->getSafeName($key);
44
            $setter = 'set' . $this->getCamelCaseName($key);
45
            if (method_exists($object, $setter)) {
46
                $object->{$setter}($jvalue);
47
            }
48
        }
49
50
        return $object;
51

src/Graviton/ProxyApiBundle/Helper/ArrayDefinitionMapper.php 1 location

@@ 45-49 (lines=5) @@
42
            );
43
        }
44
45
        foreach ($array as $key => $value) {
46
            $key = $this->getSafeName($key);
47
            $setter = 'set' . $this->getCamelCaseName($key);
48
            $object->addMethodCall($setter, [$value]);
49
        }
50
51
        return $object;
52
    }