Code Duplication    Length = 5-6 lines in 3 locations

src/Converter.php 2 locations

@@ 20-24 (lines=5) @@
17
18
        $data = (object) $data;
19
20
        foreach ($data as $k => $v) {
21
            if (is_array($v) || is_object($v)) {
22
                $data->$k = $this->toObject($v);
23
            }
24
        }
25
26
        return $data;
27
    }
@@ 39-43 (lines=5) @@
36
            $data = get_object_vars($data);
37
        }
38
39
        foreach ($data as $k => $v) {
40
            if (is_array($v) || is_object($v)) {
41
                $data[$k] = $this->toArray($v);
42
            }
43
        }
44
45
        return $data;
46
    }

src/Config.php 1 location

@@ 16-21 (lines=6) @@
13
        $this->converter = $converter;
14
15
        $data = include $fs->getPath("resources/config.php");
16
        foreach($data as $k => $v) {
17
            $this->$k = $v;
18
            if(is_array($v) || is_object($v)) {
19
                $this->$k = $converter->toObject($v);
20
            }
21
        }
22
    }
23
24
    public function offsetExists($offset)