From 07f316e520bc92a7361527253b2c6e36ce4968e9 Mon Sep 17 00:00:00 2001 From: Mikel Madariaga Date: Thu, 30 Nov 2023 21:01:34 +0100 Subject: [PATCH 1/2] [BC] changed createDto method signature so that we can fix some hint issues --- Domain/Model/Changelog/ChangelogAbstract.php | 5 ++++- Domain/Model/Changelog/ChangelogInterface.php | 5 ++++- Domain/Model/ChangelogTrait.php | 6 +++++- Domain/Model/Commandlog/CommandlogAbstract.php | 5 ++++- Domain/Model/Commandlog/CommandlogInterface.php | 5 ++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Domain/Model/Changelog/ChangelogAbstract.php b/Domain/Model/Changelog/ChangelogAbstract.php index bb18d31..8106260 100644 --- a/Domain/Model/Changelog/ChangelogAbstract.php +++ b/Domain/Model/Changelog/ChangelogAbstract.php @@ -84,7 +84,10 @@ protected function sanitizeValues(): void { } - public static function createDto(string|int|null $id = null): ChangelogDto + /** + * @param string|null $id + */ + public static function createDto($id = null): ChangelogDto { return new ChangelogDto($id); } diff --git a/Domain/Model/Changelog/ChangelogInterface.php b/Domain/Model/Changelog/ChangelogInterface.php index a72357a..eb6751c 100644 --- a/Domain/Model/Changelog/ChangelogInterface.php +++ b/Domain/Model/Changelog/ChangelogInterface.php @@ -32,7 +32,10 @@ public function replaceData($data = null); */ public function getId(): ?string; - public static function createDto(string|int|null $id = null): ChangelogDto; + /** + * @param string|null $id + */ + public static function createDto($id = null): ChangelogDto; /** * @internal use EntityTools instead diff --git a/Domain/Model/ChangelogTrait.php b/Domain/Model/ChangelogTrait.php index 0d7d21c..b99f8ad 100644 --- a/Domain/Model/ChangelogTrait.php +++ b/Domain/Model/ChangelogTrait.php @@ -24,7 +24,11 @@ trait ChangelogTrait abstract public function getId(); abstract protected function __toArray(); - abstract public static function createDto(string|int $id = null): DataTransferObjectInterface; + + /** + * @param string|null $id + */ + abstract public static function createDto($id = null): DataTransferObjectInterface; /** * TRUE on new entities until transaction is closed diff --git a/Domain/Model/Commandlog/CommandlogAbstract.php b/Domain/Model/Commandlog/CommandlogAbstract.php index 6772adb..fa8b49e 100644 --- a/Domain/Model/Commandlog/CommandlogAbstract.php +++ b/Domain/Model/Commandlog/CommandlogAbstract.php @@ -87,7 +87,10 @@ protected function sanitizeValues(): void { } - public static function createDto(string|int|null $id = null): CommandlogDto + /** + * @param string|null $id + */ + public static function createDto($id = null): CommandlogDto { return new CommandlogDto($id); } diff --git a/Domain/Model/Commandlog/CommandlogInterface.php b/Domain/Model/Commandlog/CommandlogInterface.php index 0ca7482..33f8d0a 100644 --- a/Domain/Model/Commandlog/CommandlogInterface.php +++ b/Domain/Model/Commandlog/CommandlogInterface.php @@ -25,7 +25,10 @@ public function getId(): ?string; */ public static function fromEvent(CommandEventInterface $event); - public static function createDto(string|int|null $id = null): CommandlogDto; + /** + * @param string|null $id + */ + public static function createDto($id = null): CommandlogDto; /** * @internal use EntityTools instead From 8f6a1ddd7531cd1b23742f2759c244e526abdebe Mon Sep 17 00:00:00 2001 From: Mikel Madariaga Date: Thu, 30 Nov 2023 21:08:44 +0100 Subject: [PATCH 2/2] fixed phpstan issues --- Infrastructure/Persistence/Redis/FakeRedisMasterFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Infrastructure/Persistence/Redis/FakeRedisMasterFactory.php b/Infrastructure/Persistence/Redis/FakeRedisMasterFactory.php index 71f5df9..6d1d66b 100644 --- a/Infrastructure/Persistence/Redis/FakeRedisMasterFactory.php +++ b/Infrastructure/Persistence/Redis/FakeRedisMasterFactory.php @@ -25,7 +25,7 @@ public function rPush($key, ...$value1) { return false; } public function blPop($key, $timeout_or_key, ...$extra_args) { return []; } - public function scan(&$iterator, $pattern = null, $count = 0) + public function scan(&$iterator, $pattern = null, $count = 0, ...$extra_args) { $iterator = 0; return ['something'];