API page: https://api.drupal.org/api/drupal/core%21core.api.php/group/events/

Problem

The code example in the documentation for subscribing to an event uses the wrong method signature. It needs to be a static method.

Proposed resolution

Change this:

public function getSubscribedEvents()

To this:

public static function getSubscribedEvents()

Comments

eojthebrave created an issue. See original summary.

eojthebrave’s picture

Status: Active » Needs review
Issue tags: +Novice
StatusFileSize
new631 bytes
eojthebrave’s picture

This is actually probably a better solution as it makes the method both public, and static. Which matches the interface exactly.

amber himes matz’s picture

#3 Looks good. Thanks @eojthebrave.

amber himes matz’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Updating status to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed d558fbe to 8.3.x and 210f8ff to 8.2.x. Thanks!

  • alexpott committed d558fbe on 8.3.x
    Issue #2828642 by eojthebrave: Wrong method signature in documentation...

  • alexpott committed 210f8ff on 8.2.x
    Issue #2828642 by eojthebrave: Wrong method signature in documentation...

Status: Fixed » Closed (fixed)

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