Support from Acquia helps fund testing for Drupal Acquia logo

Comments

umed_singh created an issue. See original summary.

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

looks good

dragonwize’s picture

Status: Reviewed & tested by the community » Needs review

Needs to be tested.

mauryarahul11’s picture

Issue tags: -code sniffer +code sniffer
FileSize
9.09 KB

After applying the patch, i found following errors and warnings -

FILE: /better_formats/better_formats.module
------------------------------------------------------------------------------
FOUND 13 ERRORS AND 2 WARNINGS AFFECTING 14 LINES
------------------------------------------------------------------------------
   5 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  15 | ERROR   | [x] Additional blank lines found at end of doc comment
  47 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 261 | ERROR   | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
 263 | ERROR   | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
 282 | ERROR   | [ ] Type hint "array" missing for $a
 282 | ERROR   | [ ] Type hint "array" missing for $b
 323 | ERROR   | [ ] Type hint "array" missing for $bf_form
 342 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 343 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 370 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 405 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 406 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 410 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 450 | ERROR   | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------

FILE: /better_formats/README.txt
-------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
-------------------------------------------------------------------------
 13 | WARNING | Line exceeds 80 characters; contains 81 characters
 16 | WARNING | Line exceeds 80 characters; contains 86 characters
 17 | WARNING | Line exceeds 80 characters; contains 83 characters
 21 | WARNING | Line exceeds 80 characters; contains 81 characters
 22 | WARNING | Line exceeds 80 characters; contains 118 characters
 28 | WARNING | Line exceeds 80 characters; contains 87 characters
-----------------------------------------------------------------------------

FILE: /better_formats/better_formats.install
------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------
 9 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
   |         | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
-----------------------------------------------------------------------------------

FILE: /better_formats/src/Form/SettingsForm.php
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------

FILE: /better_formats/src/BetterFormatsPermissions.php
----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------
 24 | ERROR | Parameter $entity_type_manager is not described in comment
 27 | ERROR | Doc comment for parameter $entity_manager does not match actual variable name $entity_type_manager
---------------------------------------------------------------------------------

FILE: /better_formats/src/Tests/BetterFormatsTermTest.php
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------
 24 | WARNING | Possible useless method overriding detected
---------------------------------------------------------------------------------

FILE: /better_formats/src/Tests/BetterFormatsFilterFormatAccessTest.php
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 24 | WARNING | Possible useless method overriding detected
---------------------------------------------------------------------------------

I have fixed most of the above errors and warning except few and created a new patch, Please review.

mauryarahul11’s picture

Issue tags: +Coding standards, +phpcs
atul_ghate’s picture

Assigned: Unassigned » atul_ghate

Hi,
i will review this patch.

atul_ghate’s picture

Assigned: atul_ghate » Unassigned
FileSize
60.85 KB
9.14 KB
8.63 KB

There are still some PHPCS warnings #4 that have not been resolved by this patch (see above image). I have provide an updated patch, please review.

Meeni_Dhobale’s picture

Assigned: Unassigned » Meeni_Dhobale

@atul ghate I will review your patch.

Meeni_Dhobale’s picture

Assigned: Meeni_Dhobale » Unassigned
Status: Needs review » Reviewed & tested by the community

@atul ghate I reviewed your patch and it applying smoothly at my end. Also it resolves all the phpcs coding standard errors and warnings. LGTM. Can be move this issue to RTBC. Moving to RTBC.

  • mandclu committed be7abe8f on 8.x-1.x
    Issue #2841956 by atul ghate, umed91, mauryarahul11, mandclu: PHP Code...
mandclu’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for everyone's work on this. I ended up tweaking some of the comment and README changes to improve readability.. Merged in, will try to roll a new release shortly.

Status: Fixed » Closed (fixed)

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