Fix the issues reported by phpcs

Created on 18 May 2023, over 2 years ago

Problem/Motivation

Steps to reproduce

Run this command in the module folder: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

Proposed resolution

FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/ad_entity/ad_entity.install
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 116 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up
     |       | over multiple lines
----------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/ad_entity/ad_entity.services.yml
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
 21 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/ad_entity/RELEASE_NOTES.md
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 8 | WARNING | Line exceeds 80 characters; contains 94 characters
-------------------------------------------------------------------------------------------------


FILE: ...inees/New/drupalorgsite/docroot/modules/contrib/ad_entity/modules/ad_entity_adtech_v2/ad_entity_adtech_v2.module
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 72 | ERROR | Unnecessarily gendered language in a comment
----------------------------------------------------------------------------------------------------------------------


FILE: ...es/New/drupalorgsite/docroot/modules/contrib/ad_entity/modules/ad_entity_adtech_v2/ad_entity_adtech_v2.theme.inc
----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------
 19 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 26 spaces but found 7 spaces
 20 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 27 spaces but found 8 spaces
 21 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 29 spaces but found 10 spaces
 22 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 20 spaces but found 1 space
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: ...orgsite/docroot/modules/contrib/ad_entity/modules/ad_entity_adtech_v2/src/Plugin/ad_entity/AdType/AdtechType.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
 479 | ERROR | Description for the @return value is missing
 493 | ERROR | Description for the @return value is missing
----------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/ad_entity/ad_entity.module
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 109 | ERROR | The array declaration extends to column 188 (the limit is 80). The array content should be split up
     |       | over multiple lines
----------------------------------------------------------------------------------------------------------------------


FILE: ...s/studenttrainees/New/drupalorgsite/docroot/modules/contrib/ad_entity/src/Plugin/Field/FieldType/ContextItem.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 91 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the
    |       | allowed_classes option.
----------------------------------------------------------------------------------------------------------------------


FILE: ...rs/studenttrainees/New/drupalorgsite/docroot/modules/contrib/ad_entity/src/Plugin/Block/AdDisplayIframeBlock.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
 34 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 44 | ERROR | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

Time: 3.32 secs; Memory: 16MB

Remaining tasks

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇵🇭Philippines paraderojether

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

Production build 0.71.5 2024