| Total Complexity | 8 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class VersioningFunctionalityModuleResolver extends AbstractFunctionalityModuleResolver |
||
| 11 | { |
||
| 12 | use ModuleResolverTrait; |
||
| 13 | |||
| 14 | public const FIELD_DEPRECATION = Plugin::NAMESPACE . '\field-deprecation'; |
||
| 15 | |||
| 16 | public static function getModulesToResolve(): array |
||
| 17 | { |
||
| 18 | return [ |
||
| 19 | self::FIELD_DEPRECATION, |
||
| 20 | ]; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function getDependedModuleLists(string $module): array |
||
| 24 | { |
||
| 25 | switch ($module) { |
||
| 26 | case self::FIELD_DEPRECATION: |
||
| 27 | return [ |
||
| 28 | [ |
||
| 29 | FunctionalityModuleResolver::SCHEMA_CONFIGURATION, |
||
| 30 | ], |
||
| 31 | ]; |
||
| 32 | } |
||
| 33 | return parent::getDependedModuleLists($module); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getName(string $module): string |
||
| 37 | { |
||
| 38 | $names = [ |
||
| 39 | self::FIELD_DEPRECATION => \__('Field Deprecation', 'graphql-api'), |
||
| 40 | ]; |
||
| 41 | return $names[$module] ?? $module; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getDescription(string $module): string |
||
| 45 | { |
||
| 46 | switch ($module) { |
||
| 47 | case self::FIELD_DEPRECATION: |
||
| 48 | return \__('Deprecate fields, and explain how to replace them, through a user interface', 'graphql-api'); |
||
| 49 | } |
||
| 50 | return parent::getDescription($module); |
||
| 51 | } |
||
| 52 | |||
| 53 | public function isEnabledByDefault(string $module): bool |
||
| 60 | } |
||
| 61 | } |
||
| 62 |