From da662e2b4a89ec41abaaf4d0f41621ff3468c41a Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:28:18 -0500 Subject: [PATCH 1/7] Update NoneTest.php Signed-off-by: Nathanael Esayeas --- tests/Unit/NoneTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Unit/NoneTest.php b/tests/Unit/NoneTest.php index 8be9276..821a930 100644 --- a/tests/Unit/NoneTest.php +++ b/tests/Unit/NoneTest.php @@ -28,7 +28,9 @@ final class NoneTest extends TestCase { /** - * @return Generator + * @template TNone of null + * + * @return Generator,1:None|TNone}> */ public static function ofDataProvider(): Generator { From 434afebd02bbf84dac3f1c65b7226922d26a8b1a Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:28:36 -0500 Subject: [PATCH 2/7] Update None.php Signed-off-by: Nathanael Esayeas --- src/None.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/None.php b/src/None.php index 277a2d6..5e2bb74 100644 --- a/src/None.php +++ b/src/None.php @@ -4,16 +4,14 @@ namespace Ghostwriter\Option; -use Ghostwriter\Option\Tests\Unit\NoneTest; - /** - * @template TNone of null + * @template TNone of never * * @extends AbstractOption * * @implements NoneInterface * - * @see NoneTest + * @see \Ghostwriter\Option\Tests\Unit\NoneTest */ final class None extends AbstractOption implements NoneInterface { @@ -22,6 +20,9 @@ final class None extends AbstractOption implements NoneInterface /** @return self */ public static function create(): self { - return self::$none ??= new self(null); + /** @var TNone $none */ + $none = null; + + return self::$none ??= new self($none); } } From 679f364aecd46522a395679579cbcab6188a0c21 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:28:57 -0500 Subject: [PATCH 3/7] Update NoneInterface.php Signed-off-by: Nathanael Esayeas --- src/NoneInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NoneInterface.php b/src/NoneInterface.php index c833589..b6856c0 100644 --- a/src/NoneInterface.php +++ b/src/NoneInterface.php @@ -7,7 +7,7 @@ /** * @immutable * - * @template TNone of null + * @template TNone of never * * @extends OptionInterface */ From 8a8ad53d70443b5a02ea74c430b8923e63728d65 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:29:06 -0500 Subject: [PATCH 4/7] Update AbstractOption.php Signed-off-by: Nathanael Esayeas --- src/AbstractOption.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/AbstractOption.php b/src/AbstractOption.php index 8b5c42e..8da0b38 100644 --- a/src/AbstractOption.php +++ b/src/AbstractOption.php @@ -7,9 +7,6 @@ use Generator; use Ghostwriter\Option\Exception\NullPointerException; use Ghostwriter\Option\Exception\OptionException; -use Ghostwriter\Option\Tests\Unit\NoneTest; -use Ghostwriter\Option\Tests\Unit\OptionTest; -use Ghostwriter\Option\Tests\Unit\SomeTest; use Throwable; /** @@ -17,9 +14,9 @@ * * @implements OptionInterface * - * @see OptionTest - * @see SomeTest - * @see NoneTest + * @see \Ghostwriter\Option\Tests\Unit\OptionTest + * @see \Ghostwriter\Option\Tests\Unit\SomeTest + * @see \Ghostwriter\Option\Tests\Unit\NoneTest */ abstract class AbstractOption implements OptionInterface { From 6974b84b59af3d6e726f0b0c9c01d7f486296f0e Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:29:11 -0500 Subject: [PATCH 5/7] Update Option.php Signed-off-by: Nathanael Esayeas --- src/Option.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Option.php b/src/Option.php index 0c5d83f..0382941 100644 --- a/src/Option.php +++ b/src/Option.php @@ -4,7 +4,9 @@ namespace Ghostwriter\Option; -/** @see OptionTest */ +/** + * @see \Ghostwriter\Option\Tests\Unit\OptionTest + */ final class Option { /** From 845ae8fb0bae811c4aaf17ba8d635fa789024b9a Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:29:15 -0500 Subject: [PATCH 6/7] Update Some.php Signed-off-by: Nathanael Esayeas --- src/Some.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Some.php b/src/Some.php index 1563735..378a4e7 100644 --- a/src/Some.php +++ b/src/Some.php @@ -5,7 +5,6 @@ namespace Ghostwriter\Option; use Ghostwriter\Option\Exception\NullPointerException; -use Ghostwriter\Option\Tests\Unit\SomeTest; /** * @template TSome @@ -14,7 +13,7 @@ * * @implements SomeInterface * - * @see SomeTest + * @see \Ghostwriter\Option\Tests\Unit\SomeTest */ final class Some extends AbstractOption implements SomeInterface { From 461fae35fe7fb1b336bbf3f6b3559f69c23ee739 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 5 Jul 2023 14:29:23 -0500 Subject: [PATCH 7/7] Update README.md Signed-off-by: Nathanael Esayeas --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94c54f0..b60f6d2 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ interface SomeInterface extends OptionInterface /** * @immutable * - * @template TNone of null + * @template TNone of never * * @extends OptionInterface */