fix(snowflake): Allow SnowflakeAware to overwrite the field types

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2026-01-07 14:06:18 +01:00
parent 40b79f5af8
commit 2bd2cc71e5
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ abstract class Entity {
public int|string|null $id = null;
private array $_updatedFields = [];
/** @psalm-param $_fieldTypes array<string, Types::*> */
private array $_fieldTypes = ['id' => 'integer'];
protected array $_fieldTypes = ['id' => 'integer'];
/**
* Simple alternative constructor for building entities from a request

View file

@ -24,7 +24,7 @@ abstract class SnowflakeAwareEntity extends Entity {
protected ?Snowflake $snowflake = null;
/** @psalm-param $_fieldTypes array<string, Types::*> */
private array $_fieldTypes = ['id' => Types::STRING];
protected array $_fieldTypes = ['id' => Types::STRING];
public function setId($id): void {
throw new \LogicException('Use generated id to set a new id to the Snowflake aware entity.');