Skip to content

Investigate replacing stdClass queue with a dedicated class in MapperService::thinnedProcessToProcess() #1111

Open
@coderabbitai

Description

@coderabbitai

Context

In zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php, the thinnedProcessToProcess() method currently creates an anonymous stdClass instance for the queue property:

$processEntity->queue = new \stdClass();
$processEntity->queue->status = $thinnedProcess->status;

Using stdClass makes type safety and future evolution harder.
We should check whether a dedicated queue entity/value-object already exists in the domain model (e.g. Queue, ProcessQueue, etc.) and, if so, refactor the code to use it.

Tasks

  1. Search the codebase for queue-related classes that could replace stdClass.
  2. Evaluate suitability (properties, constructor, usage elsewhere).
  3. If a suitable class exists, refactor MapperService::thinnedProcessToProcess() to use it.
  4. If none exists, consider designing and introducing a typed queue class.

References

/cc @ThomasAFink

Metadata

Metadata

Assignees

Labels

phpPull requests that update Php code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions