Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Stringable type #35

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Loading