Fix coding standards.

Created on 20 April 2016, over 8 years ago
Updated 22 August 2024, 4 months ago

Problem/Motivation

The module returns the following code-sniffer errors.

FILE: ...lms/modules/opigno/opigno_pretest_app/opigno_pretest_app.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 97 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 76ms; Memory: 6.25Mb

FILE: ..._lms/modules/opigno/opigno_pretest_app/opigno_pretest_app.module
----------------------------------------------------------------------
FOUND 13 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
----------------------------------------------------------------------
  37 | ERROR   | [x] Expected 1 space after "=>"; 2 found
  50 | ERROR   | [ ] Missing parameter comment
  50 | ERROR   | [x] Expected "object" but found "stdClass" for parameter type
  52 | ERROR   | [ ] Return comment must be on the next line
 166 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 184 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 266 | ERROR   | [ ] Missing parameter comment
 266 | ERROR   | [x] Expected "object" but found "stdClass" for parameter type
 266 | ERROR   | [x] Tag value indented incorrectly; expected 1 space but found 2
 268 | ERROR   | [ ] Return comment must be on the next line
 287 | ERROR   | [ ] Missing parameter comment
 287 | ERROR   | [x] Expected "object" but found "stdClass" for parameter type
 287 | ERROR   | [x] Tag value indented incorrectly; expected 1 space but found 2
 289 | ERROR   | [ ] Expected "object|null" but found "stdClass|null" for function return type
 289 | ERROR   | [ ] Return comment must be on the next line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 200ms; Memory: 8.75Mb

Proposed resolution

Fix it.

Remaining tasks

Patch, Commit.

User interface changes

None.

API changes

None.

Data model changes

None.

šŸ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡§šŸ‡¬Bulgaria ndobromirov

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Hi @urvashi_vora,

    Applied the patch you provided, it was applied successfully and confirmed no errors remaining.

    āžœ  opigno_pretest_app git:(7.x-1.x) curl https://www.drupal.org/files/issues/2022-08-05/coding-standards-resolved-2709929-5.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4691  100  4691    0     0  19748      0 --:--:-- --:--:-- --:--:-- 20665
    patching file opigno_pretest_app.info
    patching file opigno_pretest_app.install
    patching file opigno_pretest_app.module
    āžœ  opigno_pretest_app git:(7.x-1.x) ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig opigno_pretest_app
    āžœ  contrib git:(master) āœ—

    Will now move this to RTBC

    Thanks,
    Jake

Production build 0.71.5 2024