@@ -126,15 +126,17 @@ public function actionIndex(array $sourceDirs, $targetDir)
126
126
$ renderer ->render ($ context , $ targetDir );
127
127
128
128
if (!empty ($ context ->errors )) {
129
- ArrayHelper::multisort ($ context ->errors , 'file ' );
130
- file_put_contents ($ targetDir . '/errors.txt ' , print_r ($ context ->errors , true ));
131
- $ this ->stdout (count ($ context ->errors ) . " errors have been logged to $ targetDir/errors.txt \n" , Console::FG_RED , Console::BOLD );
129
+ $ errors = array_map ('unserialize ' , array_unique (array_map ('serialize ' , $ context ->errors )));
130
+ ArrayHelper::multisort ($ errors , 'file ' );
131
+ file_put_contents ($ targetDir . '/errors.txt ' , print_r ($ errors , true ));
132
+ $ this ->stdout (count ($ errors ) . " errors have been logged to $ targetDir/errors.txt \n" , Console::FG_RED , Console::BOLD );
132
133
}
133
134
134
135
if (!empty ($ context ->warnings )) {
135
- ArrayHelper::multisort ($ context ->warnings , 'file ' );
136
- file_put_contents ($ targetDir . '/warnings.txt ' , print_r ($ context ->warnings , true ));
137
- $ this ->stdout (count ($ context ->warnings ) . " warnings have been logged to $ targetDir/warnings.txt \n" , Console::FG_YELLOW , Console::BOLD );
136
+ $ warnings = array_map ('unserialize ' , array_unique (array_map ('serialize ' , $ context ->warnings )));
137
+ ArrayHelper::multisort ($ warnings , 'file ' );
138
+ file_put_contents ($ targetDir . '/warnings.txt ' , print_r ($ warnings , true ));
139
+ $ this ->stdout (count ($ warnings ) . " warnings have been logged to $ targetDir/warnings.txt \n" , Console::FG_YELLOW , Console::BOLD );
138
140
}
139
141
140
142
return 0 ;
0 commit comments