/** * Get a PHPExiftool Tag from tagName * * @param string $tagName * @param bool $throwException * @return object Makes phpstorm hangs \PHPExiftool\Driver\TagInterface */ public static function loadClassFromTagName($tagName, $throwException = true) { $tagName = str_ireplace('/rdf:rdf/rdf:description/', '', $tagName); if ('' === trim($tagName)) { return new Nosource(); } try { return TagFactory::getFromTagname($tagName); } catch (TagUnknown $exception) { if ($throwException) { throw new NotFoundHttpException(sprintf("Tag %s not found", $tagName), $exception); } } return new Nosource(); }