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