/**
* Get the filtered extension element from the manifest
*
* @param string $element Optional element name to be converted
*
* @return string The filtered element
*
* @since 3.4
*/
public function getElement($element = null)
{
if ($element || !$this->getManifest()) {
return $element;
}
// Backward Compatibility
// @todo Deprecate in future version
if (!\count($this->getManifest()->files->children())) {
return $element;
}
$type = (string) $this->getManifest()->attributes()->type;
foreach ($this->getManifest()->files->children() as $file) {
if ((string) $file->attributes()->{$type}) {
$element = (string) $file->attributes()->{$type};
break;
}
}
return $element;
}