Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 31, 2023
1 parent cb78e80 commit 8e5c816
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions src/TextUI/Configuration/Cli/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,24 +804,34 @@ public function fromParameters(array $parameters): Configuration
break;

case '--log-events-text':
$path = $option[1];
$realPath = realpath($path);

if (!$realPath) {
throw new Exception("The path \"{$path}\" specified for the --log-events-text option could not be resolved");
$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],
),
);
}
$logEventsText = $realPath;

$logEventsText = $path;

break;

case '--log-events-verbose-text':
$path = $option[1];
$realPath = realpath($path);

if (!$realPath) {
throw new Exception("The path \"{$path}\" specified for the --log-events-verbose-text option could not be resolved");
$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],
),
);
}
$logEventsVerboseText = $realPath;

$logEventsVerboseText = $path;

break;
}
Expand Down

0 comments on commit 8e5c816

Please sign in to comment.