Fix the issues reported by phpcs

Created on 10 July 2023, over 1 year ago
Updated 22 August 2023, over 1 year ago

Problem/Motivation

FILE: ...b/commerce_mercadopago-3373628/src/SmartPaymentButtonsBuilderInterface.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
12 | ERROR | Parameter $return_url is not described in comment
19 | WARNING | Line exceeds 80 characters; contains 82 characters
--------------------------------------------------------------------------------

FILE: ...es/contrib/commerce_mercadopago-3373628/src/SmartPaymentButtonsBuilder.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
37 | ERROR | [x] Expected 0 spaces between argument "$return_url" and comma;
| | 1 found
75 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | $preference_id
86 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | 'commerce_mercadopago/checkout'
90 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | ]
91 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | ]
92 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | ]
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...rce_mercadopago-3373628/src/Plugin/Commerce/PaymentGateway/MercadoPago.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
| | line
59 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
60 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
61 | ERROR | [x] Array closing indentation error, expected 4 spaces but
| | found 6
129 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: )
150 | ERROR | [ ] The $_GET super global must not be accessed directly;
| | inject the request.stack service and use
| | $stack->getCurrentRequest()->query instead
179 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
283 | ERROR | [x] Expected 1 blank line after function; 0 found
284 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 117ms; Memory: 10MB

Steps to reproduce

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

Remaining tasks

FILE: ...rce_mercadopago-3373628/src/Plugin/Commerce/PaymentGateway/MercadoPago.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
151 | ERROR | The $_GET super global must not be accessed directly; inject the
| | request.stack service and use $stack->getCurrentRequest()->query
| | instead
--------------------------------------------------------------------------------

Time: 122ms; Memory: 10MB

📌 Task
Status

RTBC

Version

1.0

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
  • I think this is a duplicate of
    https://www.drupal.org/project/commerce_mercadopago/issues/3367764 📌 Improve the code Fixed

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi, that issue seems to be fixed, but in the latest pull, I got these issues and thus I created a ticket here. So, in my opinion it is similar but not duplicate.

  • First commit to issue fork.
  • Status changed to Needs work over 1 year ago
  • 🇦🇷Argentina Zarpele

    Hey @urvashi_vora The patch was not applied to the latest version. Could you reformulate it? Use the MR behavior instead of a patch for a better review.

  • First commit to issue fork.
  • @thakurnishant_06 opened merge request.
  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi @thakurnishant_06, I was supposed to work on this as @Zarpele requested to me, however, it is good that you created an MR, but please try to wait for the supposed assignee for working on the tickets.

    Also. @Zarpele, I am updating the issue summary with the recent execution output of phpcs.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Also, I reviewed the MR and it fixes all PHPCS issues as per updated issue summary, except the one issue:

    FILE: ...rce_mercadopago-3373628/src/Plugin/Commerce/PaymentGateway/MercadoPago.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
    151 | ERROR | The $_GET super global must not be accessed directly; inject the
    | | request.stack service and use $stack->getCurrentRequest()->query
    | | instead
    --------------------------------------------------------------------------------

    Time: 122ms; Memory: 10MB

    Adding the same in remaining tasks section.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Fixed last issue as well. Please review.

  • Status changed to RTBC over 1 year ago
  • 🇦🇷Argentina Zarpele

    The code makes sense to me and I do not have any phpcs issues anymore.

    After testing it, I solved an issue on service name introduced here https://git.drupalcode.org/project/commerce_mercadopago/-/merge_requests...

    RTBC +1

Production build 0.71.5 2024