Skip to content

Commit 2ddd25b

Browse files
Fix 'Enforce that an expression gets used' errors
1 parent 34af782 commit 2ddd25b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Differ/Translator.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use Symfony\Component\Yaml\Yaml;
66

7-
use function cli\line;
8-
97
function getJson(string $path): array
108
{
119
if (str_ends_with($path, '.yaml') || str_ends_with($path, '.yml')) {
@@ -29,14 +27,11 @@ function getFileContent(string $path): string
2927
}
3028

3129
if (!file_exists($fullPath)) {
32-
$errorMessage = <<<DOC
30+
return <<<DOC
3331
{$redColor}ERROR!{$normalColor}
3432
3533
File: "{$fullPath}" don't exists!
3634
DOC;
37-
38-
line($errorMessage);
39-
exit;
4035
}
4136

4237
return file_get_contents($fullPath);

src/Parser.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77

88
function parse(string $pathToFile1, string $pathToFile2, string $format): void
99
{
10-
line(genDiff($pathToFile1, $pathToFile2, $format));
10+
$resultString = genDiff($pathToFile1, $pathToFile2, $format);
11+
line($resultString);
1112
}

0 commit comments

Comments
 (0)