Code Duplication    Length = 68-68 lines in 2 locations

src/RSSFeed/simplepie/simplepie_1.3.1.mini.php 2 locations

@@ 1180-1247 (lines=68) @@
1177
        }
1178
    }
1179
    
1180
    public function get_authors()
1181
    {
1182
        $authors = array();
1183
        foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
1184
        {
1185
            $name = null;
1186
            $uri = null;
1187
            $email = null;
1188
            if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
1189
            {
1190
                $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1191
            }
1192
            if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
1193
            {
1194
                $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
1195
            }
1196
            if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
1197
            {
1198
                $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1199
            }
1200
            if ($name !== null || $email !== null || $uri !== null)
1201
            {
1202
                $authors[] = $this->registry->create('Author', array($name, $uri, $email));
1203
            }
1204
        }
1205
        if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
1206
        {
1207
            $name = null;
1208
            $url = null;
1209
            $email = null;
1210
            if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
1211
            {
1212
                $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1213
            }
1214
            if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
1215
            {
1216
                $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
1217
            }
1218
            if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
1219
            {
1220
                $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
1221
            }
1222
            if ($name !== null || $email !== null || $url !== null)
1223
            {
1224
                $authors[] = $this->registry->create('Author', array($name, $url, $email));
1225
            }
1226
        }
1227
        foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
1228
        {
1229
            $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
1230
        }
1231
        foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
1232
        {
1233
            $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
1234
        }
1235
        foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
1236
        {
1237
            $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
1238
        }
1239
        if (!empty($authors))
1240
        {
1241
            return array_unique($authors);
1242
        }
1243
        else
1244
        {
1245
            return null;
1246
        }
1247
    }
1248
    
1249
    public function get_contributor($key = 0)
1250
    {
@@ 12784-12851 (lines=68) @@
12781
            return null;
12782
        }
12783
    }
12784
    public function get_authors()
12785
    {
12786
        $authors = array();
12787
        foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
12788
        {
12789
            $name = null;
12790
            $uri = null;
12791
            $email = null;
12792
            if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
12793
            {
12794
                $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
12795
            }
12796
            if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
12797
            {
12798
                $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
12799
            }
12800
            if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
12801
            {
12802
                $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
12803
            }
12804
            if ($name !== null || $email !== null || $uri !== null)
12805
            {
12806
                $authors[] = $this->registry->create('Author', array($name, $uri, $email));
12807
            }
12808
        }
12809
        if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
12810
        {
12811
            $name = null;
12812
            $url = null;
12813
            $email = null;
12814
            if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
12815
            {
12816
                $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
12817
            }
12818
            if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
12819
            {
12820
                $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
12821
            }
12822
            if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
12823
            {
12824
                $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
12825
            }
12826
            if ($name !== null || $email !== null || $url !== null)
12827
            {
12828
                $authors[] = $this->registry->create('Author', array($name, $url, $email));
12829
            }
12830
        }
12831
        foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
12832
        {
12833
            $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
12834
        }
12835
        foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
12836
        {
12837
            $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
12838
        }
12839
        foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
12840
        {
12841
            $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
12842
        }
12843
        if (!empty($authors))
12844
        {
12845
            return array_unique($authors);
12846
        }
12847
        else
12848
        {
12849
            return null;
12850
        }
12851
    }
12852
    public function get_contributor($key = 0)
12853
    {
12854
        $contributors = $this->get_contributors();