diff --git a/.phpstan.neon b/.phpstan.neon index 8136274..c8c69be 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -1,11 +1,15 @@ # SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt # SPDX-License-Identifier: GPL-3.0-or-later +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon + parameters: level: 8 paths: - src/ + - tests/ scanDirectories: - vendor diff --git a/composer.json b/composer.json index 82738e1..48f9de4 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.35", "phpstan/phpstan": "^1.10", + "phpstan/phpstan-phpunit": "^1.3", "phpunit/phpunit": "^9 || ^10" }, "autoload": { diff --git a/tests/Fixtures/Factory.php b/tests/Fixtures/Factory.php index b6d916c..a37e838 100644 --- a/tests/Fixtures/Factory.php +++ b/tests/Fixtures/Factory.php @@ -8,7 +8,7 @@ namespace Art4\JsonApiClient\Tests\Fixtures; -use Art4\JsonApiClient\Utils\FactoryInterface; +use Art4\JsonApiClient\Factory as FactoryInterface; final class Factory implements FactoryInterface { diff --git a/tests/Fixtures/HelperTrait.php b/tests/Fixtures/HelperTrait.php index 94cc0d1..aefbb70 100644 --- a/tests/Fixtures/HelperTrait.php +++ b/tests/Fixtures/HelperTrait.php @@ -12,22 +12,26 @@ use Art4\JsonApiClient\Factory; use Art4\JsonApiClient\Manager; use Art4\JsonApiClient\Tests\Fixtures\Factory as FixtureFactory; +use PHPUnit\Framework\MockObject\MockObject; /** * Helper Trait */ trait HelperTrait { + /** @var Manager&MockObject */ protected Manager $manager; + /** @var Factory&MockObject */ protected Factory $factory; + /** @var Accessable&MockObject */ protected Accessable $parent; /** * Json Values Provider * - * @see http://json.org/ + * @return array> */ public static function jsonValuesProvider(): array { @@ -47,7 +51,7 @@ public static function jsonValuesProvider(): array /** * Json Values Provider but without the object * - * @see http://json.org/ + * @return array> */ public static function jsonValuesProviderWithoutObject(): array { @@ -61,7 +65,7 @@ public static function jsonValuesProviderWithoutObject(): array /** * Json Values Provider but without the array * - * @see http://json.org/ + * @return array> */ public static function jsonValuesProviderWithoutArray(): array { @@ -75,7 +79,7 @@ public static function jsonValuesProviderWithoutArray(): array /** * Json Values Provider but without the string * - * @see http://json.org/ + * @return array> */ public static function jsonValuesProviderWithoutString(): array { @@ -89,7 +93,7 @@ public static function jsonValuesProviderWithoutString(): array /** * Json Values Provider but without the object and string * - * @see http://json.org/ + * @return array> */ public static function jsonValuesProviderWithoutObjectAndString(): array { @@ -104,7 +108,7 @@ public static function jsonValuesProviderWithoutObjectAndString(): array /** * Json Values as string Provider * - * @see http://json.org/ + * @return array> */ public static function jsonValuesAsStringProvider(): array { @@ -124,7 +128,7 @@ public static function jsonValuesAsStringProvider(): array /** * Json Values as string Provider but without the object * - * @see http://json.org/ + * @return array> */ public static function jsonValuesAsStringProviderWithoutObject(): array { @@ -145,7 +149,7 @@ public function buildManagerMock() $factory->testcase = $this; // Mock Manager - $manager = $this->createMock('Art4\JsonApiClient\Utils\FactoryManagerInterface'); + $manager = $this->createMock(Manager::class); $manager->expects($this->any()) ->method('getFactory')