Skip to content

Commit

Permalink
fix(migration-attributes): psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Jul 29, 2024
1 parent 577fd53 commit d9752d9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Testing\Migration;

use Closure;
Expand Down
8 changes: 8 additions & 0 deletions lib/public/Migration/Attributes/ColumnMigrationAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
* @since 30.0.0
*/
class ColumnMigrationAttribute extends MigrationAttribute implements JsonSerializable {
/**
* @param string $table name of the database table
* @param string $name name of the column
* @param ColumnType|null $type type of the column
* @param string $description description of the migration
* @param array $notes notes about the migration/column
* @since 30.0.0
*/
public function __construct(
string $table,
private string $name = '',
Expand Down
4 changes: 4 additions & 0 deletions lib/public/Migration/Attributes/GenericMigrationAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
* @since 30.0.0
*/
class GenericMigrationAttribute extends MigrationAttribute implements JsonSerializable {
/**
* @param array $details
* @since 30.0.0
*/
public function __construct(
private readonly array $details = []
) {
Expand Down
7 changes: 7 additions & 0 deletions lib/public/Migration/Attributes/IndexMigrationAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
* @since 30.0.0
*/
class IndexMigrationAttribute extends MigrationAttribute implements JsonSerializable {
/**
* @param string $table name of the database table
* @param IndexType|null $type type of the index
* @param string $description description of the migration
* @param array $notes notes abour the migration/index
* @since 30.0.0
*/
public function __construct(
string $table,
private ?IndexType $type = null,
Expand Down
6 changes: 6 additions & 0 deletions lib/public/Migration/Attributes/MigrationAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
* @since 30.0.0
*/
class MigrationAttribute implements JsonSerializable {
/**
* @param string $table name of the database table
* @param string $description description of the migration
* @param array $notes notes about the migration
* @since 30.0.0
*/
public function __construct(
private string $table,
private string $description = '',
Expand Down
7 changes: 7 additions & 0 deletions lib/public/Migration/Attributes/TableMigrationAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
* @since 30.0.0
*/
class TableMigrationAttribute extends MigrationAttribute implements JsonSerializable {
/**
* @param string $table name of the database table
* @param array $columns list of columns
* @param string $description description of the migration
* @param array $notes notes about the migration/table
* @since 30.0.0
*/
public function __construct(
string $table,
private array $columns = [],
Expand Down

0 comments on commit d9752d9

Please sign in to comment.