Skip to content

Commit

Permalink
Merge pull request #23472 from nextcloud/backport/23464/stable20
Browse files Browse the repository at this point in the history
[stable20] Add psalm types for the migration schema closure
  • Loading branch information
MorrisJobke authored Oct 16, 2020
2 parents dd7c6d1 + 5290cc7 commit 3d765da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
6 changes: 6 additions & 0 deletions lib/public/Migration/IMigrationStep.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
Expand Down Expand Up @@ -49,6 +52,7 @@ public function description(): string;
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
* @since 13.0.0
*/
Expand All @@ -57,6 +61,7 @@ public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
* @since 13.0.0
Expand All @@ -66,6 +71,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
* @since 13.0.0
*/
Expand Down
21 changes: 9 additions & 12 deletions lib/public/Migration/SimpleMigrationStep.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
Expand All @@ -25,8 +28,6 @@

namespace OCP\Migration;

use OCP\DB\ISchemaWrapper;

/**
* @since 13.0.0
*/
Expand All @@ -52,29 +53,25 @@ public function description(): string {
}

/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* {@inheritDoc}
*
* @since 13.0.0
*/
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
}

/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
* {@inheritDoc}
*
* @since 13.0.0
*/
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
return null;
}

/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* {@inheritDoc}
*
* @since 13.0.0
*/
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
Expand Down

0 comments on commit 3d765da

Please sign in to comment.