Code Duplication    Length = 13-14 lines in 2 locations

src/Assets.php 2 locations

@@ 108-120 (lines=13) @@
105
     * @return $this
106
     * @author Sang Nguyen
107
     */
108
    public function addStylesheetsDirectly($assets)
109
    {
110
        if (!is_array($assets)) {
111
            $assets = func_get_args();
112
        }
113
        foreach ($assets as &$item) {
114
            $item = $item . $this->build;
115
            if (!in_array($item, $this->appendedCss)) {
116
                $this->appendedCss[] = [
117
                    'src' => $item,
118
                    'attributes' => [],
119
                ];
120
            }
121
        }
122
        return $this;
123
    }
@@ 131-144 (lines=14) @@
128
     * @return $this
129
     * @author Sang Nguyen
130
     */
131
    public function addJavascriptDirectly($assets, $location = 'bottom')
132
    {
133
        if (!is_array($assets)) {
134
            $assets = func_get_args();
135
        }
136
137
        foreach ($assets as &$item) {
138
            $item = $item . $this->build;
139
            if (!in_array($item, $this->appendedJs[$location])) {
140
                $this->appendedJs[$location][] = ['src' => $item, 'attributes' => []];
141
            }
142
        }
143
        return $this;
144
    }
145
146
    /**
147
     * Remove Css to current module