private function removeTempDirectory()
    {
        $tempDir       = \sys_get_temp_dir();
        $directoryPath = $tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation';

        if (!\file_exists($directoryPath)) {
            return;
        }

        $directory = \opendir($directoryPath);

        while (($file = \readdir($directory)) !== false) {
            if (\in_array($file, ['.', '..'])) {
                continue;
            }

            \unlink($directoryPath . DIRECTORY_SEPARATOR . $file);
        }

        \rmdir($directoryPath);
    }