minor #14954 fix Merge branch '2.7' into 2.8 JsonFileLoader (gimler)

This PR was merged into the 2.8 branch.

Discussion
----------

fix Merge branch '2.7' into 2.8 JsonFileLoader

This fix a merge commit see 5593bdd56e. The `stream_is_local` and `file_exists` checks are all ready done in the parent `FileLoader` class.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

Commits
-------

692deff fix Merge branch '2.7' into 2.8 JsonFileLoader
This commit is contained in:
Fabien Potencier 2015-06-11 21:33:21 +02:00
commit 5f36605e0e

View File

@ -25,14 +25,6 @@ class JsonFileLoader extends FileLoader
*/
protected function loadResource($resource)
{
if (!stream_is_local($resource)) {
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
}
if (!file_exists($resource)) {
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
}
$messages = array();
if ($data = file_get_contents($resource)) {
$messages = json_decode($data, true);