private static function generateDirectory(string $dir): void
    {
        if (\is_dir($dir) && \is_writable($dir)) {
            return;
        }

        if (! @\mkdir($dir, 0777, true) || ! \is_writable($dir)) {
            throw new RuntimeException(\sprintf(
                'Route cache directory [%s] cannot be created or is write protected.',
                $dir
            ));
        }
    }
private static function generateDirectory(string $dir): void
    {
        if (\is_dir($dir) && \is_writable($dir)) {
            return;
        }

        if (! @\mkdir($dir, 0777, true) || ! \is_writable($dir)) {
            throw new RuntimeException(\sprintf(
                'Route cache directory [%s] cannot be created or is write protected.',
                $dir
            ));
        }
    }
private static function generateDirectory ( string $ dir ) : void { if ( \ is_dir ( $ dir ) && \ is_writable ( $ dir ) ) { return ; } if ( ! @ \ mkdir ( $ dir , 0777 , true ) || ! \ is_writable ( $ dir ) ) { throw new RuntimeException ( \ sprintf ( 'Route cache directory [%s] cannot be created or is write protected.' , $ dir ) ) ; } }
Generate a cache directory.

@param string $dir

@throws \Viserio\Component\Contract\Routing\Exception\RuntimeException

@return void
Generate a cache directory .