File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,12 @@ public function loadJson(string $filename)
44
44
return json_decode (file_get_contents ($ filename ), true );
45
45
}
46
46
47
- public function store (string $ path )
47
+ public function store (string $ path ): void
48
48
{
49
49
if ($ this ->isJson ($ path )) {
50
- FileSupport::store (
51
- $ path ,
52
- json_encode ($ this ->content , JSON_PRETTY_PRINT )
53
- );
50
+ $ this ->storeAsJson ($ path );
51
+
52
+ return ;
54
53
}
55
54
56
55
$ content = Stub::replace (Stub::CONFIG_FILE , [
@@ -60,6 +59,14 @@ public function store(string $path)
60
59
FileSupport::store ($ path , $ content );
61
60
}
62
61
62
+ public function storeAsJson (string $ path ): void
63
+ {
64
+ FileSupport::store (
65
+ $ path ,
66
+ json_encode ($ this ->content , JSON_PRETTY_PRINT )
67
+ );
68
+ }
69
+
63
70
public function isJson (string $ filename ): bool
64
71
{
65
72
$ extension = pathinfo ($ filename , PATHINFO_EXTENSION );
You can’t perform that action at this time.
0 commit comments