Skip to content

Commit 30ad2ec

Browse files
committed
Remove dead code getOrCreateRDFDescription()
1 parent ce412df commit 30ad2ec

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/Metadata/Xmp.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -292,45 +292,6 @@ private function getRDFDescription($namespace)
292292
return null;
293293
}
294294

295-
/**
296-
* @param $namespace
297-
*
298-
* @return \DOMElement|\DOMNode|null
299-
*/
300-
private function getOrCreateRDFDescription($namespace)
301-
{
302-
$desc = $this->getRDFDescription($namespace);
303-
304-
if ($desc) {
305-
return $desc;
306-
}
307-
308-
// try and find any rdf:Description, and add to that
309-
$desc = $this->xpath->query('//rdf:Description')->item(0);
310-
311-
if ($desc) {
312-
return $desc;
313-
}
314-
315-
// no rdf:Description's, create new
316-
$prefix = array_search($namespace, $this->namespaces);
317-
318-
$desc = $this->dom->createElementNS(self::RDF_NS, 'rdf:Description');
319-
$desc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:' . $prefix, $namespace);
320-
321-
$rdf = $this->xpath->query('rdf:RDF', $this->dom->documentElement)->item(0);
322-
323-
// check if rdf:RDF element exists, and create it if not
324-
if (!$rdf) {
325-
$rdf = $this->dom->createElementNS(self::RDF_NS, 'rdf:RDF');
326-
$this->dom->documentElement->appendChild($rdf);
327-
}
328-
329-
$rdf->appendChild($desc);
330-
331-
return $desc;
332-
}
333-
334295
/**
335296
* @return string
336297
*/

0 commit comments

Comments
 (0)