Problem/Motivation
The following phpcs issues were reported on executing the command:
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /path/to/module
Reported Issues:
FILE: tests/src/Functional/DateTimeDayFieldTest.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\date_time_day\Plugin\Field\FieldType\DateTimeDayItem.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
FILE: src/DateDayComputed.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\TypedData\TypedData.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
FILE: src/DateTimeDayComputed.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\Core\Datetime\DrupalDateTime.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
FILE: src/Plugin/Field/FieldWidget/DateTimeDayWidgetBase.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\date_time_day\Plugin\Field\FieldType\DateTimeDayItem.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
FILE: src/Plugin/Field/FieldFormatter/DateTimeDayDefaultFormatter.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\date_time_day\DateTimeDayTrait.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------
Steps to reproduce
Proposed resolution
Run following command to fix the reported issues:
vendor/bin/phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /path/to/module
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
keshav patel commentedThe provided patch file "fix_coding_standards-3403330-2.patch" fixes the phpcs reported issues.
Comment #3
nikolay shapovalov commentedThanks, looks good.
Patch applied, all issues fixed.
Dear maintainer can you please release a dev version from the development branch 2.0.x?
Comment #4
andriy khomych commentedHey Nikolay, sure.
Comment #5
nikolay shapovalov commentedLooks like command I used, doesn't use phpcs.dist.xml provided by module.
I used:
And have some more issues to fix:
Or phpcs.dist.xml needs to be updated.
Comment #7
anjali mehta commentedComment #9
andriy khomych commentedFixed in the dev, however, I don't have time to check GitLab integration.
Nikolay, could you check if it works in the Gitlab integration issue https://www.drupal.org/project/date_time_day/issues/3410244?
Comment #10
andriy khomych commentedComment #11
nikolay shapovalov commentedAndriy thanks a lot for your time, I will fix few phpcs violation in the issue #3410244: Adopt GitlabCi.