Fix Drupal coding standards

Created on 5 September 2025, 28 days ago

Problem/Motivation

There are multiple issues with respect to coding standards

Steps to reproduce

Validate PHPCS and Drupal standards for the code.

Proposed resolution

Indentation & Spacing Issues

  • Tabs converted to spaces: All improper tab indentation replaced with 2-space indentation
  • Line indentation errors: Fixed incorrect spacing at line starts
  • Array indentation: Corrected array element alignment
  • Spacing around operators: Fixed missing spaces around =, =>, ,, etc.
  • Spacing after commas: Added proper spacing after comma-separated values

Documentation Compliance

Empty class doc comments: Filled /** */ with proper class descriptions

  • Empty function doc comments: Added complete method documentation
  • Missing file doc comments: Added file-level documentation to main module
  • Missing parameter documentation: Added @param tags for all method parameters
  • Missing return documentation: Added @return tags for all methods
  • Missing variable documentation: Added @var tags for class properties
  • Missing exception documentation: Added @throws tags where applicable

Code Structure & Formatting

  • Function call formatting: Split long function calls (like Url::fromRoute()) across lines
  • Newline requirements: Added missing newlines after opening braces
  • Closing brace placement: Fixed improper brace positioning
  • End-of-file newlines: Added missing newlines at file endings
  • Whitespace cleanup: Removed trailing whitespace

PHP-Specific Standards

  • Function return types: Fixed methods with return types but no return statements
  • Method signatures: Corrected parameter spacing and formatting
  • Class structure: Fixed class brace placement and spacing
  • Namespace formatting: Ensured proper namespace declaration formatting

Remaining tasks

Fix the issues and raise the MR.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

📌 Task
Status

Active

Component

Code

Created by

🇮🇳India neerajsingh IN 🇮🇳

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024