Skip to content

Commit 342a39c

Browse files
Fix
1 parent 3f6940c commit 342a39c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Parser.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ function parse(array $resultDiff, string $format): string
1414
function parseToJson(string $path): array
1515
{
1616
$content = getFileContent($path);
17-
$extension = substr($path, strpos($path, '.') + 1);
17+
$extension = substr($path, strpos($path, '.'));
1818

1919
return match ($extension) {
20-
'json' => json_decode($content, true),
21-
'yaml' => Yaml::parse($content),
20+
'.json' => json_decode($content, true),
21+
'.yaml' => Yaml::parse($content),
2222
default => throw new \Exception("There is no such extension: {$extension}")
2323
};
2424
}

0 commit comments

Comments
 (0)