Refactor subject conversion APIs and simplify usage in audit-related components

- Removed `convertEntityToSubjects` method from `SubjectConverterManager` and updated all references to use `getSubjectsForEntity`.
- Ensured `getSubjectsForEntity` always returns an array by wrapping single `Subject` instances.
- Replaced manual type handling in converters with `array_push` and improved code clarity in `AuditEvent2Trail` and related tests.
- Updated and fixed tests for the modified subject conversion logic to maintain coverage.
This commit is contained in:
2026-01-28 22:34:55 +01:00
parent 412aa213c8
commit c1a0234358
7 changed files with 25 additions and 55 deletions

View File

@@ -14,12 +14,7 @@ namespace Chill\MainBundle\Audit;
interface SubjectConverterManagerInterface
{
/**
* @return list<array>
* @return list<Subject>
*/
public function convertEntityToSubjects(mixed $subject): array;
/**
* @return Subject|list<Subject>
*/
public function getSubjectsForEntity(mixed $subject): Subject|array;
public function getSubjectsForEntity(mixed $subject): array;
}