ProjectDetector.php 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Services\History\Detector;
  3. use App\Services\History\Converter\ConverterContact;
  4. use App\Services\History\Converter\WhitelistConverter;
  5. class ProjectDetector implements DetectorContact
  6. {
  7. public static function fields(): array
  8. {
  9. return [
  10. 'name',
  11. 'code',
  12. 'const',
  13. 'status',
  14. 'begin',
  15. 'end',
  16. 'latitude',
  17. 'type',
  18. 'acl',
  19. 'whitelist',
  20. 'description',
  21. ];
  22. }
  23. public static function diffFields(): array
  24. {
  25. return [
  26. 'description',
  27. ];
  28. }
  29. public static function converter(string $field): ConverterContact
  30. {
  31. return match ($field) {
  32. "whitelist" => new WhitelistConverter(),
  33. default => null
  34. };
  35. }
  36. }