ViewOverrides::put()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
1
<?php namespace Anomaly\Streams\Platform\View;
2
3
use Illuminate\Support\Collection;
4
5
/**
6
 * Class ViewOverrides
7
 *
8
 * @link   http://pyrocms.com/
9
 * @author PyroCMS, Inc. <[email protected]>
10
 * @author Ryan Thompson <[email protected]>
11
 */
12 View Code Duplication
class ViewOverrides extends Collection
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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