Fix the issues reported by phpcs

Created on 25 February 2021, almost 4 years ago
Updated 4 March 2023, over 1 year ago

Problem/Motivation

Found some issues caught by PHPCS. As follows:

FILE: /home/guilhermevp/Ambientes/Drupal 9.2.x/drupal/modules/stickynav/src/Form/StickynavSettingsForm.php

----------------------------------------------------------------------------------------------------------
FOUND 16 ERRORS AND 2 WARNINGS AFFECTING 16 LINES
----------------------------------------------------------------------------------------------------------
  5 | ERROR   | [x] When importing a class with "use", do not include a leading \
  6 | ERROR   | [x] When importing a class with "use", do not include a leading \
  7 | WARNING | [x] Unused use statement
  7 | ERROR   | [x] When importing a class with "use", do not include a leading \
  8 | WARNING | [x] Unused use statement
  8 | ERROR   | [x] When importing a class with "use", do not include a leading \
 34 | ERROR   | [x] Short array syntax must be used to define arrays
 40 | ERROR   | [x] Short array syntax must be used to define arrays
 41 | ERROR   | [x] Short array syntax must be used to define arrays
 42 | ERROR   | [x] Short array syntax must be used to define arrays
 44 | ERROR   | [x] Short array syntax must be used to define arrays
 45 | ERROR   | [x] Short array syntax must be used to define arrays
 50 | ERROR   | [x] Short array syntax must be used to define arrays
 58 | ERROR   | [x] Short array syntax must be used to define arrays
 66 | ERROR   | [x] Short array syntax must be used to define arrays
 74 | ERROR   | [x] Short array syntax must be used to define arrays
 80 | ERROR   | [x] Short array syntax must be used to define arrays
 85 | ERROR   | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------


FILE: /home/guilhermevp/Ambientes/Drupal 9.2.x/drupal/modules/stickynav/src/Controller/StickynavController.php
--------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------
 14 | ERROR | [ ] Class property $theme_handler should use lowerCamel naming without underscores
 14 | ERROR | [ ] Missing member variable doc comment
 20 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
 59 | ERROR | [x] Short array syntax must be used to define arrays
 64 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------

Steps to reproduce

Use phpcs --standard=Drupal to see the issues.

Proposed resolution

Fix issues as requested.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇷Brazil guilhermevp Santa Rita do Passa Quatro - SP

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

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.

Production build 0.71.5 2024