Verified Commit f93aafb4 authored by Dave Long's avatar Dave Long
Browse files

task: #3586071 Remove deprecated method getOriginalClass

By: grimreaper
parent c9a981a1
Loading
Loading
Loading
Loading
Loading
+0 −8
Changes for core/lib/Drupal/Core/Entity/EntityType.php: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -470,14 +470,6 @@ public function hasKey($key) {
    return !empty($keys[$key]);
  }

  /**
   * {@inheritdoc}
   */
  public function getOriginalClass() {
    @trigger_error('The "getOriginalClass" method is deprecated in drupal:11.4.0 and will be removed in drupal:12.0.0. Use getDecoratedClasses() instead. See https://www.drupal.org/node/3557464', E_USER_DEPRECATED);
    return $this->originalClass ?: $this->class;
  }

  /**
   * {@inheritdoc}
   */
+0 −17
Changes for core/lib/Drupal/Core/Entity/EntityTypeInterface.php: 0 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -56,23 +56,6 @@ public function get($property);
   */
  public function set($property, $value);

  /**
   * Gets the name of the original entity type class.
   *
   * In case the class name was changed with setClass(), this will return
   * the initial value. Useful when trying to identify the entity type ID based
   * on the class.
   *
   * @return string
   *   The name of the original entity type class.
   *
   * @deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use
   *   getDecoratedClasses() instead.
   *
   * @see https://www.drupal.org/node/3557464
   */
  public function getOriginalClass();

  /**
   * Gets the list of all the classes for this entity type.
   *
+0 −27
Changes for core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php: 0 added lines, 27 removed lines.
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\Attributes\TestWith;

/**
@@ -322,32 +321,6 @@ public function testDerivativeIdMaxlength(bool $invalid_entity_type, bool $inval

  }

  /**
   * Tests get original class unchanged.
   */
  #[IgnoreDeprecations]
  public function testGetOriginalClassUnchanged(): void {
    $this->expectUserDeprecationMessage('The "getOriginalClass" method is deprecated in drupal:11.4.0 and will be removed in drupal:12.0.0. Use getDecoratedClasses() instead. See https://www.drupal.org/node/3557464');
    $class = $this->randomMachineName();
    $entity_type = $this->setUpEntityType(['class' => $class]);
    $this->assertEquals($class, $entity_type->getOriginalClass());
  }

  /**
   * Tests get original class changed.
   *
   * @legacy-covers ::setClass
   * @legacy-covers ::getOriginalClass
   */
  #[IgnoreDeprecations]
  public function testGetOriginalClassChanged(): void {
    $this->expectUserDeprecationMessage('The "getOriginalClass" method is deprecated in drupal:11.4.0 and will be removed in drupal:12.0.0. Use getDecoratedClasses() instead. See https://www.drupal.org/node/3557464');
    $class = $this->randomMachineName();
    $entity_type = $this->setUpEntityType(['class' => $class]);
    $entity_type->setClass($this->randomMachineName());
    $this->assertEquals($class, $entity_type->getOriginalClass());
  }

  /**
   * Tests get decorated classes through setClass.
   *