Skip to content

Commit

Permalink
[BC] changed createDto method signature so that we can fix some hint …
Browse files Browse the repository at this point in the history
…issues
  • Loading branch information
mmadariaga committed Nov 30, 2023
1 parent 8a7d8e6 commit a977994
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Domain/Model/Changelog/ChangelogAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion Domain/Model/Changelog/ChangelogInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Domain/Model/ChangelogTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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|int|null $id
*/
abstract public static function createDto($id = null): DataTransferObjectInterface;

/**
* TRUE on new entities until transaction is closed
Expand Down
5 changes: 4 additions & 1 deletion Domain/Model/Commandlog/CommandlogAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion Domain/Model/Commandlog/CommandlogInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a977994

Please sign in to comment.