protected function createDirectory($paths)
    {
        if (!is_array($paths)) {
            $paths = array($paths);
        }

        foreach ($paths as $path) {
            if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException(sprintf('Unable to create directory "%s".', $dir));
                // @codeCoverageIgnoreEnd
            }
        }
    }