Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heykarthikwithu created an issue. See original summary.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Active » Needs review
FileSize
2.56 KB

Removed the redundant variable, and added @return, @param.

schoash’s picture

Status: Needs review » Reviewed & tested by the community

tested on 8.0.x and 8.1.x-dev.
It works on both and looks ok.

droplet’s picture

+++ b/core/modules/editor/js/editor.formattedTextEditor.js
@@ -94,8 +94,7 @@
-      var to = state;
-      switch (to) {
+      switch (state) {

Sorry, I forgot to mention it also on quickedit modules. We may have to change them all to keep consistent code in those files.

Wim Leers’s picture

Priority: Normal » Minor
Status: Reviewed & tested by the community » Needs work
Issue tags: +Documentation
  1. +++ b/core/modules/editor/js/editor.formattedTextEditor.js
    @@ -94,8 +94,7 @@
    -      var to = state;
    -      switch (to) {
    +      switch (state) {
    

    No. Please don't change this. This variable is intentionally there, for legibility.

  2. +++ b/core/modules/editor/src/Element.php
    @@ -36,6 +36,12 @@ public function __construct(PluginManagerInterface $plugin_manager) {
    +   * @param array $element
    +   *   An array of elements.
    +   *
    +   * @return array
    +   *   An pre rendered text format of array.
    

    We don't do this for #pre_render callbacks.

  3. +++ b/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
    @@ -59,6 +59,12 @@ function getMetadata(FieldItemListInterface $items) {
    +   *   A format id.
    

    s/format/text format/

  4. +++ b/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
    @@ -59,6 +59,12 @@ function getMetadata(FieldItemListInterface $items) {
    +   * @return bool
    +   *   A bool value.
    

    LOL.

    Omit the second line, please. The single-line explanation at the top of this docblock already covers this.

  5. +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
    @@ -112,6 +112,16 @@ protected function setUp() {
    +   *   An integer id.
    

    LOL. Needs to be fixed. This is useless.

  6. +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
    @@ -112,6 +112,16 @@ protected function setUp() {
    +   *   Returns a selected editor.
    

    Inaccurate.

heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu
Mac_Weber’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
FileSize
1.89 KB
2.35 KB

Did the changes pointed by @Wim Leers at #5, in addition to s/id/ID/ and:

    * @param int $entity_id
-   *   An integer id.
+   *   An entity ID.
Wim Leers’s picture

Status: Needs review » Needs work

Just two more nits, then this is RTBC:

  1. +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
    @@ -112,6 +112,16 @@ protected function setUp() {
        * Returns the in-place editor that Edit selects.
    

    Returns the in-place editor that quickedit selects.

  2. +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
    @@ -112,6 +112,16 @@ protected function setUp() {
    +   *   Returns a selected editor.
    

    Returns the selected in-place editor.

heykarthikwithu’s picture

Status: Needs work » Needs review
FileSize
1.48 KB
769 bytes

As per #8, changes are done.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Title: Removal of redundant variable and adding @param, @return in the code base. » Add @param, @return in the code base for the editor module
Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

Afaics there is one missing... function editor_load($format_id) { every other function is either a hook or callback which don't need documentation.

heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu
heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
FileSize
1.98 KB
431 bytes

As per #11, changes are appended.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 102928a and pushed to 8.0.x. Thanks!

  • alexpott committed 32c319a on 8.1.x
    Issue #2625512 by heykarthikwithu, Mac_Weber, Wim Leers: Add @param, @...

  • alexpott committed 102928a on
    Issue #2625512 by heykarthikwithu, Mac_Weber, Wim Leers: Add @param, @...

Status: Fixed » Closed (fixed)

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