Problem/Motivation

In #3123832: [META] Fix @todo items referencing closed issues we've discovered there's a @todo in \Drupal\Tests\rest\Unit\EventSubscriber\ResourceResponseSubscriberTest::providerTestSerialization.
This @todo is linked to an d.o. issue that is already closed: #2427811: ResourceHandler can't serialize a stdClass.

This is the @todo:

  public function providerTestSerialization() {
    return [
      // The default data for \Drupal\rest\ResourceResponse.
     [snipped]
      // @todo Not supported. https://www.drupal.org/node/2427811
      // [new \stdClass()],
      // [(object) ['test' => 'foobar']],
    ];
  }

Proposed resolution

#2427811: ResourceHandler can't serialize a stdClass was closed as a ''won't fix", with this remark by @WimLeers:

There's no more need to use \stdClass. You should always use actual classes/interfaces. Otherwise… just use array. And as #15 says: arrays work fine.

I don't see why we would want to support \stdClass.

Let's remove the @todo as is no longer seems relevant.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3373836

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Issue summary: View changes

spokje’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Simple change.

  • catch committed 349e4c5d on 11.x
    Issue #3373836 by Spokje: Remove outdated @todo pointing to #2427811 in...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

Status: Fixed » Closed (fixed)

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