Skip to content

Commit b75fb2d

Browse files
committed
Merge branch 'release/3.3.1'
2 parents f143c9b + e95930d commit b75fb2d

5 files changed

Lines changed: 20 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec
55

66
## Unreleased
77

8+
## [3.3.1] - 2025-08-10
9+
10+
### Fixed
11+
12+
- Ensure that the `Result` class uses `@template-covariant` for its result value. This now matches the result interface,
13+
which already used template covariant.
14+
815
## [3.3.0] - 2025-05-24
916

1017
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@test"
5454
],
5555
"deptrac": "deptrac analyse --report-uncovered --fail-on-uncovered",
56-
"static": "phpstan analyse -c phpstan.neon",
56+
"static": "phpstan analyse -c phpstan.neon --memory-limit=256M",
5757
"style": "pint --test",
5858
"style:fix": "pint",
5959
"test": "phpunit"

src/Toolkit/Result/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use CloudCreativity\Modules\Contracts\Toolkit\Result\Result as IResult;
1919

2020
/**
21-
* @template TValue
21+
* @template-covariant TValue
2222
* @implements IResult<TValue>
2323
*/
2424
final class Result implements IResult

tests/Unit/Application/Bus/TestCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616

1717
class TestCommand implements Command
1818
{
19+
public function __construct(public bool $fail = false)
20+
{
21+
}
1922
}

tests/Unit/Application/Bus/TestCommandHandler.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
namespace CloudCreativity\Modules\Tests\Unit\Application\Bus;
1414

1515
use CloudCreativity\Modules\Contracts\Application\Messages\DispatchThroughMiddleware;
16+
use CloudCreativity\Modules\Contracts\Toolkit\Identifiers\Identifier;
17+
use CloudCreativity\Modules\Toolkit\Identifiers\Uuid;
1618
use CloudCreativity\Modules\Toolkit\Result\Result;
1719

1820
class TestCommandHandler implements DispatchThroughMiddleware
@@ -21,11 +23,15 @@ class TestCommandHandler implements DispatchThroughMiddleware
2123
* Execute the command.
2224
*
2325
* @param TestCommand $command
24-
* @return Result<null>
26+
* @return Result<Identifier|null>
2527
*/
2628
public function execute(TestCommand $command): Result
2729
{
28-
return Result::ok();
30+
if ($command->fail) {
31+
return Result::fail('It failed!');
32+
}
33+
34+
return Result::ok(Uuid::random());
2935
}
3036

3137
/**

0 commit comments

Comments
 (0)