File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 44
55use DutchCodingCompany \LaravelJsonSchema \JsonSchemaRepository ;
66use Illuminate \Console \Command ;
7- use Illuminate \Contracts \Filesystem \Factory as FilesystemFactory ;
8- use Illuminate \Contracts \Filesystem \Filesystem ;
9- use Illuminate \Support \Facades \App ;
107
118class Optimize extends Command
129{
@@ -27,11 +24,11 @@ class Optimize extends Command
2724 /**
2825 * Execute the console command.
2926 */
30- public function handle (FilesystemFactory $ filesystem , JsonSchemaRepository $ repository ): int
27+ public function handle (JsonSchemaRepository $ repository ): int
3128 {
3229 $ this ->call ('json-schema:optimize-clear ' );
3330
34- $ filesystem -> disk ( ' local ' )-> put (
31+ file_put_contents (
3532 $ repository ->fullCachePath (),
3633 '<?php return ' .var_export ($ repository ->schemaFiles (true ), true ).'; ' .PHP_EOL ,
3734 );
Original file line number Diff line number Diff line change 44
55use DutchCodingCompany \LaravelJsonSchema \JsonSchemaRepository ;
66use Illuminate \Console \Command ;
7- use Illuminate \Contracts \Filesystem \Factory as FilesystemFactory ;
87
98class OptimizeClear extends Command
109{
@@ -25,9 +24,11 @@ class OptimizeClear extends Command
2524 /**
2625 * Execute the console command.
2726 */
28- public function handle (FilesystemFactory $ filesystem , JsonSchemaRepository $ repository ): int
27+ public function handle (JsonSchemaRepository $ repository ): int
2928 {
30- $ filesystem ->disk ('local ' )->delete ($ repository ->fullCachePath ());
29+ if (file_exists ($ path = $ repository ->fullCachePath ())) {
30+ unlink ($ path );
31+ }
3132
3233 $ this ->outputComponents ()->info ('Json schemas cache cleared successfully! ' );
3334
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ final public function fullCachePath(): string
7171 */
7272 protected function findSchemaFiles (): array
7373 {
74- if ($ this -> filesystem -> disk ( ' local ' )-> exists ($ path = $ this ->fullCachePath ())) {
74+ if (file_exists ($ path = $ this ->fullCachePath ())) {
7575 return include $ path ;
7676 }
7777
You can’t perform that action at this time.
0 commit comments