public function registerFormat($format, $class)
{
if (!class_exists($class)) {
throw new \InvalidArgumentException("Parser formatter class {$class} not found.");
}
if (!is_a($class, 'Nathanmac\\Utilities\\Parser\\Formats\\FormatInterface', true)) {
throw new \InvalidArgumentException('Parser formatters must implement the Nathanmac\\Utilities\\Parser\\Formats\\FormatInterface interface.');
}
$this->supported_formats[$format] = $class;
return $this;
}