mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-14 09:57:43 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user