Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 295-308 (lines=14) @@
292
     * @return string
293
     * @throws \InvalidArgumentException
294
     */
295
    private function getLogDirectory(): string
296
    {
297
        $logDirectory = getenv(EnvVariables::LOG_DIR);
298
299
        if ($logDirectory === false) {
300
            throw new \InvalidArgumentException('Log directory not received: environment variable not set');
301
        }
302
303
        if (substr($logDirectory, -1) !== DIRECTORY_SEPARATOR) {
304
            $logDirectory .= DIRECTORY_SEPARATOR;
305
        }
306
307
        return $logDirectory;
308
    }
309
310
    private function convertToUtf8($string): string
311
    {

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

@@ 306-319 (lines=14) @@
303
         * @return string
304
         * @throws \InvalidArgumentException
305
         */
306
        private function getLogDirectory(): string
307
        {
308
            $logDirectory = getenv(EnvVariables::LOG_DIR);
309
310
            if ($logDirectory === false) {
311
                throw new \InvalidArgumentException('Log directory not received: environment variable not set');
312
            }
313
314
            if (substr($logDirectory, -1) !== DIRECTORY_SEPARATOR) {
315
                $logDirectory .= DIRECTORY_SEPARATOR;
316
            }
317
318
            return $logDirectory;
319
        }
320
321
        private function convertToUtf8($string): string
322
        {