Problem/Motivation

FILE: /nodeorder/nodeorder.install
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
 13 | WARNING | [x] '@todo: Handle exceptions that could be thrown by DatabaseSchema::addField.' should match the format '@todo Fix problem X
    |         |     here.'
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /nodeorder/src/NodeOrderManager.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
 201 | WARNING | [x] '@todo: distinct?' should match the format '@todo Fix problem X here.'
 203 | WARNING | [x] '@todo: ORDER BY ' . $order;' should match the format '@todo Fix problem X here.'
 220 | WARNING | [x] '@todo: Please convert this statement to the D7 database API syntax.' should match the format '@todo Fix problem X
     |         |     here.'
 224 | WARNING | [x] '@todo: Please convert this statement to the D7 database API syntax.' should match the format '@todo Fix problem X
     |         |     here.'
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /nodeorder/src/NodeOrderManagerInterface.php
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 75 | ERROR | Type hint "array" missing for $tids
-----------------------------------------------------------------------------------------------

FILE: /nodeorder/tests/src/Functional/NodeorderPermissionsTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 97 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /nodeorder/nodeorder.module
---------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
 119 | WARNING | [x] '@todo: Replace this hacked function call.' should match the format '@todo Fix problem X here.'
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: /nodeorder/README.md
-----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------
 22 | WARNING | Line exceeds 80 characters; contains 82 characters
 23 | WARNING | Line exceeds 80 characters; contains 245 characters
 26 | WARNING | Line exceeds 80 characters; contains 158 characters
-----------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml nodeorder

Proposed resolution

Fix the warnings and errors.

Issue fork nodeorder-3350621

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Binoli Lalani created an issue. See original summary.

binoli lalani’s picture

Assigned: binoli lalani » Unassigned
Issue summary: View changes
Status: Active » Needs review

Hello,

I've created MR. Please review.

Thank you!

avpaderno’s picture

Version: 2.0.0 » 2.0.x-dev
Priority: Normal » Minor
Issue tags: +Coding standards
avpaderno’s picture

Status: Needs review » Needs work
-        // @todo: distinct?
+        // @todo distinct?

What follows @todo must be a sentence, but not an interrogative sentence.

-          // @todo: Please convert this statement to the D7 database API syntax.
+          // @todo Please convert this statement to the D7 database API syntax.

Please is not necessary. The sentence should use the imperative mood.

-    $user = $this->drupalCreateUser(['administer taxonomy', 'order nodes within categories']);
+    $users = ['administer taxonomy', 'order nodes within categories'];
+
+    $user = $this->drupalCreateUser($users);

It is probably better to leave the code as it is.
Also, those are permissions, not users. The variable has the wrong name.

binoli lalani’s picture

Status: Needs work » Needs review

Hello @apaderno,

Thank you for reviewing the MR. I have updated the code as requested. Please review.

Thank you!

davps’s picture

Version: 2.0.x-dev » 2.x-dev
Status: Needs review » Needs work

Shruu_rao made their first commit to this issue’s fork.

pray_12 made their first commit to this issue’s fork.

pray_12’s picture

Status: Needs work » Needs review

  • davps committed d21b568c on 2.x authored by Binoli Lalani
    Issue #3350621 by Binoli Lalani, davps, apaderno, pray_12, Shruu_rao:...
davps’s picture

Status: Needs review » Fixed

Thanks everyone for help.

Status: Fixed » Closed (fixed)

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