File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public function resolve($definition)
83
83
84
84
$ content = file_get_contents ($ path );
85
85
86
- if (pathinfo ($ path , PATHINFO_EXTENSION ) == 'json ' ) {
86
+ if ($ parse == ' auto ' && pathinfo ($ path , PATHINFO_EXTENSION ) == 'json ' ) {
87
87
$ content = json_decode ($ content , true );
88
88
89
89
if (json_last_error () !== JSON_ERROR_NONE ) {
Original file line number Diff line number Diff line change @@ -110,4 +110,11 @@ public function testResolveJson(): void
110
110
{
111
111
verify ($ this ->resolver ->resolve ('./_data/sample.json ' ))->is ()->sameAs (['json ' => true ]);
112
112
}
113
+
114
+ public function testyResolveWithoutParse (): void
115
+ {
116
+ $ definition = new Definition (['file ' => './_data/sample.json ' , 'parse ' => 'text ' ]);
117
+
118
+ verify ($ this ->resolver ->resolve ($ definition ))->is ()->sameAs ('{"json": true} ' . PHP_EOL );
119
+ }
113
120
}
You can’t perform that action at this time.
0 commit comments