Download & Extend

Resource plugins miss an interface

Project:Drupal core
Version:8.x-dev
Component:rest.module
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

REST resource plugins have a base class, but no interface. We really should have an interface also.

Comments

#1

Category:bug report» task
Priority:major» normal

That's a good idea, but not really a major bug?

#2

Status:active» needs review

And here comes the ResourceInterface, it lives right next to ResourceBase.

AttachmentSizeStatusTest resultOperations
resource-interface-1874820-2.patch2.76 KBIdlePASSED: [[SimpleTest]]: [MySQL] 50,006 pass(es).View details

#3

+++ b/core/modules/rest/lib/Drupal/rest/Plugin/ResourceBase.phpundefined
@@ -14,17 +14,14 @@
+   * Implements ResourceInterface::permissions().

@@ -43,13 +40,7 @@ public function permissions() {
+   * Implements ResourceInterface::routes().

Should be Implements \ Drupal\rest\Plugin\ResourceInterface::permissions().

or routes().

+++ b/core/modules/rest/lib/Drupal/rest/Plugin/ResourceInterface.phpundefined
@@ -0,0 +1,39 @@
+ * Contains Drupal\rest\Plugin\ResourceInterface.

Contains \Drupal\...

#4

The \ prefix for the @file doc block is a good idea.

Method overrides should NOT use the fully namespaced reference, see http://drupal.org/node/1354#namespaces : "Elsewhere in documentation, omit the namespace if the class/interface is within the use/namespace declaration context of the file."

AttachmentSizeStatusTest resultOperations
resource-interface-1874820-4.patch2.76 KBIdlePASSED: [[SimpleTest]]: [MySQL] 50,033 pass(es).View details
resource-interface-1874820-4-interdiff.txt483 bytesIgnored: Check issue status.NoneNone

#5

Status:needs review» reviewed & tested by the community

That recent change to the namespaces rule is a bunch of crap, but its not this issue's fault. :)

#6

Status:reviewed & tested by the community» fixed

Committed/pushed to 8.x, thanks!

#7

Status:fixed» closed (fixed)

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

nobody click here