Skip to content

Commit

Permalink
Merge pull request #20 from irontec/enhanced-hints
Browse files Browse the repository at this point in the history
[BC] Changed createDto method signature
  • Loading branch information
mmadariaga authored Nov 30, 2023
2 parents 8a7d8e6 + 8f6a1dd commit f39310b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 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|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
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit f39310b

Please sign in to comment.