Problem/Motivation

After running the phpcs command on the module it gives the following warnings:
FILE: /app/modules/contrib/auctioneer/css/auction.form.css
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
21 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found
| | 2
22 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found
| | 2
75 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found
| | 2
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/auctioneer/src/Form/AuctionForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
18 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...p/modules/contrib/auctioneer/src/AuctionTypeManagerInterface.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
17 | WARNING | The class short comment should describe what the
| | class does and not simply repeat the class name
----------------------------------------------------------------------

FILE: ...ntrib/auctioneer/src/Plugin/Field/FieldType/AuctioneerNumber.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
96 | ERROR | The array declaration extends to column 145 (the limit
| | is 80). The array content should be split up over
| | multiple lines
----------------------------------------------------------------------

FILE: .../modules/contrib/auctioneer/src/AuctionFieldManagerInterface.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class
| | does and not simply repeat the class name
----------------------------------------------------------------------

FILE: ...modules/contrib/auctioneer/src/BidBundleAccessControlHandler.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
19 | WARNING | [x] '@TODO: Block deleting if it's marked as winner'
| | should match the format '@todo Fix problem X
| | here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/auctioneer/src/BidPermissions.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: /app/modules/contrib/auctioneer/src/AuctionTypeManager.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
245 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
259 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...e_range/src/Plugin/Auctioneer/AuctionType/AuctionTypeDefault.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 1
107 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
109 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
111 | ERROR | [ ] The array declaration extends to column 109 (the
| | limit is 80). The array content should be split
| | up over multiple lines
122 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
124 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
147 | ERROR | [x] list(...) is forbidden, use [...] instead.
147 | ERROR | [ ] The array declaration extends to column 97 (the
| | limit is 80). The array content should be split
| | up over multiple lines
----------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...s/auctioneer_datetime_range/src/Batch/CheckAuctionDatesBatch.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class
| | does and not simply repeat the class name
----------------------------------------------------------------------

FILE: ...uctioneer_sniper/src/Event/RequestAuctionLifetimeUpdateEvent.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
26 | ERROR | Missing @var tag in member variable comment
----------------------------------------------------------------------

FILE: .../modules/auctioneer_sniper/src/AuctionSniperManagerInterface.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the
| | class does and not simply repeat the class name
----------------------------------------------------------------------

FILE: ...ules/auctioneer_commerce/src/AuctionCommerceManagerInterface.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class
| | does and not simply repeat the class name
----------------------------------------------------------------------

FILE: ...uctioneer/modules/auctioneer_commerce/auctioneer_commerce.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
155 | ERROR | The array declaration extends to column 165 (the limit
| | is 80). The array content should be split up over
| | multiple lines
----------------------------------------------------------------------

Steps to reproduce

Run PHPCS command on module.

Proposed resolution

Change the code as per coding standards.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork auctioneer-3299862

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

Meeni_Dhobale created an issue. See original summary.

meeni_dhobale’s picture

StatusFileSize
new8.96 KB

Coding standards issues is solved.

meeni_dhobale’s picture

Assigned: meeni_dhobale » Unassigned
Status: Active » Needs review
jonas-gerosa361’s picture

StatusFileSize
new12.79 KB

Hi there, the patch looks good to me but if I ran the PHPCS I was still seeing some errors. Hope this patch solves it.

Kind regards,

waspper’s picture

Please, check patch against latest development codebase. I got some issues:

# More close lines as following.
error: patch failed: modules/auctioneer_sniper/auctioneer_sniper.info.yml:6
error: modules/auctioneer_sniper/auctioneer_sniper.info.yml: patch does not apply
Checking patch modules/auctioneer_sniper/src/AuctionSniperManagerInterface.php...
Checking patch modules/auctioneer_sniper/src/Event/RequestAuctionLifetimeUpdateEvent.php...
Checking patch src/AuctionFieldManagerInterface.php...
Checking patch src/AuctionTypeManager.php...
warning: src/AuctionTypeManager.php has type 100755, expected 100644
Checking patch src/AuctionTypeManagerInterface.php...
Checking patch src/BidBundleAccessControlHandler.php...
Checking patch src/BidPermissions.php...
Checking patch src/Form/AuctionForm.php...
Checking patch src/Plugin/Field/FieldType/AuctioneerNumber.php...
waspper’s picture

