Code Duplication    Length = 3-5 lines in 8 locations

Sitemap/Formatter/XmlFormatter.php 8 locations

@@ 88-90 (lines=3) @@
85
        $buffer .= "\t\t".'<video:description>'.$this->escape($video->getDescription()).'</video:description>'."\n";
86
        $buffer .= "\t\t".'<video:thumbnail_loc>'.$this->escape($video->getThumbnailLoc()).'</video:thumbnail_loc>'."\n";
87
88
        if ($video->getContentLoc() !== null) {
89
            $buffer .= "\t\t".'<video:content_loc>'.$this->escape($video->getContentLoc()).'</video:content_loc>'."\n";
90
        }
91
92
        if ($video->getPlayerLoc() !== null) {
93
            $playerLoc = $video->getPlayerLoc();
@@ 100-102 (lines=3) @@
97
            $buffer .= "\t\t".sprintf('<video:player_loc allow_embed="%s"%s>', $allowEmbed, $autoplay).$this->escape($playerLoc['loc']).'</video:player_loc>'."\n";
98
        }
99
100
        if ($video->getDuration() !== null) {
101
            $buffer .= "\t\t".'<video:duration>'.$this->escape($video->getDuration()).'</video:duration>'."\n";
102
        }
103
104
        if ($video->getExpirationDate() !== null) {
105
            $buffer .= "\t\t".'<video:expiration_date>'.$this->escape($video->getExpirationDate()).'</video:expiration_date>'."\n";
@@ 104-106 (lines=3) @@
101
            $buffer .= "\t\t".'<video:duration>'.$this->escape($video->getDuration()).'</video:duration>'."\n";
102
        }
103
104
        if ($video->getExpirationDate() !== null) {
105
            $buffer .= "\t\t".'<video:expiration_date>'.$this->escape($video->getExpirationDate()).'</video:expiration_date>'."\n";
106
        }
107
108
        if ($video->getRating() !== null) {
109
            $buffer .= "\t\t".'<video:rating>'.$this->escape($video->getRating()).'</video:rating>'."\n";
@@ 108-110 (lines=3) @@
105
            $buffer .= "\t\t".'<video:expiration_date>'.$this->escape($video->getExpirationDate()).'</video:expiration_date>'."\n";
106
        }
107
108
        if ($video->getRating() !== null) {
109
            $buffer .= "\t\t".'<video:rating>'.$this->escape($video->getRating()).'</video:rating>'."\n";
110
        }
111
112
        if ($video->getViewCount() !== null) {
113
            $buffer .= "\t\t".'<video:view_count>'.$this->escape($video->getViewCount()).'</video:view_count>'."\n";
@@ 112-114 (lines=3) @@
109
            $buffer .= "\t\t".'<video:rating>'.$this->escape($video->getRating()).'</video:rating>'."\n";
110
        }
111
112
        if ($video->getViewCount() !== null) {
113
            $buffer .= "\t\t".'<video:view_count>'.$this->escape($video->getViewCount()).'</video:view_count>'."\n";
114
        }
115
116
        if ($video->getPublicationDate() !== null) {
117
            $buffer .= "\t\t".'<video:publication_date>'.$this->escape($video->getPublicationDate()).'</video:publication_date>'."\n";
@@ 116-118 (lines=3) @@
113
            $buffer .= "\t\t".'<video:view_count>'.$this->escape($video->getViewCount()).'</video:view_count>'."\n";
114
        }
115
116
        if ($video->getPublicationDate() !== null) {
117
            $buffer .= "\t\t".'<video:publication_date>'.$this->escape($video->getPublicationDate()).'</video:publication_date>'."\n";
118
        }
119
120
        if ($video->getFamilyFriendly() === false) {
121
            $buffer .= "\t\t".'<video:family_friendly>no</video:family_friendly>'."\n";
@@ 124-128 (lines=5) @@
121
            $buffer .= "\t\t".'<video:family_friendly>no</video:family_friendly>'."\n";
122
        }
123
124
        if ($video->getTags() !== null) {
125
            foreach ($video->getTags() as $tag) {
126
                $buffer .= "\t\t".'<video:tag>'.$this->escape($tag).'</video:tag>'."\n";
127
            }
128
        }
129
130
        if ($video->getCategory() !== null) {
131
            $buffer .= "\t\t".'<video:category>'.$this->escape($video->getCategory()).'</video:category>'."\n";
@@ 130-132 (lines=3) @@
127
            }
128
        }
129
130
        if ($video->getCategory() !== null) {
131
            $buffer .= "\t\t".'<video:category>'.$this->escape($video->getCategory()).'</video:category>'."\n";
132
        }
133
134
        if ($video->getRestrictions() !== null) {
135
            $restrictions = $video->getRestrictions();