Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add psalm types for the migration schema closure
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst authored and backportbot[bot] committed Oct 15, 2020
commit 5290cc77bccafde734f8f4c3fe7da826c0b861cd
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 <[email protected]>
*
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 <[email protected]>
*
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