Code Duplication    Length = 15-16 lines in 2 locations

src/Container/CollapsedContainer.php 2 locations

@@ 39-54 (lines=16) @@
36
     *
37
     * @return mixed|null
38
     */
39
    public function get($key)
40
    {
41
        if (mb_strpos($key, static::DELIMITER) !== false) {
42
            $top = $this->params;
43
44
            foreach (explode(static::DELIMITER, $key) as $node) {
45
                if (!isset($top[$node])) {
46
                    return null;
47
                }
48
                $top = $top[$node];
49
            }
50
            return $top;
51
        }
52
53
        return parent::get($key);
54
    }
55
56
    /**
57
     * @param string $key
@@ 90-104 (lines=15) @@
87
     *
88
     * @return bool
89
     */
90
    public function has($key)
91
    {
92
        if (mb_strpos($key, static::DELIMITER) !== false) {
93
            $top = $this->params;
94
95
            foreach (explode(static::DELIMITER, $key) as $node) {
96
                if (!isset($top[$node])) {
97
                    return false;
98
                }
99
                $top = $top[$node];
100
            }
101
            return true;
102
        }
103
        return parent::has($key);
104
    }
105
106
    /**
107
     * @param string $key