12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Services\History\Detector;
- use App\Services\History\Converter\ConverterContact;
- use App\Services\History\Converter\ModelEnumConverter;
- use App\Services\History\Converter\WhitelistConverter;
- class ProjectDetector implements DetectorContact
- {
- public static function fields(): array
- {
- return [
- 'name',
- 'code',
- 'const',
- 'status',
- 'begin',
- 'end',
- 'latitude',
- 'type',
- 'acl',
- 'whitelist',
- 'description',
- ];
- }
- public static function diffFields(): array
- {
- return [
- 'description',
- ];
- }
- public static function converter(string $field): ConverterContact
- {
- return match ($field) {
- "whitelist" => new WhitelistConverter(),
- "status" => new ModelEnumConverter("project.status"),
- default => null
- };
- }
- }
|