protected function scanFormatters($dirs)
    {
        $dirs = is_array($dirs) ? $dirs : array($dirs);
        foreach ($dirs as $key => $dir) {
            $namespace = null;
            if (is_string($key)) {
                $namespace = $dir;
                $dir = $key;
            }
            if (is_dir($dir)) {
                $parts = array('*', '*', 'Formatter.php');
                if (null == $namespace) {
                    $parts = array_merge(array('*', 'MwbExporter', 'Formatter'), $parts);
                }
                $pattern = implode(DIRECTORY_SEPARATOR, array_merge(array($dir), $parts));
                foreach (glob($pattern) as $filename) {
                    $parts = explode(DIRECTORY_SEPARATOR, dirname(realpath($filename)));
                    $exporter = array_pop($parts);
                    $module = array_pop($parts);
                    $class = sprintf('%s\\%s\\%s\\Formatter', $namespace ?: '\\MwbExporter\\Formatter', $module, $exporter);
                    $this->registerFormatter(array($module, $exporter), $class);
                }
            }
        }

        return $this;
    }