Need a patch that resolves the coding standard issues shown in pareview.sh

CommentFileSizeAuthor
#2 fragments-cs-3039469.patch1.95 KBSnehal Brahmbhatt

Comments

snehal.addweb created an issue. See original summary.

Snehal Brahmbhatt’s picture

StatusFileSize
new1.95 KB

Here's the patch on the same kindly review it.

eelkeblok’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev

Seems to be for D7 version. Sorry, not true.

eelkeblok’s picture

Version: 7.x-1.x-dev » 8.x-1.0-beta1
diff --git a/tests/src/Traits/FragmentCreationTrait.php b/tests/src/Traits/FragmentCreationTrait.php
index f167462..50e4616 100644
--- a/tests/src/Traits/FragmentCreationTrait.php
+++ b/tests/src/Traits/FragmentCreationTrait.php
@@ -49,13 +49,14 @@ trait FragmentCreationTrait {
    * @param array $settings
    *   (optional) An associative array of settings for the fragment, as used in
    *   entity_create(). Override the defaults by specifying the key and value
-   *   in the array, for example:
-   *   @code
+   *   in the array, for example.
+   *
+   * @code
    *     $this->drupalCreateFragment(array(
    *       'title' => t('Hello, world!'),
    *       'type' => 'article',
    *     ));
-   *   @endcode
+   * @endcode
    *   The following defaults are provided:
    *   - title: Random string.
    *   - user_id: The currently logged in user, or anonymous.

It seems code sniffer is actually judging the @code end @endcode tags as though they are one of the sections that could go a in a docblock. I think this is wrong. These are actually part of the @param array $settings setction; in short, I think this change should not be applied (adding a blank line, although dictacted by the code sniffer warnings, is actually in direct violation with this comment style rule: https://www.drupal.org/docs/develop/standards/api-documentation-and-comm... ("Do not use a blank line between the text that explains the code sample and the code sample itself.").

The other two changes look OK.

eelkeblok’s picture

Status: Needs review » Fixed

  • eelkeblok committed 787cbf3 on 8.x-1.x
    Issue #3039469 by eelkeblok: Revert change to FragmentCreationTrait
    

Status: Fixed » Closed (fixed)

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