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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Category: bug » task
Priority: Major » Normal

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

klausi’s picture

Status: Active » Needs review
FileSize
2.76 KB

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

tim.plunkett’s picture

+++ 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\...

klausi’s picture

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."

tim.plunkett’s picture

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. :)

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

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