if (!
($svg instanceof SVG
)) { $this->io->
warning('Could not read ' .
$file . '.You have to handle this file by hand.'
);
continue;
} } catch (\Exception
$e) { $this->io->
warning($e->
getMessage() . ' ' .
$file . \PHP_EOL . 'You have to handle this file by hand.'
);
continue;
} $defs =
$svg->
getDocument()->
getChild(0
);
if (!
($defs instanceof SVGDefs
)) { $defs =
new SVGDefs();
foreach ($this->
getChildren($svg->
getDocument()) as $child) { $svg->
getDocument()->
removeChild($child);
$defs->
addChild($child);
} $svg->
getDocument()->
addChild($defs);
} $child =
$defs->
getChild(0
);