@@ -75,37 +75,35 @@ public function __construct(
75
75
* Add Error Messages for Import
76
76
*
77
77
* @param ProcessingErrorAggregatorInterface $errorAggregator
78
- * @return string|void
78
+ * @return string
79
79
*/
80
80
public function renderMessages (
81
81
ProcessingErrorAggregatorInterface $ errorAggregator
82
- ) {
83
- if ($ errorAggregator ->getErrorsCount ()) {
84
- $ message = '' ;
85
- $ counter = 0 ;
86
- $ escapedMessages = [];
87
- foreach ($ this ->getErrorMessages ($ errorAggregator ) as $ error ) {
88
- $ escapedMessages [] = (++$ counter ) . '. ' . $ this ->escaper ->escapeHtml ($ error );
89
- if ($ counter >= ImportResult::LIMIT_ERRORS_MESSAGE ) {
90
- break ;
91
- }
82
+ ): string {
83
+ $ message = '' ;
84
+ $ counter = 0 ;
85
+ $ escapedMessages = [];
86
+ foreach ($ this ->getErrorMessages ($ errorAggregator ) as $ error ) {
87
+ $ escapedMessages [] = (++$ counter ) . '. ' . $ this ->escaper ->escapeHtml ($ error );
88
+ if ($ counter >= ImportResult::LIMIT_ERRORS_MESSAGE ) {
89
+ break ;
92
90
}
93
- if ( $ errorAggregator -> hasFatalExceptions ()) {
94
- foreach ( $ this -> getSystemExceptions ( $ errorAggregator ) as $ error ) {
95
- $ escapedMessages [] = $ this ->escaper -> escapeHtml ( $ error-> getErrorMessage ())
96
- . ' <a href="#" onclick="$( this).next().show();$(this).hide();return false;"> '
97
- . __ ( ' Show more ' ) . ' </a><div style="display:none;"> ' . __ ( ' Additional data ' ) . ' : '
98
- . $ this -> escaper -> escapeHtml ( $ error -> getErrorDescription ()) . '</div> ' ;
99
- }
91
+ }
92
+ if ( $ errorAggregator -> hasFatalExceptions () ) {
93
+ foreach ( $ this ->getSystemExceptions ( $ errorAggregator ) as $ error) {
94
+ $ escapedMessages [] = $ this -> escaper -> escapeHtml ( $ error -> getErrorMessage ())
95
+ . ' <a href="#" onclick="$(this).next().show();$(this).hide();return false;"> '
96
+ . __ ( ' Show more ' ) . ' </a><div style="display:none;"> ' . __ ( ' Additional data ' ) . ': '
97
+ . $ this -> escaper -> escapeHtml ( $ error -> getErrorDescription ()) . ' </div> ' ;
100
98
}
101
- $ message .= implode ('<br> ' , $ escapedMessages );
102
- return '<strong> ' . __ ('Following Error(s) has been occurred during importing process: ' ) . '</strong><br> '
103
- . '<div class="import-error-wrapper"> ' . __ ('Only the first 100 errors are shown. ' )
104
- . '<a href=" '
105
- . $ this ->createDownloadUrlImportHistoryFile ($ this ->createErrorReport ($ errorAggregator ))
106
- . '"> ' . __ ('Download full report ' ) . '</a><br> '
107
- . '<div class="import-error-list"> ' . $ message . '</div></div> ' ;
108
99
}
100
+ $ message .= implode ('<br> ' , $ escapedMessages );
101
+ return '<strong> ' . __ ('Following Error(s) has been occurred during importing process: ' ) . '</strong><br> '
102
+ . '<div class="import-error-wrapper"> ' . __ ('Only the first 100 errors are shown. ' )
103
+ . '<a href=" '
104
+ . $ this ->createDownloadUrlImportHistoryFile ($ this ->createErrorReport ($ errorAggregator ))
105
+ . '"> ' . __ ('Download full report ' ) . '</a><br> '
106
+ . '<div class="import-error-list"> ' . $ message . '</div></div> ' ;
109
107
}
110
108
111
109
/**
0 commit comments