Skip to content

Commit 3d765da

Browse files
authored
Merge pull request #23472 from nextcloud/backport/23464/stable20
[stable20] Add psalm types for the migration schema closure
2 parents dd7c6d1 + 5290cc7 commit 3d765da

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

lib/public/Migration/IMigrationStep.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
36
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
47
*
@@ -49,6 +52,7 @@ public function description(): string;
4952
/**
5053
* @param IOutput $output
5154
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
55+
* @psalm-param Closure():ISchemaWrapper $schemaClosure
5256
* @param array $options
5357
* @since 13.0.0
5458
*/
@@ -57,6 +61,7 @@ public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array
5761
/**
5862
* @param IOutput $output
5963
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
64+
* @psalm-param Closure():ISchemaWrapper $schemaClosure
6065
* @param array $options
6166
* @return null|ISchemaWrapper
6267
* @since 13.0.0
@@ -66,6 +71,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
6671
/**
6772
* @param IOutput $output
6873
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
74+
* @psalm-param Closure():ISchemaWrapper $schemaClosure
6975
* @param array $options
7076
* @since 13.0.0
7177
*/

lib/public/Migration/SimpleMigrationStep.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
36
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
47
*
@@ -25,8 +28,6 @@
2528

2629
namespace OCP\Migration;
2730

28-
use OCP\DB\ISchemaWrapper;
29-
3031
/**
3132
* @since 13.0.0
3233
*/
@@ -52,29 +53,25 @@ public function description(): string {
5253
}
5354

5455
/**
55-
* @param IOutput $output
56-
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
57-
* @param array $options
56+
* {@inheritDoc}
57+
*
5858
* @since 13.0.0
5959
*/
6060
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
6161
}
6262

6363
/**
64-
* @param IOutput $output
65-
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
66-
* @param array $options
67-
* @return null|ISchemaWrapper
64+
* {@inheritDoc}
65+
*
6866
* @since 13.0.0
6967
*/
7068
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
7169
return null;
7270
}
7371

7472
/**
75-
* @param IOutput $output
76-
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
77-
* @param array $options
73+
* {@inheritDoc}
74+
*
7875
* @since 13.0.0
7976
*/
8077
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {

0 commit comments

Comments
 (0)