8000 minor #23896 [Inlt] Fix JsonBundleReader exceptions (ksjogo) · symfony/symfony@f1c65c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1c65c0

Browse files
minor #23896 [Inlt] Fix JsonBundleReader exceptions (ksjogo)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #23896). Discussion ---------- [Inlt] Fix JsonBundleReader exceptions | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes/no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 22a6642 Update JsonBundleReader.php
2 parents 0b613db + 22a6642 commit f1c65c0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/Symfony/Component/Intl/Data/Bundle/Reader/JsonBundleReader.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,24 @@ public function read($path, $locale)
3232

3333
if (!file_exists($fileName)) {
3434
throw new ResourceBundleNotFoundException(sprintf(
35-
'The resource bundle "%s/%s.json" does not exist.',
36-
$path,
37-
$locale
35+
'The resource bundle "%s" does not exist.',
36+
$fileName
3837
));
3938
}
4039

4140
if (!is_file($fileName)) {
4241
throw new RuntimeException(sprintf(
43-
'The resource bundle "%s/%s.json" is not a file.',
44-
$path,
45-
$locale
42+
'The resource bundle "%s" is not a file.',
43+
$fileName
4644
));
4745
}
4846

4947
$data = json_decode(file_get_contents($fileName), true);
5048

5149
if (null === $data) {
5250
throw new RuntimeException(sprintf(
53-
'The resource bundle "%s/%s.json" contains invalid JSON: %s',
54-
$path,
55-
$locale,
51+
'The resource bundle "%s" contains invalid JSON: %s',
52+
$fileName,
5653
self::getLastJsonError()
5754
));
5855
}

0 commit comments

Comments
 (0)
0