<?php

/**
 * @file
 * Test module for the entity API providing several entity types for testing.
 */

declare(strict_types=1);

use Drupal\entity_test\EntityTestHelper;

/**
 * Creates a new bundle for entity_test entities.
 *
 * @param string $bundle
 *   The machine-readable name of the bundle.
 * @param string $text
 *   (optional) The human-readable name of the bundle. If none is provided, the
 *   machine name will be used.
 * @param string $entity_type
 *   (optional) The entity type for which the bundle is created. Defaults to
 *   'entity_test'.
 *
 * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use
 *   \Drupal\entity_test\EntityTestHelper::createBundle() instead.
 *
 * @see https://www.drupal.org/node/3497049
 */
function entity_test_create_bundle($bundle, $text = NULL, $entity_type = 'entity_test'): void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\entity_test\EntityTestHelper::createBundle() instead. See https://www.drupal.org/node/3497049', E_USER_DEPRECATED);
  EntityTestHelper::createBundle($bundle, $text, $entity_type);
}

/**
 * Deletes a bundle for entity_test entities.
 *
 * @param string $bundle
 *   The machine-readable name of the bundle to delete.
 * @param string $entity_type
 *   (optional) The entity type for which the bundle is deleted. Defaults to
 *   'entity_test'.
 *
 * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use
 *    \Drupal\entity_test\EntityTestHelper::deleteBundle() instead.
 *
 * @see https://www.drupal.org/node/3497049
 */
function entity_test_delete_bundle($bundle, $entity_type = 'entity_test'): void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\entity_test\EntityTestHelper::deleteBundle() instead. See https://www.drupal.org/node/3497049', E_USER_DEPRECATED);
  EntityTestHelper::deleteBundle($bundle, $entity_type);
}
