Merge pull request #57403 from nextcloud/followup/noid/snowflake-entity

fix(snowflake): Allow SnowflakeAware to overwrite the field types
This commit is contained in:
Joas Schilling 2026-01-07 15:10:09 +01:00 committed by GitHub
commit 9e516beb85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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.');