Skip to content

Commit

Permalink
Merge pull request #35 from Jeckel-Lab/feature/allow-stringable-identity
Browse files Browse the repository at this point in the history
Allow Stringable type
  • Loading branch information
jeckel authored Mar 25, 2024
2 parents 33ed69e + e3ccd8a commit c4204f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: [ '8.0', '8.1' ]
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]
include:
- php-versions: 8.0
env: COMPOSER_FLAGS="--prefer-lowest"
Expand Down
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@
},
"suggest": {
"vimeo/psalm": "Using psalm with this 'contract' will enable immutability and strong typing verification"
},
"config": {
"allow-plugins": {
"infection/extension-installer": true,
"phpro/grumphp": true
}
}
}
10 changes: 5 additions & 5 deletions src/Domain/Identity/Identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Interface Identity
* @package JeckelLab\Contract\Domain\Identity
* @psalm-immutable
* @template IdentityType of int|string
* @template IdentityType of int|string|Stringable
*/
interface Identity extends Equality, Stringable, JsonSerializable
{
Expand All @@ -26,15 +26,15 @@ interface Identity extends Equality, Stringable, JsonSerializable
public static function new(): static;

/**
* @param int|string $identity
* @param int|string|Stringable $identity
* @return static
* @throws InvalidIdException
*/
public static function from(int|string $identity): static;
public static function from(int|string|Stringable $identity): static;

/**
* @return int|string
* @return int|string|Stringable
* @psalm-return IdentityType
*/
public function id(): int|string;
public function id(): int|string|Stringable;
}

0 comments on commit c4204f3

Please sign in to comment.