Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/FileRepository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check failure on line 1 in src/FileRepository.php

View workflow job for this annotation

GitHub Actions / psalm (ubuntu-latest, 8.2, locked)

UnusedBaselineEntry

src/FileRepository.php:0:0: UnusedBaselineEntry: Baseline for issue "MixedArgument" has 1 extra entry. (see https://psalm.dev/316)

Check failure on line 1 in src/FileRepository.php

View workflow job for this annotation

GitHub Actions / psalm (ubuntu-latest, 8.2, locked)

UnusedBaselineEntry

src/FileRepository.php:0:0: UnusedBaselineEntry: Baseline for issue "MixedAssignment" has 1 extra entry. (see https://psalm.dev/316)

declare(strict_types=1);

Expand Down Expand Up @@ -39,7 +39,7 @@
private FilesInterface $files;
private Inflector $inflector;

public function __construct(private MigrationConfig $config, FactoryInterface $factory = null)
public function __construct(private MigrationConfig $config, ?FactoryInterface $factory = null)
{
$this->files = new Files();
$this->factory = $factory ?? new Container();
Expand Down Expand Up @@ -71,7 +71,7 @@
return $migrations;
}

public function registerMigration(string $name, string $class, string $body = null): string
public function registerMigration(string $name, string $class, ?string $body = null): string
{
if (empty($body) && !\class_exists($class)) {
throw new RepositoryException(
Expand Down Expand Up @@ -134,7 +134,7 @@
*/
private function getFiles(string $directory): \Generator
{
foreach ($this->files->getFiles($directory, '*.php') as $filename) {

Check failure on line 137 in src/FileRepository.php

View workflow job for this annotation

GitHub Actions / psalm (ubuntu-latest, 8.2, locked)

ArgumentTypeCoercion

src/FileRepository.php:137:41: ArgumentTypeCoercion: Argument 1 of Spiral\Files\FilesInterface::getFiles expects non-empty-string, but parent type string provided (see https://psalm.dev/193)
$reflection = new ReflectionFile($filename);
$definition = \explode('_', \basename($filename, '.php'), 3);

Expand Down
6 changes: 3 additions & 3 deletions src/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getMigrations(): array
*
* @throws MigrationException
*/
public function run(CapsuleInterface $capsule = null): ?MigrationInterface
public function run(?CapsuleInterface $capsule = null): ?MigrationInterface
{
if (!$this->isConfigured()) {
throw new MigrationException('Unable to run migration, Migrator not configured');
Expand Down Expand Up @@ -158,7 +158,7 @@ static function () use ($migration, $capsule): void {
*
* @throws \Throwable
*/
public function rollback(CapsuleInterface $capsule = null): ?MigrationInterface
public function rollback(?CapsuleInterface $capsule = null): ?MigrationInterface
{
if (!$this->isConfigured()) {
throw new MigrationException('Unable to run migration, Migrator not configured');
Expand Down Expand Up @@ -214,7 +214,7 @@ protected function resolveState(MigrationInterface $migration): State
* Migration table, all migration information will be stored in it.
*
*/
protected function migrationTable(string $database = null): Table
protected function migrationTable(?string $database = null): Table
{
return $this->dbal->database($database)->table($this->config->getTable());
}
Expand Down
2 changes: 1 addition & 1 deletion src/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ public function getMigrations(): array;
* @throws RepositoryException
*
*/
public function registerMigration(string $name, string $class, string $body = null): string;
public function registerMigration(string $name, string $class, ?string $body = null): string;
}
2 changes: 1 addition & 1 deletion src/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getTimeExecuted(): ?\DateTimeInterface
return $this->timeExecuted;
}

public function withStatus(int $status, \DateTimeInterface $timeExecuted = null): self
public function withStatus(int $status, ?\DateTimeInterface $timeExecuted = null): self
{
$state = clone $this;
$state->status = $status;
Expand Down
Loading