@@ -136,10 +136,10 @@ protected function convertImportedTime(array $fields, array $data, ?string &$err
136
136
return $ time instanceof DateTime ? DateTimeImmutable::createFromMutable ($ time ) : $ time ;
137
137
}
138
138
139
- public function importContestData ($ data , ?string &$ message = null , string &$ cid = null ): bool
139
+ public function importContestData ($ data , ?string &$ errorMessage = null , string &$ cid = null ): bool
140
140
{
141
141
if (empty ($ data ) || !is_array ($ data )) {
142
- $ message = 'Error parsing YAML file. ' ;
142
+ $ errorMessage = 'Error parsing YAML file. ' ;
143
143
return false ;
144
144
}
145
145
@@ -167,20 +167,20 @@ public function importContestData($data, ?string &$message = null, string &$cid
167
167
}
168
168
169
169
if (!empty ($ missingFields )) {
170
- $ message = sprintf ('Missing fields: %s ' , implode (', ' , $ missingFields ));
170
+ $ errorMessage = sprintf ('Missing fields: %s ' , implode (', ' , $ missingFields ));
171
171
return false ;
172
172
}
173
173
174
174
$ invalid_regex = str_replace (['/^[ ' , '+$/ ' ], ['/[^ ' , '/ ' ], DOMJudgeService::EXTERNAL_IDENTIFIER_REGEX );
175
175
176
- $ startTime = $ this ->convertImportedTime ($ startTimeFields , $ data , $ message );
177
- if ($ message ) {
176
+ $ startTime = $ this ->convertImportedTime ($ startTimeFields , $ data , $ errorMessage );
177
+ if ($ errorMessage ) {
178
178
return false ;
179
179
}
180
180
181
181
// Activate time is special, it can return non empty message for parsing error or null if no field was provided
182
- $ activateTime = $ this ->convertImportedTime ($ activateTimeFields , $ data , $ message );
183
- if ($ message ) {
182
+ $ activateTime = $ this ->convertImportedTime ($ activateTimeFields , $ data , $ errorMessage );
183
+ if ($ errorMessage ) {
184
184
return false ;
185
185
} elseif (!$ activateTime ) {
186
186
$ activateTime = new DateTime ();
@@ -189,8 +189,8 @@ public function importContestData($data, ?string &$message = null, string &$cid
189
189
}
190
190
}
191
191
192
- $ deactivateTime = $ this ->convertImportedTime ($ deactivateTimeFields , $ data , $ message );
193
- if ($ message ) {
192
+ $ deactivateTime = $ this ->convertImportedTime ($ deactivateTimeFields , $ data , $ errorMessage );
193
+ if ($ errorMessage ) {
194
194
return false ;
195
195
}
196
196
@@ -230,7 +230,7 @@ public function importContestData($data, ?string &$message = null, string &$cid
230
230
if ($ freezeDuration !== null ) {
231
231
$ freezeDurationDiff = Utils::timeStringDiff ($ data ['duration ' ], $ freezeDuration );
232
232
if (str_starts_with ($ freezeDurationDiff , '- ' )) {
233
- $ message = 'Freeze duration is longer than contest length ' ;
233
+ $ errorMessage = 'Freeze duration is longer than contest length ' ;
234
234
return false ;
235
235
}
236
236
$ contest ->setFreezetimeString (sprintf ('+%s ' , $ freezeDurationDiff ));
@@ -246,7 +246,7 @@ public function importContestData($data, ?string &$message = null, string &$cid
246
246
$ messages [] = sprintf ('%s: %s ' , $ error ->getPropertyPath (), $ error ->getMessage ());
247
247
}
248
248
249
- $ message = sprintf ("Contest has errors: \n\n%s " , implode ("\n" , $ messages ));
249
+ $ errorMessage = sprintf ("Contest has errors: \n\n%s " , implode ("\n" , $ messages ));
250
250
return false ;
251
251
}
252
252
0 commit comments