From 632bfd39a01befd56358fdb5bccb584201dfe758 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sun, 22 Mar 2020 16:39:06 +0000 Subject: [PATCH] #11 - Minor refactor --- src/Version/IncrementalItem.php | 6 +++--- tests/integration/Migration/Action/GenerateCest.php | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Version/IncrementalItem.php b/src/Version/IncrementalItem.php index b073481..1fff9f2 100644 --- a/src/Version/IncrementalItem.php +++ b/src/Version/IncrementalItem.php @@ -135,8 +135,8 @@ public static function between($initialVersion, $finalVersion, $versions) foreach ($versions as $version) { /** @var ItemInterface $version */ if ( - ($version->getStamp() >= $initialVersion->getStamp()) - && ($version->getStamp() <= $finalVersion->getStamp()) + $version->getStamp() >= $initialVersion->getStamp() && + $version->getStamp() <= $finalVersion->getStamp() ) { $betweenVersions[] = $version; } @@ -149,7 +149,7 @@ public static function between($initialVersion, $finalVersion, $versions) * @param ItemInterface[] $versions * @return array ItemInterface[] */ - public static function sortAsc($versions) + public static function sortAsc(array $versions): array { $sortData = []; foreach ($versions as $version) { diff --git a/tests/integration/Migration/Action/GenerateCest.php b/tests/integration/Migration/Action/GenerateCest.php index 2d092d4..a927d3e 100644 --- a/tests/integration/Migration/Action/GenerateCest.php +++ b/tests/integration/Migration/Action/GenerateCest.php @@ -41,6 +41,9 @@ public function construct(IntegrationTester $I): void $I->assertNull($class->getPrimaryColumnName()); } + /** + * @param IntegrationTester $I + */ public function getReferences(IntegrationTester $I): void { $I->wantToTest('Migration\Action\Generate - getReferences()'); @@ -69,6 +72,9 @@ public function getReferences(IntegrationTester $I): void $I->assertNotFalse(array_search("'referencedSchema' => 'public'", current($generatedReferences))); } + /** + * @param IntegrationTester $I + */ public function getReferencesWithoutSchema(IntegrationTester $I): void { $I->wantToTest('Migration\Action\Generate - getReferences() without schema'); @@ -140,6 +146,9 @@ public function getReferencesWithoutSchema(IntegrationTester $I): void $I->assertFalse($schemaFound2); } + /** + * @param IntegrationTester $I + */ public function getReferencesWithSchema(IntegrationTester $I): void { $I->wantToTest('Migration\Action\Generate - getReferences() with schema');