Code Duplication    Length = 19-19 lines in 2 locations

src/web/html/Html5TagTrait.php 2 locations

@@ 51-69 (lines=19) @@
48
     * @return string
49
     * @static
50
     */
51
    public static function video(array $sources = [], array $videos = [], array $attributes = [], $noCodec = '')
52
    {
53
        $srcs = '';
54
55
        foreach ($sources AS $name => $value) {
56
            $srcs .= static::tag('source', ['type' => $name, 'src' => $value]);
57
        }
58
59
        foreach ($videos AS $video) {
60
            $srcs .= static::tag('track', [
61
                'kind' => $video['kind'],
62
                'src' => $video['src'],
63
                'srclang' => $video['srclang'],
64
                'label' => $video['label']
65
            ]);
66
        }
67
68
        return static::openTag('video', $attributes).$srcs.$noCodec.static::closeTag('video');
69
    }
70
71
    /**
72
     * Render audio tag
@@ 84-102 (lines=19) @@
81
     * @return string
82
     * @static
83
     */
84
    public static function audio(array $sources = [], array $tracks = [], array $attributes = [], $noCodec = '')
85
    {
86
        $srcs = '';
87
88
        foreach ($sources AS $name => $value) {
89
            $srcs .= static::tag('audio', ['type' => $name, 'src' => $value]);
90
        }
91
92
        foreach ($tracks AS $track) {
93
            $srcs .= static::tag('track', [
94
                'kind' => $track['kind'],
95
                'src' => $track['src'],
96
                'srclang' => $track['srclang'],
97
                'label' => $track['label']
98
            ]);
99
        }
100
101
        return static::openTag('audio', $attributes).$srcs.$noCodec.static::closeTag('audio');
102
    }
103
104
    /**
105
     * Render canvas tag