<?php

/**
 * @file
 * Contains field_inheritance.module.
 */

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Hook\Attribute\LegacyHook;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field_inheritance\Hook\FieldInheritanceHooks;

/**
 * Implements hook_help().
 */
#[LegacyHook]
function field_inheritance_help($route_name, RouteMatchInterface $route_match): ?string {
  return \Drupal::service(FieldInheritanceHooks::class)->help($route_name, $route_match);
}

/**
 * Implements hook_entity_bundle_field_info_alter().
 */
#[LegacyHook]
function field_inheritance_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle): void {
  \Drupal::service(FieldInheritanceHooks::class)->entityBundleFieldInfoAlter($fields, $entity_type, $bundle);
}

/**
 * Implements hook_entity_base_field_info().
 */
#[LegacyHook]
function field_inheritance_entity_base_field_info(EntityTypeInterface $entity_type): array {
  return \Drupal::service(FieldInheritanceHooks::class)->entityBaseFieldInfo($entity_type);
}
