@@ -111,19 +111,19 @@ public function __construct(array $repairSteps, EventDispatcherInterface $dispat
111
111
*/
112
112
public function run () {
113
113
if (count ($ this ->repairSteps ) === 0 ) {
114
- $ this ->emit ('\OC\Repair ' , 'info ' , ['No repair steps available ' ]);
114
+ $ this ->emit ('\OC\Repair ' , 'info ' , ['message ' => ' No repair steps available ' ]);
115
115
116
116
return ;
117
117
}
118
118
// run each repair step
119
119
foreach ($ this ->repairSteps as $ step ) {
120
120
$ this ->currentStep = $ step ->getName ();
121
- $ this ->emit ('\OC\Repair ' , 'step ' , [$ this ->currentStep ]);
121
+ $ this ->emit ('\OC\Repair ' , 'step ' , [' step ' => $ this ->currentStep ]);
122
122
try {
123
123
$ step ->run ($ this );
124
124
} catch (\Exception $ e ) {
125
125
$ this ->logger ->error ("Exception while executing repair step " . $ step ->getName (), ['exception ' => $ e ]);
126
- $ this ->emit ('\OC\Repair ' , 'error ' , [$ e ->getMessage ()]);
126
+ $ this ->emit ('\OC\Repair ' , 'error ' , [' message ' => $ e ->getMessage ()]);
127
127
}
128
128
}
129
129
}
@@ -248,36 +248,32 @@ public static function getBeforeUpgradeRepairSteps() {
248
248
}
249
249
250
250
/**
251
- * @param string $scope
252
- * @param string $method
253
- * @param array $arguments
251
+ * @param array<string, mixed> $arguments
254
252
*/
255
- public function emit ($ scope , $ method , array $ arguments = []) {
256
- if (!is_null ($ this ->dispatcher )) {
257
- $ this ->dispatcher ->dispatch ("$ scope:: $ method " ,
253
+ public function emit (string $ scope , string $ method , array $ arguments = []): void {
254
+ $ this ->dispatcher ->dispatch ("$ scope:: $ method " ,
258
255
new GenericEvent ("$ scope:: $ method " , $ arguments ));
259
- }
260
256
}
261
257
262
258
public function info ($ string ) {
263
259
// for now just emit as we did in the past
264
- $ this ->emit ('\OC\Repair ' , 'info ' , [$ string ]);
260
+ $ this ->emit ('\OC\Repair ' , 'info ' , [' message ' => $ string ]);
265
261
}
266
262
267
263
/**
268
264
* @param string $message
269
265
*/
270
266
public function warning ($ message ) {
271
267
// for now just emit as we did in the past
272
- $ this ->emit ('\OC\Repair ' , 'warning ' , [$ message ]);
268
+ $ this ->emit ('\OC\Repair ' , 'warning ' , [' message ' => $ message ]);
273
269
}
274
270
275
271
/**
276
272
* @param int $max
277
273
*/
278
274
public function startProgress ($ max = 0 ) {
279
275
// for now just emit as we did in the past
280
- $ this ->emit ('\OC\Repair ' , 'startProgress ' , [$ max , $ this ->currentStep ]);
276
+ $ this ->emit ('\OC\Repair ' , 'startProgress ' , [' max ' => $ max , ' step ' => $ this ->currentStep ]);
281
277
}
282
278
283
279
/**
@@ -286,7 +282,7 @@ public function startProgress($max = 0) {
286
282
*/
287
283
public function advance ($ step = 1 , $ description = '' ) {
288
284
// for now just emit as we did in the past
289
- $ this ->emit ('\OC\Repair ' , 'advance ' , [$ step , $ description ]);
285
+ $ this ->emit ('\OC\Repair ' , 'advance ' , [' step ' => $ step , ' desc ' => $ description ]);
290
286
}
291
287
292
288
/**
0 commit comments