Fix the issues reported by phpcs

Created on 29 May 2023, about 1 year ago
Updated 6 August 2023, 11 months ago

Problem/Motivation

FILE: ...html/contribution/drupal10/web/modules/contrib/private_messenger/README.md
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
17 | WARNING | [ ] Line exceeds 80 characters; contains 164 characters
19 | WARNING | [ ] Line exceeds 80 characters; contains 158 characters
21 | WARNING | [ ] Line exceeds 80 characters; contains 298 characters
39 | WARNING | [ ] Line exceeds 80 characters; contains 150 characters
49 | WARNING | [ ] Line exceeds 80 characters; contains 229 characters
58 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...b/modules/contrib/private_messenger/src/Entity/PrivateMessengerMessage.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
53 | WARNING | Line exceeds 80 characters; contains 92 characters
--------------------------------------------------------------------------------

FILE: ...dules/contrib/private_messenger/src/PrivateMessengerMessageListBuilder.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
92 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...on/drupal10/web/modules/contrib/private_messenger/private_messenger.module
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
11 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
12 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
13 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 484ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig private_messenger/

Proposed resolution

Fix all the issues for Drupal and DrupalPractice standards.

Remaining tasks

Patch review.

📌 Task
Status

Fixed

Version

1.2

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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

  • Issue created by @urvashi_vora
  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    + * This module extendeds functionality of core messenger to handle situations
    + when you want to leave a specific user with warning/error/info message on
    + login event.

    Since that sentence is part of a list, the part that is moved on a new line must be intended. extendeds is also misspelled.

  • Assigned to urvashi_vora
  • 🇮🇳India urvashi_vora Madhya Pradesh, India
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India urvashi_vora Madhya Pradesh, India
  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    - * i think this module can be more developed to not just leave a message on login but also on page refresh but i didn't check on performance if did so and admin may leave a custom warning for specific user through a form. if you have an idea to extend, you're more than welcomed to create an issue.
    + * I think this module can be more developed to not just leave a message on
    +   login but also on page refresh but i didn't check on performance if did so
    +   and admin may leave a custom warning for specific user through a form.
    +   If you have an idea to extend, you're more than welcomed to create an issue.
    

    Since that text is changed, also the misspelled words and the punctuation needs to be corrected. (The first person singular is spelled I, not i.)

    - * i.e. if system has applied an action against a user or any data related to him/her and want to let know what happened beside any other notification method.
    + * i.e. if system has applied an action against a user or any data related
    +   to him/her and want to let know what happened beside any other notification
    +   method.

    There some changes to be done on that text, but let's just remove i.e. which is not used before an example. let needs a pronoun; it is better to change user with users, so there is no need to say him/her, and the pronoun after let is easier to get it.

    -   * When a new private messenger message entity is created, set the uid entity reference to
    -   * the current user as the creator of the entity.
    +   * When a new private messenger message entity is created,
    +   * set the uid entity reference to the current user as the creator
    +   * of the entity.
    - * You need to create an private messenger entity whenever needed and module will load this entity on login and show message and remove the entity to not flood its table. in future i will add a simpler method to send the message.
    + * You need to create an private messenger entity whenever needed and module
    +   will load this entity on login and show message and remove the entity to not
    +   flood its table.
    +   In future, planned to implement a simpler method to send the message.
    

    The length of lines should be close as much as possible to 80 characters, as long as to make them 80 characters, a word is not split in two different lines. Lines are not split at punctuation marks. All the text after the changed one needs to be reformatted.
    In future, planned to implement a simpler method to send the message. is not grammatically correct. (The subject is missing.)

  • Assigned to nitin_lama
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India urvashi_vora Madhya Pradesh, India
    • 4cbfd3ba committed on 1.x
      fixed coding standard issues #3363331
      
  • Status changed to Fixed 11 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024