From 01e0a95e1492fc2334690e3b46a7d5d37eaa4274 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 24 Oct 2022 20:25:06 +0200 Subject: [PATCH] Added rest of tests to phpstan check --- composer.json | 2 +- module/Rest/test-api/Action/CreateShortUrlTest.php | 2 +- module/Rest/test-api/Action/EditShortUrlTest.php | 4 ++-- module/Rest/test-api/Fixtures/ShortUrlsFixture.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 6fcba050..f9c68dbb 100644 --- a/composer.json +++ b/composer.json @@ -109,7 +109,7 @@ ], "cs": "phpcs", "cs:fix": "phpcbf", - "stan": "APP_ENV=test php vendor/bin/phpstan analyse module/*/src module/*/test module/*/test-db module/*/config config docker/config data/migrations --level=8", + "stan": "APP_ENV=test php vendor/bin/phpstan analyse module/*/src module/*/test* module/*/config config docker/config data/migrations --level=8", "test": [ "@parallel test:unit test:db", "@parallel test:api test:cli" diff --git a/module/Rest/test-api/Action/CreateShortUrlTest.php b/module/Rest/test-api/Action/CreateShortUrlTest.php index 26d271f0..889b67af 100644 --- a/module/Rest/test-api/Action/CreateShortUrlTest.php +++ b/module/Rest/test-api/Action/CreateShortUrlTest.php @@ -363,7 +363,7 @@ class CreateShortUrlTest extends ApiTestCase } /** - * @return array{int $statusCode, array $payload} + * @return array{int, array} */ private function createShortUrl(array $body = [], string $apiKey = 'valid_api_key', string $version = '2'): array { diff --git a/module/Rest/test-api/Action/EditShortUrlTest.php b/module/Rest/test-api/Action/EditShortUrlTest.php index 92f9bbe0..fefbdcba 100644 --- a/module/Rest/test-api/Action/EditShortUrlTest.php +++ b/module/Rest/test-api/Action/EditShortUrlTest.php @@ -62,13 +62,13 @@ class EditShortUrlTest extends ApiTestCase ]]; } - private function findShortUrlMetaByShortCode(string $shortCode): ?array + private function findShortUrlMetaByShortCode(string $shortCode): array { $matchingShortUrl = $this->getJsonResponsePayload( $this->callApiWithKey(self::METHOD_GET, '/short-urls/' . $shortCode), ); - return $matchingShortUrl['meta'] ?? null; + return $matchingShortUrl['meta'] ?? []; } /** diff --git a/module/Rest/test-api/Fixtures/ShortUrlsFixture.php b/module/Rest/test-api/Fixtures/ShortUrlsFixture.php index a159737e..eadf60ee 100644 --- a/module/Rest/test-api/Fixtures/ShortUrlsFixture.php +++ b/module/Rest/test-api/Fixtures/ShortUrlsFixture.php @@ -23,7 +23,7 @@ class ShortUrlsFixture extends AbstractFixture implements DependentFixtureInterf public function load(ObjectManager $manager): void { - $relationResolver = new PersistenceShortUrlRelationResolver($manager); + $relationResolver = new PersistenceShortUrlRelationResolver($manager); // @phpstan-ignore-line /** @var ApiKey $authorApiKey */ $authorApiKey = $this->getReference('author_api_key');