Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sonam_sharma created an issue. See original summary.

sonam_sharma’s picture

StatusFileSize
new847 bytes
avpaderno’s picture

Title: unused use statements » Fix the warnings/errors reported by PHP_CodeSniffer
Assigned: sonam_sharma » Unassigned
Issue tags: +Coding standards, +Needs issue summary update, +Needs issue rescope, +Needs reroll

Since the issue is showing what PHP_CodeSniffer shows, let us rescope it to fix all the warnings/errors reported by PHP_CodeSniffer.

The issue summary should always describe what the issue is trying to fix and, in the case of coding standards issues, show which command and arguments have been used and which report that command shown. In this way, project maintainers can verify the patch/MR fixes all the warnings/errors.

immaculatexavier’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Updated issue summary.

immaculatexavier’s picture

Issue summary: View changes

Updated issue summary.

immaculatexavier’s picture

Issue summary: View changes

Updated issue summary.

immaculatexavier’s picture

Issue summary: View changes

This summary provides a clear overview of the issue, the affected files, steps to reproduce, and the proposed resolution. Hope this helps !!!

kalash-j made their first commit to this issue’s fork.

kalash-j’s picture

Status: Active » Needs review
StatusFileSize
new96.15 KB

hello , i have solved all the issues that PHPCS has shown.
MR!2 have 0 PHPCS error please check.

clarkssquared’s picture

Status: Needs review » Reviewed & tested by the community

Hi

I applied the updated MR !2 and I followed the steps to reproduce and confirmed that the PHPCS issues are now resolved:

➜  contrib git:(master) ✗ phpcs --standard=Drupal --extensions=php,module,inc,install,info,txt,md multi_region 

FILE: ...local/web/modules/contrib/multi_region/src/Form/ConfigurableRegionForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | WARNING | The class short comment should describe what the class does and
    |         | not simply repeat the class name
--------------------------------------------------------------------------------


FILE: ...ules/contrib/multi_region/src/Plugin/Block/RegionLanguageSwitcherBlock.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Access\AccessResult.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...b/modules/contrib/multi_region/src/ConfigurableRegionHtmlRouteProvider.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 19 | WARNING | Possible useless method overriding detected
--------------------------------------------------------------------------------


FILE: ...odules/contrib/multi_region/src/ConfigurableRegionAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Access\AccessResult.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...cal/web/modules/contrib/multi_region/src/ConfigurableRegionListBuilder.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...rojects/d9/d9-local/web/modules/contrib/multi_region/src/RegionManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
   8 | WARNING | [x] Unused use statement
 129 | ERROR   | [x] Object operator not indented correctly; expected 8 spaces
     |         |     but found 10
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 157ms; Memory: 8MB

➜  contrib git:(master) ✗ cd multi_region 
➜  multi_region git:(master) ✗ curl https://git.drupalcode.org/project/multi_region/-/merge_requests/2.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10218    0 10218    0     0  19688      0 --:--:-- --:--:-- --:--:-- 19918
patching file 'src/ConfigurableRegionAccessControlHandler.php'
patching file 'src/ConfigurableRegionHtmlRouteProvider.php'
patching file 'src/ConfigurableRegionListBuilder.php'
patching file 'src/Form/ConfigurableRegionForm.php'
patching file 'src/Plugin/Block/RegionLanguageSwitcherBlock.php'
patching file 'src/RegionManager.php'
➜  multi_region git:(master) ✗ ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal --extensions=php,module,inc,install,info,txt,md multi_region
➜  contrib git:(master) ✗ 
avpaderno’s picture

Category: Bug report » Task
Issue tags: -Needs issue rescope, -Needs reroll
avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
kalash-j’s picture

Status: Needs work » Needs review

@apaderno i have done the changes on the feedback you have provided

tirupati_singh’s picture

Status: Needs review » Reviewed & tested by the community

Hi, I've applied the MR!2 as patch and it applied successfully with no errors. After applying patch all the mentioned phpcs errors has been resolved successfully. Hence, moving the issue status to Reviewed and tested.

avpaderno changed the visibility of the branch multi_region-3370016-3370016-fix-issues-by-phpcs to hidden.

avpaderno’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

avpaderno changed the visibility of the branch 3370016-gitlab-ci-reports to hidden.

avpaderno’s picture

Status: Needs work » Needs review

avpaderno changed the visibility of the branch 3370016-fix-issues-by-phpcs to hidden.

avpaderno’s picture

avpaderno’s picture

roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community

Hi,

I reviewed the PHPCS in the GitLab CI pipeline and confirmed that the errors are no longer exist.
Here is the link for reference:
PHPCS: https://git.drupalcode.org/issue/multi_region-3370016/-/jobs/8377040

I'm moving this now to "RTBC".

Thank you!

isaacrc made their first commit to this issue’s fork.

  • isaacrc committed dd510d76 on 2.0.x authored by avpaderno
    Issue #3370016: Fix the warnings/errors reported by PHP_CodeSniffer
    
isaacrc’s picture

Status: Reviewed & tested by the community » Fixed

Fixed and merged into the 2.0.0 release. Thanks, everyone!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

isaacrc’s picture

Status: Fixed » Closed (fixed)