Problem/Motivation


The following methods in \Drupal\views\Plugin\views\display\DisplayPluginInterface are not documented:

  • initDisplay
  • destroy


Proposed resolution


Add docblocks for the mentioned methods.

Comments

vdanielpop created an issue. See original summary.

vdanielpop’s picture

StatusFileSize
new945 bytes
vdanielpop’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Thanks for filing this issue and making a patch! It's almost perfect; just needs a small amount of work:

  1. +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php
    @@ -37,8 +37,22 @@
    +   * Initialize the display plugin.
    

    Initialize => Initializes

  2. +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php
    @@ -37,8 +37,22 @@
    +   *   * @return mixed
    +   */
       public function initDisplay(ViewExecutable $view, array &$display, array &$options = NULL);
    

    This looks like a typo.

    @return should not be indented like this, and there is an additional * on the line.

    Also there should be a blank line between the @param section and the @return

    And the return value needs to be documented. What is returned from this method?

sdstyles’s picture

Status: Needs work » Needs review
StatusFileSize
new922 bytes
new817 bytes

I removed @return because &$display is passed as reference, and all initDisplay() methods don't return anything.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Agreed, that method does not return anything. And given that, removing the @return is correct.

The new patch looks great! Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php
@@ -37,8 +37,21 @@
+   * @param array $options
+   *   The options for the display plugin.

The param description should be preceded with (optional) and prefixed with Defaults to NULL..

alexpott’s picture

Issue tags: +rc eligible

As this is a documentation change it is rc eligilbe

snehi’s picture

+1 for RTBC

nicrodgers’s picture

Status: Needs work » Needs review
StatusFileSize
new951 bytes

Updated based on feedback in #7

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Interdiff files are always appreciated, for the next time...

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0a9d46f and pushed to 8.0.x. Thanks!

  • alexpott committed 0a9d46f on 8.0.x
    Issue #2585979 by sdstyles, vdanielpop, nicrodgers: Add missing...

Status: Fixed » Closed (fixed)

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