API page: https://api.drupal.org/api/drupal/core%21modules%21system%21system.api.p...

The Annotations topic should document that some annotation types, which extend the PluginID annotation class, have only a single 'id' key in their annotation. For these, it is possible to use a shorthand annotation:

 * @SimplePluginType("id_value")

in place of

 * @SimplePluginType(
 *   'id' => "id_value"
 *  )

Task: Add this information to the topic, which is located in the file core/modules/system/system.api.php near the end (although the topic documentation may soon be moved to file core.api.php).

Note that you need to leave a space after the @ sign, as is done in the rest of this documentation.

Comments

undertext’s picture

StatusFileSize
new969 bytes

Here is the patch with @ ViewsArea annotation as example of shorthand notation.

undertext’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Great work, thanks!

Oh wait. This is my fault... In annotation we don't use => for array keys, just =. So that needs to be fixed in:

+ * @code
+ * * @ViewsArea(
+ * *   id => "entity"
+ * *)
+ * @endcode
pushpinderchauhan’s picture

Status: Needs work » Needs review
StatusFileSize
new413 bytes
new968 bytes

Please review updated patch, did changes mentioned in #3.

jhodgdon’s picture

Status: Needs review » Needs work

Great! One more thing that I missed in my previous review (sorry):

+ * @endcode
+ *
+ * in place of
+ * @code

I don't think we want a blank line here. The two code blocks and "in place of" are part of the same sentence.

pushpinderchauhan’s picture

Status: Needs work » Needs review
StatusFileSize
new964 bytes
new398 bytes

Thanks!

Please review updated patch.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Great! We can't commit patches today until the 8.x to 8.0.x branch conversion is taken care of, but this is ready to go.

  • jhodgdon committed 9b274e1 on 8.0.x
    Issue #2309405 by undertext, er.pushpinderrana: Add note to Annotations...
jhodgdon’s picture

Version: 8.x-dev » 8.0.x-dev
Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 8.0.x.

Status: Fixed » Closed (fixed)

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

m1r1k’s picture

Issue tags: +#ams2014contest