From d99ea8276139025e4dc9213638549cd8d7f727cf Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 7 Nov 2020 10:27:35 +0100 Subject: [PATCH] Added migrations folder to the static analysis --- composer.json | 2 +- data/migrations/Version20171021093246.php | 4 ++-- data/migrations/Version20201102113208.php | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b2faf734..0fef97db 100644 --- a/composer.json +++ b/composer.json @@ -109,7 +109,7 @@ ], "cs": "phpcs", "cs:fix": "phpcbf", - "stan": "phpstan analyse module/*/src/ module/*/config config docker/config --level=6", + "stan": "phpstan analyse module/*/src/ module/*/config config docker/config data/migrations --level=6", "test": [ "@test:unit", "@test:db", diff --git a/data/migrations/Version20171021093246.php b/data/migrations/Version20171021093246.php index b66a2c3f..83f08e41 100644 --- a/data/migrations/Version20171021093246.php +++ b/data/migrations/Version20171021093246.php @@ -24,10 +24,10 @@ class Version20171021093246 extends AbstractMigration return; } - $shortUrls->addColumn('valid_since', Types::DATETIME, [ + $shortUrls->addColumn('valid_since', Types::DATETIME_MUTABLE, [ 'notnull' => false, ]); - $shortUrls->addColumn('valid_until', Types::DATETIME, [ + $shortUrls->addColumn('valid_until', Types::DATETIME_MUTABLE, [ 'notnull' => false, ]); } diff --git a/data/migrations/Version20201102113208.php b/data/migrations/Version20201102113208.php index 14ce6504..4b169532 100644 --- a/data/migrations/Version20201102113208.php +++ b/data/migrations/Version20201102113208.php @@ -46,7 +46,9 @@ final class Version20201102113208 extends AbstractMigration 'expiration' => Chronos::now()->toDateTimeString(), ]); - $id = $this->resolveOneApiKeyId($qb->execute()); + /** @var Result $result */ + $result = $qb->execute(); + $id = $this->resolveOneApiKeyId($result); if ($id === null) { return; }