Skip to content

Commit f8b6663

Browse files
committed
chore: improvements
1 parent a3cde30 commit f8b6663

File tree

1 file changed

+21
-1
lines changed
  • php-subsystem/src/Upgrade/TwoPointOh

1 file changed

+21
-1
lines changed

php-subsystem/src/Upgrade/TwoPointOh/Misc.php

+21-1
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,18 @@ function types(string $file, string $code, array $ast, array $data): ?Replacemen
278278
],
279279
],
280280
'Flarum\\Foundation\\AbstractValidator' => [
281+
'assertValid' => [
282+
'return' => ['void']
283+
],
281284
'getRules' => [
282285
'return' => ['array']
283286
],
287+
'getMessages' => [
288+
'return' => ['array']
289+
],
290+
'makeValidator' => [
291+
'return' => ['\Illuminate\Validation\Validator']
292+
],
284293
],
285294
'Flarum\\Extend\\ExtenderInterface' => [
286295
'extend' => [
@@ -300,6 +309,17 @@ function types(string $file, string $code, array $ast, array $data): ?Replacemen
300309
'return' => ['void']
301310
],
302311
],
312+
'Flarum\\User\\AvatarValidator' => [
313+
'assertValid' => [
314+
'return' => ['void']
315+
],
316+
'getMaxSize' => [
317+
'return' => ['int']
318+
],
319+
'getAllowedTypes' => [
320+
'return' => ['array']
321+
],
322+
],
303323
], function (Node $node) {
304324
if ($node instanceof Node\Stmt\Return_
305325
&& $node->expr instanceof Node\Scalar\String_
@@ -524,7 +544,7 @@ public function leaveNode(\PhpParser\Node $node)
524544
continue;
525545
}
526546

527-
$dockblock = preg_replace('/^\s*\*\s*@param\s*'.($data['type'] ?? '').'\s*\$'.$property.'\s*$/m', '', $dockblock);
547+
$dockblock = preg_replace('/^\s*\*\s*@param\s*'.($data['type'] ?? '').'\s*\$'.$property.'\s*.*$/m', '', $dockblock);
528548
$modified = true;
529549
}
530550

0 commit comments

Comments
 (0)