Skip to content

Commit

Permalink
Fix static analysis and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 13, 2024
1 parent 14e4dbc commit a98164b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 36 deletions.
22 changes: 0 additions & 22 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@
<code>ConfigurationTrait</code>
</DeprecatedTrait>
</file>
<file src="src/Config/Config.php">
<DeprecatedMethod>
<code>getEnvironments</code>
<code>getEnvironments</code>
<code>hasEnvironment</code>
<code>hasEnvironment</code>
<code>searchNamespace</code>
<code>searchNamespace</code>
</DeprecatedMethod>
<LessSpecificImplementedReturnType>
<code>array</code>
<code>array</code>
<code>array</code>
<code>array</code>
</LessSpecificImplementedReturnType>
</file>
<file src="src/Config/ConfigInterface.php">
<MissingTemplateParam>
<code>ArrayAccess</code>
Expand Down Expand Up @@ -143,12 +127,6 @@
<ArgumentTypeCoercion>
<code>array_merge($versions, array_keys($migrations))</code>
</ArgumentTypeCoercion>
<DeprecatedMethod>
<code>getDataDomain</code>
<code>getMigrationNamespaceByPath</code>
<code>getSeedNamespaceByPath</code>
<code>hasEnvironment</code>
</DeprecatedMethod>
<RedundantPropertyInitializationCheck>
<code><![CDATA[isset($this->container)]]></code>
</RedundantPropertyInitializationCheck>
Expand Down
4 changes: 1 addition & 3 deletions src/Migration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ protected function printMissingVersion(array $version, int $maxNameLength): void
/**
* Migrate to the version of the database on a given date.
*
* @param string $environment Environment
* @param \DateTime $dateTime Date to migrate to
* @param bool $fake flag that if true, we just record running the migration, but not actually do the
* migration
Expand Down Expand Up @@ -312,7 +311,7 @@ protected function getMigrationClassName(string $path): string
*/
public function getVersionsToMark(InputInterface $input): array
{
$migrations = $this->getMigrations('default');
$migrations = $this->getMigrations();

Check warning on line 314 in src/Migration/Manager.php

View check run for this annotation

Codecov / codecov/patch

src/Migration/Manager.php#L314

Added line #L314 was not covered by tests
$versions = array_keys($migrations);

$versionArg = $input->getArgument('version');
Expand Down Expand Up @@ -1116,7 +1115,6 @@ public function toggleBreakpoint(?int $version): void
/**
* Updates the breakpoint for a specific version.
*
* @param string $environment The required environment
* @param int|null $version The version of the target migration
* @param int $mark The state of the breakpoint as defined by self::BREAKPOINT_xxxx constants.
* @return void
Expand Down
22 changes: 11 additions & 11 deletions tests/TestCase/Migration/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2158,7 +2158,7 @@ public static function rollbackLastDataProvider(): array
];
}

public function testExecuteSeedWorksAsExpected():void
public function testExecuteSeedWorksAsExpected(): void
{
// stub environment
$envStub = $this->getMockBuilder(Environment::class)
Expand All @@ -2173,7 +2173,7 @@ public function testExecuteSeedWorksAsExpected():void
$this->assertStringContainsString('UserSeeder', $output);
}

public function testExecuteASingleSeedWorksAsExpected():void
public function testExecuteASingleSeedWorksAsExpected(): void
{
// stub environment
$envStub = $this->getMockBuilder(Environment::class)
Expand All @@ -2186,7 +2186,7 @@ public function testExecuteASingleSeedWorksAsExpected():void
$this->assertStringContainsString('UserSeeder', $output);
}

public function testExecuteANonExistentSeedWorksAsExpected():void
public function testExecuteANonExistentSeedWorksAsExpected(): void
{
// stub environment
$envStub = $this->getMockBuilder(Environment::class)
Expand All @@ -2200,15 +2200,15 @@ public function testExecuteANonExistentSeedWorksAsExpected():void
$this->manager->seed('NonExistentSeeder');
}

public function testOrderSeeds():void
public function testOrderSeeds(): void
{
$seeds = array_values($this->manager->getSeeds());
$this->assertInstanceOf('UserSeeder', $seeds[0]);
$this->assertInstanceOf('GSeeder', $seeds[1]);
$this->assertInstanceOf('PostSeeder', $seeds[2]);
}

public function testSeedWillNotBeExecuted():void
public function testSeedWillNotBeExecuted(): void
{
// stub environment
$envStub = $this->getMockBuilder(Environment::class)
Expand All @@ -2221,7 +2221,7 @@ public function testSeedWillNotBeExecuted():void
$this->assertStringContainsString('skipped', $output);
}

public function testGettingInputObject():void
public function testGettingInputObject(): void
{
$migrations = $this->manager->getMigrations();
$seeds = $this->manager->getSeeds();
Expand All @@ -2236,7 +2236,7 @@ public function testGettingInputObject():void
}
}

public function testGettingOutputObject():void
public function testGettingOutputObject(): void
{
$migrations = $this->manager->getMigrations();
$seeds = $this->manager->getSeeds();
Expand All @@ -2251,7 +2251,7 @@ public function testGettingOutputObject():void
}
}

public function testReversibleMigrationsWorkAsExpected():void
public function testReversibleMigrationsWorkAsExpected(): void
{
$adapter = $this->prepareEnvironment([
'migrations' => ROOT . '/config/Reversiblemigrations',
Expand Down Expand Up @@ -2294,7 +2294,7 @@ public function testReversibleMigrationsWorkAsExpected():void
$this->assertFalse($adapter->hasTable('users'));
}

public function testReversibleMigrationWithIndexConflict():void
public function testReversibleMigrationWithIndexConflict(): void
{
if ($this->getDriverType() !== 'mysql') {
$this->markTestSkipped('Test requires mysql connection');
Expand Down Expand Up @@ -2334,7 +2334,7 @@ public function testReversibleMigrationWithIndexConflict():void
$this->assertFalse($adapter->hasIndex('my_table', ['entity_id']));
}

public function testReversibleMigrationWithFKConflictOnTableDrop():void
public function testReversibleMigrationWithFKConflictOnTableDrop(): void
{
if ($this->getDriverType() !== 'mysql') {
$this->markTestSkipped('Test requires mysql');
Expand Down Expand Up @@ -2548,7 +2548,7 @@ public function testBreakpointsTogglingOperateAsExpected(): void
}
}

public function testBreakpointWithInvalidVersion():void
public function testBreakpointWithInvalidVersion(): void
{
if ($this->getDriverType() !== 'mysql') {
$this->markTestSkipped('test requires mysql');
Expand Down

0 comments on commit a98164b

Please sign in to comment.