Status: Needs review » Needs work

jonas-gerosa361’s picture

Status: Needs work » Needs review

Hello, thanks for the input I created the PR https://git.drupalcode.org/project/auctioneer/-/merge_requests/1 appreciate reviewers.

Thanks!

waspper’s picture

Thanks @jonas-gerosa361 for contributing.

Tried to add your patch, but needed to fix/rebase. Can't merge. Can you check, please?

Checking patch css/auction.form.css...
Checking patch modules/auctioneer_commerce/auctioneer_commerce.module...
Checking patch modules/auctioneer_commerce/src/AuctionCommerceManagerInterface.php...
Checking patch modules/auctioneer_datetime_range/src/Batch/CheckAuctionDatesBatch.php...
Checking patch modules/auctioneer_datetime_range/src/Plugin/Auctioneer/AuctionType/AuctionTypeDefault.php...
Hunk #1 succeeded at 104 (offset 2 lines).
Hunk #2 succeeded at 122 (offset 2 lines).
Hunk #3 succeeded at 147 (offset 2 lines).
Checking patch modules/auctioneer_sniper/src/AuctionSniperManagerInterface.php...
Checking patch modules/auctioneer_sniper/src/Event/RequestAuctionLifetimeUpdateEvent.php...
Checking patch src/AuctionFieldManagerInterface.php...
Checking patch src/AuctionTypeManager.php...
Checking patch src/AuctionTypeManagerInterface.php...
Checking patch src/BidBundleAccessControlHandler.php...
Checking patch src/BidPermissions.php...
Checking patch src/Form/AuctionForm.php...
Checking patch src/Plugin/Field/FieldType/AuctioneerNumber.php...
error: while searching for:
        'number' => [
          'Length' => [
            'max' => $max_length,
            'maxMessage' => t('%field_label: may not be longer than @max digits.', ['%field_label' => $field_label, '@max' => $max_length]),
          ],
          'Regex' => [
            'pattern' => $regex_pattern,

error: patch failed: src/Plugin/Field/FieldType/AuctioneerNumber.php:91
error: src/Plugin/Field/FieldType/AuctioneerNumber.php: patch does not apply

Also, it would be useful to attach patch here, too.

waspper’s picture

Status: Needs review » Needs work
alanmoreira’s picture

Assigned: Unassigned » alanmoreira

I'll work on this =)

alanmoreira’s picture

Assigned: alanmoreira » Unassigned
Status: Needs work » Needs review
StatusFileSize
new696 bytes
new11.13 KB
new645 bytes

Tried to reroll the patch. There are still 3 phpcs warnings that I could not fix.

waspper’s picture

@alanmoreira Thanks for fixing. It works, but as I see in your PHPCS.txt, still pending a weird one telling about an unused variable. But that variable is of course being used. Can you check by changing:

// Line 149
if ($start_date instanceof DrupalDateTime && $end_date instanceof DrupalDateTime) {

By

// Line 149
if ($now_date instanceof DrupalDateTime && $start_date instanceof DrupalDateTime && $end_date instanceof DrupalDateTime) {

Maybe it could give a clue.

sourabhjain’s picture

Assigned: Unassigned » sourabhjain
Status: Needs review » Needs work

Let me check as suggested in #14

sourabhjain’s picture

StatusFileSize
new11.29 KB
new868 bytes
new101.44 KB

I have fixed the issue mentioned in #14.
Please review the changes.
Also checked the coding standard issues. Please check the attached Screenshot

sourabhjain’s picture

Assigned: sourabhjain » Unassigned
Status: Needs work » Needs review
alanmoreira’s picture

Assigned: Unassigned » alanmoreira

I'll review patch #16

alanmoreira’s picture

Assigned: alanmoreira » Unassigned
Status: Needs review » Reviewed & tested by the community

Patch #16 looks good. Solved all phpcs errors and warnings. Changing status to "RTBC" =)

  • waspper committed b77a57d on 1.0.x
    Issue #3299862 by jonas-gerosa361, alanmoreira, sourabhjain,...
waspper’s picture

Reviewed and commited to the latest development release. Thank you guys for your help.

waspper’s picture

Status: Reviewed & tested by the community » Fixed
waspper’s picture

Status: Fixed » Closed (fixed)