File tree Expand file tree Collapse file tree
lib/public/AppFramework/Db Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 * @psalm-consistent-constructor
2020 */
2121abstract class Entity {
22- public int |string |null $ id = null ;
22+ /** @var int $id */
23+ public $ id ;
2324 private array $ _updatedFields = [];
2425 /** @psalm-param $_fieldTypes array<string, Types::*> */
2526 protected array $ _fieldTypes = ['id ' => 'integer ' ];
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public function setId($id): void {
3535 */
3636 public function generateId (): void {
3737 if ($ this ->id === null ) {
38+ /** @psalm-suppress InvalidPropertyAssignmentValue */
3839 $ this ->id = Server::get (ISnowflakeGenerator::class)->nextId ();
3940 $ this ->markFieldUpdated ('id ' );
4041 }
@@ -50,7 +51,7 @@ public function getSnowflake(): ?Snowflake {
5051 }
5152
5253 if ($ this ->snowflake === null ) {
53- $ this ->snowflake = Server::get (ISnowflakeDecoder::class)->decode ($ this ->id );
54+ $ this ->snowflake = Server::get (ISnowflakeDecoder::class)->decode ($ this ->getId () );
5455 }
5556
5657 return $ this ->snowflake ;
You can’t perform that action at this time.
0 commit comments