diff --git a/CHANGELOG.md b/CHANGELOG.md index f80bf6c..b26bbd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * (improvement) Require Symfony 8.1+ * (feature) Use [Symfonys native message deduplication](https://symfony.com/doc/current/messenger.html#message-deduplication) * (improvement) Use UUIDv7 instead of ULID for task ids -* (deprecation) Deprecate `TaskLog::$ulid`, use `TaskLog::$uuid` instead. +* (deprecation) Deprecate `TaskLog::$ulid`. * (feature) Add `Task::prepareForTaskLog()` to be able to modify the payload before storing it in the database. diff --git a/UPGRADE.md b/UPGRADE.md index 92374b3..cb91a2d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -2,7 +2,7 @@ ========== * `TaskLog::getTaskObject()` was removed. Use `TaskDetailsNormalizer::deserializeTask($log)` instead. -* `TaskLog::$ulid` was removed, use `TaskLog::$uuid` instead. +* `TaskLog::$ulid` was removed. 1.x to 2.0 diff --git a/src/Entity/TaskLog.php b/src/Entity/TaskLog.php index a0857d2..e446d43 100644 --- a/src/Entity/TaskLog.php +++ b/src/Entity/TaskLog.php @@ -73,7 +73,8 @@ public function __construct ( ) { $this->taskClass = $task::class; - $this->taskId = $task->uuid; + /** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ + $this->taskId = $task->ulid; $this->runs = new ArrayCollection(); $this->timeQueued = now(); } diff --git a/src/Model/TaskLogModel.php b/src/Model/TaskLogModel.php index 14da2c3..58cea57 100644 --- a/src/Model/TaskLogModel.php +++ b/src/Model/TaskLogModel.php @@ -51,7 +51,8 @@ public function findByTaskId (string $taskId) : ?TaskLog */ public function getLogForTask (Task $task) : TaskLog { - $log = $this->findByTaskId($task->uuid); + /** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ + $log = $this->findByTaskId($task->ulid); if (null !== $log) { diff --git a/src/Task/Task.php b/src/Task/Task.php index 71913ba..1fca471 100644 --- a/src/Task/Task.php +++ b/src/Task/Task.php @@ -9,12 +9,12 @@ */ abstract readonly class Task { - public string $uuid; - /** * @deprecated use $taskId instead * * @todo remove in 4.0 + * + * @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ public string $ulid; @@ -23,8 +23,7 @@ public function __construct () { $uuid = new UuidV7()->toString(); - $this->uuid = $uuid; - /** @phpstan-ignore-next-line property.deprecated (We still need to support the deprecated property) */ + /** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ $this->ulid = $uuid; } @@ -44,7 +43,6 @@ public function withNewTaskUlid () : static $uuid = new UuidV7()->toString(); return clone($this, [ - "uuid" => $uuid, "ulid" => $uuid, ]); } diff --git a/tests/Entity/TaskLogTest.php b/tests/Entity/TaskLogTest.php index 212beba..0a6da1b 100644 --- a/tests/Entity/TaskLogTest.php +++ b/tests/Entity/TaskLogTest.php @@ -184,7 +184,8 @@ public function testTaskIdMatchesTaskUlid () : void $task = $this->createTask(); $log = new TaskLog($task); - self::assertSame($task->uuid, $log->taskId); + /** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ + self::assertSame($task->ulid, $log->taskId); } public function testTaskClassMatchesTaskClass () : void diff --git a/tests/Task/TaskTest.php b/tests/Task/TaskTest.php index 32a3533..22ab5da 100644 --- a/tests/Task/TaskTest.php +++ b/tests/Task/TaskTest.php @@ -28,8 +28,10 @@ public function getMetaData () : TaskMetaData } }; - $initialUlid = $task->uuid; + /** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ + $initialUlid = $task->ulid; $newTask = $task->withNewTaskUlid(); - self::assertNotSame($initialUlid, $newTask->uuid, "Task ULID should change on PHP 8.4"); + /** @phpstan-ignore-next-line property.deprecated (The uuid integration will be refactored in v4) */ + self::assertNotSame($initialUlid, $newTask->ulid, "Task ULID should change on PHP 8.4"); } }