Code Duplication    Length = 8-8 lines in 2 locations

Bundle/WidgetBundle/Twig/LinkExtension.php 2 locations

@@ 164-171 (lines=8) @@
161
162
        //Assemble and prepare attributes
163
        $attributes = [];
164
        foreach ($attr as $key => $_attr) {
165
            if (is_array($_attr)) {
166
                $attr = implode($_attr, ' ');
167
            } else {
168
                $attr = $_attr;
169
            }
170
            $attributes[] = $key.'="'.$attr.'"';
171
        }
172
173
        $url = $this->victoireLinkUrl($parameters, true, $url);
174
        //Creates a new twig environment
@@ 201-208 (lines=8) @@
198
        }
199
200
        $linkAttributes = [];
201
        foreach ($linkAttr as $key => $_attr) {
202
            if (is_array($_attr)) {
203
                $linkAttr = implode($_attr, ' ');
204
            } else {
205
                $linkAttr = $_attr;
206
            }
207
            $linkAttributes[] = $key.'="'.$linkAttr.'"';
208
        }
209
210
        return '<li '.implode($linkAttributes, ' ').'>'.$this->victoireLink($parameters, $label, $attr, false, '#top').'</li>';
211
    }