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
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:
- 3373836-remove-outdated-todo
changes, plain diff MR !4358
Comments
Comment #2
spokjeComment #4
spokjeComment #5
smustgrave commentedSimple change.
Comment #7
catchCommitted/pushed to 11.x, thanks!