Phpcs standard fix.

Created on 18 June 2020, over 4 years ago
Updated 23 January 2023, about 2 years ago
🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India suresh prabhu parkala Bangalore

Live updates comments and jobs are added and updated live.
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.

  • Assigned to vitorbs
  • 🇧🇷Brazil vitorbs Belo Horizonte

    Working on it.

  • 🇧🇷Brazil vitorbs Belo Horizonte

    I'm having the same problem, the patch doesn't apply, what should i do? If anyone can help me...

    Skipped patch 'README.txt'.
    Skipped patch 'src/NgLightbox.php'.
    Skipped patch 'src/Tests/NgLightboxTest.php'.
    Checking patch src/Form/NgLightboxSettingsForm.php...
    error: while searching for:
    namespace Drupal\ng_lightbox\Form;
    
    use Drupal\Core\Config\ConfigFactoryInterface;
    use Drupal\Core\Extension\ModuleHandlerInterface;
    use Drupal\Core\Form\ConfigFormBase;
    use Drupal\Core\Form\FormStateInterface;
    use Drupal\ng_lightbox\NgLightbox;
    use Symfony\Component\DependencyInjection\ContainerInterface;
    
    class NgLightboxSettingsForm extends ConfigFormBase {
    
      /**
       * @var \Drupal\Core\Config\ConfigFactoryInterface
       */
      protected $config;
    
    error: patch failed: src/Form/NgLightboxSettingsForm.php:3
    error: src/Form/NgLightboxSettingsForm.php: patch does not apply
  • 🇧🇷Brazil lucienchalom

    I tried to reroll and merge the las two patches as they had different changes.

    The test are failing! I could not fix it, so keeping in needs work.

  • Status changed to Needs review almost 2 years ago
  • 🇧🇷Brazil elber Brazil

    Hi I did a reroll, please revise.

  • Assigned to Charchil Khandelwal
  • 🇮🇳India Charchil Khandelwal

    I reviewed patch #17 its working but still I can see some errors and warnings.

    FILE: ...:\xampp\htdocs\abc\drupal\modules\ng_lightbox\ng_lightbox.module
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but
    | | found "\r\n"
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...c\drupal\modules\ng_lightbox\src\Form\NgLightboxSettingsForm.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but
    | | found "\r\n"
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...:\xampp\htdocs\abc\drupal\modules\ng_lightbox\src\NgLightbox.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n"
    | | but found "\r\n"
    112 | WARNING | [ ] \Drupal calls should be avoided in classes, use
    | | dependency injection instead
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...mpp\htdocs\abc\drupal\modules\ng_lightbox\src\NgLightboxPass.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n"
    | | but found "\r\n"
    18 | WARNING | [ ] Unused variable $id.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...abc\drupal\modules\ng_lightbox\src\NgLightboxServiceProvider.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but
    | | found "\r\n"
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...l\modules\ng_lightbox\tests\src\Functional\NgLightboxWebTest.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but
    | | found "\r\n"
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...c\drupal\modules\ng_lightbox\tests\src\Kernel\NgLightboxTest.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but
    | | found "\r\n"
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    FILE: ...abc\drupal\modules\ng_lightbox\tests\src\Unit\NgLightboxTest.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but
    | | found "\r\n"
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------

    SO moving to needs work.

  • Status changed to Needs work almost 2 years ago
  • @charchil-khandelwal opened merge request.
  • Issue was unassigned.
  • 🇮🇳India Charchil Khandelwal

    Some of the errors and warnings are fixed now.
    Created MR !7 for this issue.
    Please review.

    Thank you.

  • 🇧🇷Brazil lucienchalom

    @charchil thank you for opening a MR!, that helps on reviews a lot.
    please be careful with naming branches for a MR, the way it is now the branch 2.x already exists (because is the branch for this version) so git checkout -b '2.x' --track ng_lightbox-3152816/'2.x' cannot be applied.
    We need to use something like git checkout -b '3152816' --track ng_lightbox-3152816/'2.x' instead.

    Also, please don't break the line of a code in the README.md.
    That line is meant to help people just copy and past the code on their terminals, but with the line break, it will also break in the terminal and therefore, not work as expected.

  • 🇧🇷Brazil lucienchalom

    There is still one error to be fixed

    FILE: ...\modules\ng_lightbox\src\NgLightbox.php
    ----------------------------------------------------------------------
    FOUND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
    112 | WARNING | [ ] \Drupal calls should be avoided in classes, use
    | | dependency injection instead
    ----------------------------------------------------------------------
  • Assigned to elber
  • 🇧🇷Brazil elber Brazil

    I will try to fix it.

  • @elber opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇧🇷Brazil elber Brazil

    Hi I fixed the tests please revise.

  • 🇧🇷Brazil lucienchalom

    Te tests are passing and the DI was fixed. \o/

    The remaining cs of

    FILE: /.../modules/contrib/ng_lightbox/README.md
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------
     17 | WARNING | Line exceeds 80 characters; contains 87 characters
    ----------------------------------------------------------------------------------------------

    refers to
    compass compile --no-sourcemap --no-debug-info --force -e production sass/lightbox.scss
    that I consider that should stay this way,

    I just added Escaping Backticks to maintain as a code in the visualization and be shorter.
    =)

  • Assigned to elber
  • 🇧🇷Brazil elber Brazil

    I will review it.

  • Issue was unassigned.
  • Status changed to RTBC almost 2 years ago
  • 🇧🇷Brazil elber Brazil

    Hi coding standards has been fixed.

    Module keeps working as expected

    Test arent't breaking.

    Moving to RTBC.

  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • Status changed to Needs review almost 2 years ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update almost 2 years ago
    6 pass
  • 🇧🇷Brazil elber Brazil

    Hi I just fixed the characters limit. Please revise.

  • Status changed to RTBC almost 2 years ago
  • 🇧🇷Brazil elber Brazil

    Hi we can move to RTBC I ran Drupal phpcs command and it not exist anymore

    pcbf --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .
    
    No fixable errors were found
    
    Time: 152ms; Memory: 8MB
    

    Module keeps working as expected.

    PHPCS were fixed.

    Moving to RTBC.

  • Status changed to Needs review almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The person who provided the last patch or done the last commit in the MR cannot change the status to Reviewed & tested by the community.

  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +   * @param Symfony\Component\HttpFoundation\RequestStack $request
    +   *   The request method.

    That is not a method.

    -    // @TODO, decide whether we want to try and support paths or to adopt routes
    +    // @todo , decide whether we want to try and support paths or to adopt routes
    

    What follows @todo is a sentence: It starts with a capitalized word and ends with a period.
    The comma between @todo and the sentence is not used, either when there are spaces between @todo and the comma or not.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Also, if I run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig for the 2.x branch of the module, I get a slightly different report.

  • Assigned to elber
  • 🇧🇷Brazil elber Brazil

    HI I will see it.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update almost 2 years ago
    6 pass
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +   * @param Symfony\Component\HttpFoundation\RequestStack $request
    +   *   The request method.

    That is not a method.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update almost 2 years ago
    6 pass
  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work over 1 year ago
  • 🇧🇷Brazil lucienchalom

    runing phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig returns a clean terminal.

    at src/NgLightbox.php line 111

    -     // @TODO, decide whether we want to try and support paths or to adopt routes
    +    // @todo Decide whether we want to try and support paths or to adopt routes.

    but the full sentence is broke in two, the full sentence is

    // Decide whether we want to try and support paths or to adopt routes
    // like core is trying to force us into.
    

    so it should have a captalized word but leave the period only on the second line.

    everything else looks good to me,

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    6 pass
  • Status changed to RTBC over 1 year ago
  • 🇧🇷Brazil lucienchalom

    Thank you for the quick response.

    Everything looks good to me, moving to RTBC

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    6 pass
  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • 🇧🇷Brazil lucienchalom

    Fixed as requested.

    all phpcs clean.

  • Status changed to Closed: outdated 16 days ago
  • 🇺🇸United States dillix

    I fixed latest dev release in this issue: 📌 Fix Coding Standards for 2.x version Needs review

Production build 0.71.5 2024