ConfigEntityInterface::setOriginalID() should return $this, just like any other setter.

Comments

xano’s picture

Assigned: xano » Unassigned
Status: Active » Needs review
StatusFileSize
new999 bytes

Also, should the method name not be setOriginalId()?

dawehner’s picture

Issue tags: +Needs tests

I also agree that it should be name setOriginalId

xano’s picture

StatusFileSize
new6.27 KB
new6.81 KB
xano’s picture

Issue tags: -Needs tests

.

Status: Needs review » Needs work

The last submitted patch, drupal_2088241_3.patch, failed testing.

dawehner’s picture

  1. +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
    @@ -28,9 +28,9 @@ public function getOriginalID();
    -   * @return void
    +   * @return \Drupal\Core\Config\Entity\ConfigEntityInterface
    

    We are using '@return self' in quite some places which gives even more information.

  2. +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php
    @@ -62,12 +78,22 @@ public function testStorageControllerMethods() {
    +    $this->assertTrue($entity->setOriginalId($id) instanceof EntityInterface);
    

    We could even check that it is the same object using spl_object_hash

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new729 bytes
new7.71 KB
xano’s picture

StatusFileSize
new7.68 KB
new1.15 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

xjm’s picture

Category: feature » task
webchick’s picture

Title: ConfigEntityInterface::setOriginalID() should return $this » Change notice: ConfigEntityInterface::setOriginalID() should return $this
Priority: Normal » Major
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Committed and pushed to 8.x. Thanks!

Will need a change notice.

xano’s picture

Title: Change notice: ConfigEntityInterface::setOriginalID() should return $this » ConfigEntityInterface::setOriginalID() should return $this
Priority: Major » Normal
Status: Active » Fixed
Issue tags: -Needs change record

Change notice is at https://drupal.org/node/2107951.

xano’s picture

For some reason the capitalization issue was never fixed or rolled back. See #2113319: Rename getOriginalID() to getOriginalId() and setOriginalID() to setOriginalId().

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.