Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix iMigration type hints #34562

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 8 additions & 8 deletions core/Command/Db/Migrations/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,21 @@ class GenerateCommand extends Command implements CompletionAwareInterface {
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

/**
* Auto-generated migration step: Please modify to your needs!
*/
class {{classname}} extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param Closure $schemaClosure
* @psalm-param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
}

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param Closure $schemaClosure
* @psalm-param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
Expand All @@ -98,8 +97,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
g * @param array $options
* @param Closure $schemaClosure
* @psalm-param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
}
Expand Down
4 changes: 2 additions & 2 deletions core/Migrations/Version25000Date20220602190540.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
class Version25000Date20220602190540 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param Closure(): ISchemaWrapper $schemaClosure
* @psalm-param Closure $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$comments = $schema->getTable('comments');
Expand Down
9 changes: 4 additions & 5 deletions lib/public/Migration/BigIntMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
namespace OCP\Migration;

use Closure;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\DB\ISchemaWrapper;
Expand All @@ -39,13 +40,11 @@ abstract class BigIntMigration extends SimpleMigrationStep {
abstract protected function getColumnsByTable();

/**
* @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) {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

Expand Down
7 changes: 7 additions & 0 deletions lib/public/Migration/IMigrationStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ interface IMigrationStep {
public function name(): string;

/**
<<<<<<< HEAD
* Human-readable description of the migration step
=======
* Human-readable description of the migration steps
>>>>>>> acf9c4a0c68... fixup! fix imigration type hints
*
* @return string
* @since 14.0.0
Expand All @@ -55,6 +59,7 @@ public function description(): string;
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
*
* @since 13.0.0
*/
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
Expand All @@ -65,6 +70,7 @@ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*
* @since 13.0.0
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options);
Expand All @@ -74,6 +80,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
*
* @since 13.0.0
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
Expand Down
9 changes: 6 additions & 3 deletions lib/public/Migration/SimpleMigrationStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ public function description(): string {
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
*
* @since 13.0.0
*/
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
}

/**
Expand All @@ -71,9 +72,10 @@ public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
*
* @since 13.0.0
*/
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
return null;
}

Expand All @@ -82,8 +84,9 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @psalm-param Closure():ISchemaWrapper $schemaClosure
* @param array $options
*
* @since 13.0.0
*/
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
}
}