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)
4444 return json_decode (file_get_contents ($ filename ), true );
4545 }
4646
47- public function store (string $ path )
47+ public function store (string $ path ): void
4848 {
4949 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 ;
5453 }
5554
5655 $ content = Stub::replace (Stub::CONFIG_FILE , [
@@ -60,6 +59,14 @@ public function store(string $path)
6059 FileSupport::store ($ path , $ content );
6160 }
6261
62+ public function storeAsJson (string $ path ): void
63+ {
64+ FileSupport::store (
65+ $ path ,
66+ json_encode ($ this ->content , JSON_PRETTY_PRINT )
67+ );
68+ }
69+
6370 public function isJson (string $ filename ): bool
6471 {
6572 $ extension = pathinfo ($ filename , PATHINFO_EXTENSION );
You can’t perform that action at this time.
0 commit comments