Fix phpcs issues

Created on 12 July 2025, 24 days ago

Problem/Motivation

After running phpcs with Drupal,DrupalPractice standard I get the following errors:

FILE: ...al10/web/modules/sms_link_field/src/Plugin/Field/FieldType/SmsLinkItem.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 25 | ERROR | [x] Parameter $field_definition has null default value, but is
    |       |     not marked as nullable.
 28 | ERROR | [x] Expected 1 blank line after function; 0 found
 29 | 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: ...odules/sms_link_field/src/Plugin/Field/FieldFormatter/SmsLinkFormatter.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------
 30 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
    |         |     question marks, colons, or closing parentheses
 34 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 34 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
    |         |     question marks, colons, or closing parentheses
 51 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
    |         |     question marks, colons, or closing parentheses
 63 | ERROR   | [x] Expected 1 blank line after function; 0 found
 64 | ERROR   | [x] The closing brace for the class must have an empty line
    |         |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Proposed resolution

Fix the phpcs issues

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom ipwa

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

Comments & Activities

Production build 0.71.5 2024