Code Duplication    Length = 21-21 lines in 2 locations

src/View/ViewMobileOverrides.php 1 location

@@ 12-32 (lines=21) @@
9
 * @author PyroCMS, Inc. <[email protected]>
10
 * @author Ryan Thompson <[email protected]>
11
 */
12
class ViewMobileOverrides extends Collection
13
{
14
15
    /**
16
     * When putting overrides replace "/" with "."
17
     * to match the way Laravel interprets views.
18
     *
19
     * @param mixed $key
20
     * @param mixed $value
21
     */
22
    public function put($key, $value)
23
    {
24
        $overrides = [];
25
26
        foreach ($value as $view => $override) {
27
            $overrides[str_replace('/', '.', $view)] = $override;
28
        }
29
30
        parent::put($key, $overrides);
31
    }
32
}
33

src/View/ViewOverrides.php 1 location

@@ 12-32 (lines=21) @@
9
 * @author PyroCMS, Inc. <[email protected]>
10
 * @author Ryan Thompson <[email protected]>
11
 */
12
class ViewOverrides extends Collection
13
{
14
15
    /**
16
     * When putting overrides replace "/" with "."
17
     * to match the way Laravel interprets views.
18
     *
19
     * @param mixed $key
20
     * @param mixed $value
21
     */
22
    public function put($key, $value)
23
    {
24
        $overrides = [];
25
26
        foreach ($value as $view => $override) {
27
            $overrides[str_replace('/', '.', $view)] = $override;
28
        }
29
30
        parent::put($key, $overrides);
31
    }
32
}
33