From b8b2ea4075888fa341472da9d8f69c1d9dbdd8e5 Mon Sep 17 00:00:00 2001 From: sevidmusic Date: Fri, 26 Jan 2024 21:26:46 -0500 Subject: [PATCH 1/2] Composer update --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 29a0a21..80ba979 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages-dev": [ { "name": "phpstan/phpstan", - "version": "1.10.39", + "version": "1.10.57", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d9dedb0413f678b4d03cbc2279a48f91592c97c4" + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d9dedb0413f678b4d03cbc2279a48f91592c97c4", - "reference": "d9dedb0413f678b4d03cbc2279a48f91592c97c4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", "shasum": "" }, "require": { @@ -67,7 +67,7 @@ "type": "tidelift" } ], - "time": "2023-10-17T15:46:26+00:00" + "time": "2024-01-24T11:51:34+00:00" } ], "aliases": [], From c83a0dbb57f6a67b066e39eabdf933f8d9ddeb90 Mon Sep 17 00:00:00 2001 From: sevidmusic Date: Fri, 9 Feb 2024 21:40:18 -0500 Subject: [PATCH 2/2] Modified templates. Added phpunit code coverage Attribute to test class and test trait tempaltes. --- templates/Interface.php | 5 ----- templates/Test.php | 2 ++ templates/TestTrait.php | 4 +++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/Interface.php b/templates/Interface.php index 07d0900..2b89d1e 100644 --- a/templates/Interface.php +++ b/templates/Interface.php @@ -5,11 +5,6 @@ /** * Description of this interface. * - * @example - * - * ``` - * - * ``` */ interface __TARGET_CLASS_NAME__ { diff --git a/templates/Test.php b/templates/Test.php index ac70cd9..d11f23c 100644 --- a/templates/Test.php +++ b/templates/Test.php @@ -5,7 +5,9 @@ use \__ROOT_NAMESPACE__\classes\__SUB_NAMESPACE__\__TARGET_CLASS_NAME__; use \__ROOT_NAMESPACE__\tests\__BASE_TEST_NAME__; use \__ROOT_NAMESPACE__\tests\interfaces\__SUB_NAMESPACE__\__TARGET_CLASS_NAME__TestTrait; +use \PHPUnit\Framework\Attributes\CoversClass; +#[CoversClass(__TARGET_CLASS_NAME__::class)] class __TARGET_CLASS_NAME__Test extends __BASE_TEST_NAME__ { diff --git a/templates/TestTrait.php b/templates/TestTrait.php index 4f81006..83458ed 100644 --- a/templates/TestTrait.php +++ b/templates/TestTrait.php @@ -3,6 +3,7 @@ namespace __ROOT_NAMESPACE__\tests\interfaces\__SUB_NAMESPACE__; use \__ROOT_NAMESPACE__\interfaces\__SUB_NAMESPACE__\__TARGET_CLASS_NAME__; +use \PHPUnit\Framework\Attributes\CoversClass; /** * The __TARGET_CLASS_NAME__TestTrait defines common tests for @@ -11,6 +12,7 @@ * @see __TARGET_CLASS_NAME__ * */ +#[CoversClass(__TARGET_CLASS_NAME__::class)] trait __TARGET_CLASS_NAME__TestTrait { @@ -25,7 +27,7 @@ trait __TARGET_CLASS_NAME__TestTrait /** * Set up an instance of a __TARGET_CLASS_NAME__ implementation to test. * - * This method must also set the __TARGET_CLASS_NAME__ implementation instance + * This method must set the __TARGET_CLASS_NAME__ implementation instance * to be tested via the set__TARGET_CLASS_NAME__TestInstance() method. * * This method may also be used to perform any additional setup