Fix coding standards

Created on 18 April 2023, about 1 year ago
Updated 16 May 2023, about 1 year ago

Problem/Motivation

There are some coding standard violations in this module.

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

results into:

FILE: isbn/isbn.install
--------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
 5 | ERROR | [x] Doc comment short description must be on the first line
 5 | ERROR | [x] Function comment short description must start with exactly one space
 7 | ERROR | [x] Additional blank lines found at end of doc comment
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: isbn/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
  1 | WARNING | Line exceeds 80 characters; contains 136 characters
  3 | WARNING | Line exceeds 80 characters; contains 111 characters
  5 | WARNING | Line exceeds 80 characters; contains 264 characters
 13 | WARNING | Line exceeds 80 characters; contains 181 characters
----------------------------------------------------------------------


FILE: isbn/src/Plugin/Field/FieldWidget/IsbnWidget.php
-----------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------
 24 | ERROR | [x] Missing function doc comment
 32 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: isbn/src/Plugin/Field/FieldType/IsbnItem.php
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 58 | ERROR | [x] Missing function doc comment
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------


FILE: isbn/src/Plugin/Field/FieldFormatter/IsbnFormattedFormatter.php
--------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------
 49 | ERROR | [x] Missing function doc comment
 52 | ERROR | [x] Expected 1 blank line after function; 0 found
 53 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------


FILE: isbn/src/Plugin/Field/FieldFormatter/IsbnPlainFormatter.php
----------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------
 47 | ERROR | [x] Expected 1 blank line after function; 0 found
 48 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------


FILE: isbn/src/Plugin/Validation/Constraint/IsbnConstraint.php
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
 23 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------


FILE: isbn/src/Plugin/Validation/Constraint/IsbnConstraintValidator.php
----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------
  8 | ERROR | [x] Missing class doc comment
 10 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------


FILE: isbn/src/IsbnToolsService.php
----------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------
  3 | ERROR | [x] There must be one blank line after the namespace declaration
  9 | ERROR | [x] Missing class doc comment
 11 | ERROR | [ ] Class property $isbn_tools should use lowerCamel naming without underscores
 11 | ERROR | [ ] Missing member variable doc comment
 20 | ERROR | [x] Missing function doc comment
 23 | ERROR | [x] Expected newline after closing brace
 28 | ERROR | [x] Missing function doc comment
 32 | ERROR | [x] Missing function doc comment
 35 | ERROR | [x] Expected newline after closing brace
 39 | ERROR | [x] Missing function doc comment
 42 | ERROR | [x] Expected newline after closing brace
 46 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

I've worked on fixing these and I'll submit a fix shortly.

Except for the README.txt, which is already being handled in 📌 Replace README.txt with README.md Fixed .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands MegaChriz

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

Comments & Activities

Production build 0.69.0 2024