mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-02-14 20:35:29 +00:00
- Replaced `array_map` with `array_reduce` in `AuditEvent2Trail` for flattening converted subjects. - Enhanced `SubjectConverterInterface` with a `supportsConvert` method and PHPStan annotations to improve type safety and flexibility.
39 lines
870 B
PHP
39 lines
870 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\MainBundle\Audit;
|
|
|
|
/**
|
|
* @template T
|
|
*/
|
|
interface SubjectConverterInterface
|
|
{
|
|
/**
|
|
* @param T $subject
|
|
*
|
|
* @return Subject|list<Subject>
|
|
*/
|
|
public function convert(mixed $subject): Subject|array;
|
|
|
|
/**
|
|
* Determines whether the given subject is supported for conversion.
|
|
*
|
|
* @param mixed $subject the subject to check for conversion support
|
|
*
|
|
* @return bool true if the subject can be converted, false otherwise
|
|
*
|
|
* @phpstan-assert-if-true T $subject
|
|
*/
|
|
public function supportsConvert(mixed $subject): bool;
|
|
|
|
public static function getDefaultPriority(): int;
|
|
}
|