@@ -11,6 +11,8 @@ public function __construct()
1111 {
1212 $ this ->filesContent = [];
1313 $ this ->filesDiffContent = [];
14+
15+ return $ this ;
1416 }
1517
1618 private function constructContent ($ accum , $ item )
@@ -25,20 +27,21 @@ public function execute(object $data): object
2527 $ this ->filesContent [] = array_reduce (
2628 get_object_vars ($ data )['file1 ' ],
2729 [$ this , 'constructContent ' ],
28- "{ " ) . "\r} \n" ;
30+ "{ "
31+ ) . "\r} \n" ;
2932
3033 $ this ->filesContent [] = "file2.json content: \n" ;
3134 $ this ->filesContent [] = array_reduce (
3235 get_object_vars ($ data )['file2 ' ],
3336 [$ this , 'constructContent ' ],
34- "{ " ) . "\n} \n" ;
37+ "{ "
38+ ) . "\n} \n" ;
3539
3640 $ file1Array = get_object_vars ($ data )['file1 ' ];
3741 $ file1Keys = array_keys ($ file1Array );
3842 $ file2Array = get_object_vars ($ data )['file2 ' ];
3943 $ this ->filesDiffContent = array_map (
40- function ($ file1Key ) use ($ file1Array , $ file2Array )
41- {
44+ function ($ file1Key ) use ($ file1Array , $ file2Array ) {
4245 if (array_key_exists ($ file1Key , $ file2Array )) {
4346 if (!strcmp ($ file1Array [$ file1Key ], $ file2Array [$ file1Key ])) {
4447 return " " . $ file1Array [$ file1Key ] . "\n" ;
@@ -49,7 +52,8 @@ function($file1Key) use ($file1Array, $file2Array)
4952 } else {
5053 return " - " . $ file1Array [$ file1Key ] . "\n" ;
5154 }
52- }, $ file1Keys
55+ },
56+ $ file1Keys
5357 );
5458 return $ this ;
5559 }
0 commit comments