These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Rj\FrontendBundle\Manifest\Loader; |
||
4 | |||
5 | class JsonManifestLoader extends AbstractManifestLoader |
||
6 | { |
||
7 | /** |
||
8 | * {@inheritdoc} |
||
9 | */ |
||
10 | 14 | protected function parse($path) |
|
11 | { |
||
12 | 14 | $entries = json_decode(file_get_contents($path), true); |
|
13 | |||
14 | 14 | if (json_last_error() !== JSON_ERROR_NONE) { |
|
15 | throw new \Exception("Failed to parse json manifest file ($path): ".json_last_error_msg()); |
||
0 ignored issues
–
show
|
|||
16 | } |
||
17 | |||
18 | 14 | return $entries; |
|
19 | } |
||
20 | } |
||
21 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.