Skip to content

Commit

Permalink
#151 - Fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Apr 14, 2024
1 parent 03e5ad3 commit ab8c7f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Migration/Action/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function __construct(
) {
}

public function getEntity(): PhpFile
public function getEntity(): ?PhpFile
{
$this->checkEntityExists();

Expand Down Expand Up @@ -231,7 +231,7 @@ public function addMorph(Snippet $snippet, string $table, bool $skipRefSchema =
. $snippet->definitionToString('options', $options)
);

$this->class->addMethod('morph')
$this->class?->addMethod('morph')
->addComment("Define the table structure\n")
->addComment('@return void')
->addComment('@throws Exception')
Expand All @@ -254,7 +254,7 @@ public function addUp(string $table, $exportData = null, bool $shouldExportDataF
$body = "\$this->batchInsert('$table', [{$quoteWrappedColumns}]);";
}

$this->class->addMethod('up')
$this->class?->addMethod('up')
->addComment("Run the migrations\n")
->addComment('@return void')
->setReturnType('void')
Expand All @@ -272,7 +272,7 @@ public function addDown(string $table, $exportData = null, bool $shouldExportDat
$body = "\$this->batchDelete('$table');";
}

$this->class->addMethod('down')
$this->class?->addMethod('down')
->addComment("Reverse the migrations\n")
->addComment('@return void')
->setReturnType('void')
Expand All @@ -292,7 +292,7 @@ public function addAfterCreateTable(string $table, $exportData = null): self
}
$body = "\$this->batchInsert('$table', [{$quoteWrappedColumns}]);";

$this->class->addMethod('afterCreateTable')
$this->class?->addMethod('afterCreateTable')
->addComment("This method is called after the table was created\n")
->addComment('@return void')
->setReturnType('void')
Expand Down

0 comments on commit ab8c7f7

Please sign in to comment.