From ddb0a71dfa20d9495ddea293062511bb09198c11 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sun, 4 Feb 2024 07:42:43 +0100 Subject: [PATCH] Revert "Refactor" This reverts commit 8e5c816f3011c0e3bac21db28675f350d74c3fa4. --- src/TextUI/Configuration/Cli/Builder.php | 34 +++++++++--------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/TextUI/Configuration/Cli/Builder.php b/src/TextUI/Configuration/Cli/Builder.php index 8540232ddbb..ebab59d4171 100644 --- a/src/TextUI/Configuration/Cli/Builder.php +++ b/src/TextUI/Configuration/Cli/Builder.php @@ -806,34 +806,24 @@ public function fromParameters(array $parameters): Configuration break; case '--log-events-text': - $path = realpath($option[1]); - - if (!$path) { - throw new Exception( - sprintf( - 'The path "%s" specified for the --log-events-text option could not be resolved', - $option[1], - ), - ); - } + $path = $option[1]; + $realPath = realpath($path); - $logEventsText = $path; + if (!$realPath) { + throw new Exception("The path \"{$path}\" specified for the --log-events-text option could not be resolved"); + } + $logEventsText = $realPath; break; case '--log-events-verbose-text': - $path = realpath($option[1]); - - if (!$path) { - throw new Exception( - sprintf( - 'The path "%s" specified for the --log-events-verbose-text option could not be resolved', - $option[1], - ), - ); - } + $path = $option[1]; + $realPath = realpath($path); - $logEventsVerboseText = $path; + if (!$realPath) { + throw new Exception("The path \"{$path}\" specified for the --log-events-verbose-text option could not be resolved"); + } + $logEventsVerboseText = $realPath; break;