Code Duplication    Length = 3-5 lines in 2 locations

src/Paraunit/File/TempDirectory.php 1 location

@@ 80-84 (lines=5) @@
77
            return;
78
        }
79
80
        if (!mkdir($path) && !is_dir($path)) {
81
            throw new \RuntimeException(
82
                sprintf('Unable to create temporary directory \'%s\'.', $path)
83
            );
84
        }
85
    }
86
}
87

src/Paraunit/Parser/JSON/LogPrinter.php 1 location

@@ 165-167 (lines=3) @@
162
            $logFilename = $this->getLogFilename($suite);
163
164
            $logDir = dirname($logFilename);
165
            if (! @mkdir($logDir, 0777, true) && !is_dir($logDir)) {
166
                throw new \RuntimeException('Cannot create folder for JSON logs');
167
            }
168
169
            $this->out = fopen($logFilename, 'wt');
170
        }