Update JsonBundleReader.php

This commit is contained in:
Johannes Goslar 2017-08-15 14:38:43 +02:00 committed by Nicolas Grekas
parent 0b613dbb57
commit 22a6642632
1 changed files with 6 additions and 9 deletions

View File

@ -32,17 +32,15 @@ class JsonBundleReader implements BundleReaderInterface
if (!file_exists($fileName)) { if (!file_exists($fileName)) {
throw new ResourceBundleNotFoundException(sprintf( throw new ResourceBundleNotFoundException(sprintf(
'The resource bundle "%s/%s.json" does not exist.', 'The resource bundle "%s" does not exist.',
$path, $fileName
$locale
)); ));
} }
if (!is_file($fileName)) { if (!is_file($fileName)) {
throw new RuntimeException(sprintf( throw new RuntimeException(sprintf(
'The resource bundle "%s/%s.json" is not a file.', 'The resource bundle "%s" is not a file.',
$path, $fileName
$locale
)); ));
} }
@ -50,9 +48,8 @@ class JsonBundleReader implements BundleReaderInterface
if (null === $data) { if (null === $data) {
throw new RuntimeException(sprintf( throw new RuntimeException(sprintf(
'The resource bundle "%s/%s.json" contains invalid JSON: %s', 'The resource bundle "%s" contains invalid JSON: %s',
$path, $fileName,
$locale,
self::getLastJsonError() self::getLastJsonError()
)); ));
} }