File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ public function __construct(mixed $parser = null)
2222 if (is_string ($ fileData )) {
2323 $ this ->parserDescriptor = $ fileData ;
2424 }
25+ fclose ($ handler );
2526 }
26- fclose ($ handler );
2727 }
2828
2929 public function execute (CommandInterface $ command = null ): CommandInterface
@@ -38,10 +38,16 @@ public function execute(CommandInterface $command = null): CommandInterface
3838
3939 public function setFileNames (array $ fileNames ): CommandInterface
4040 {
41- $ keys = array_keys ($ fileNames );
42- foreach ($ keys as $ key ) {
43- $ this ->args [$ key ] = $ fileNames [$ key ];
44- }
41+ $ this ->args = array_reduce (
42+ array_keys ($ fileNames ),
43+ function ($ args , $ key ) use ($ fileNames ) {
44+ $ args [$ key ] = $ fileNames [$ key ];
45+
46+ return $ args ;
47+ },
48+ []
49+ );
50+
4551 return $ this ;
4652 }
4753
You can’t perform that action at this time.
0 commit comments