Skip to content

Commit ab8c7f7

Browse files
committed
#151 - Fix psalm errors
1 parent 03e5ad3 commit ab8c7f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Migration/Action/Generate.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function __construct(
164164
) {
165165
}
166166

167-
public function getEntity(): PhpFile
167+
public function getEntity(): ?PhpFile
168168
{
169169
$this->checkEntityExists();
170170

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

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

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

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

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

0 commit comments

Comments
 (0)