Problem/Motivation

FILE: ...one-number/web/modules/contrib/phone_number/modules/sms_phone_number/src/Plugin/TfaValidation/SmsPhoneNumberTfa.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
  16 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
     |       |     Drupal\tfa\Plugin\TfaSendInterface.
 204 | ERROR | [ ] The array declaration extends to column 124 (the limit is 80). The array content should be split up
     |       |     over multiple lines
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...-number/web/modules/contrib/phone_number/modules/sms_phone_number/src/Plugin/Field/FieldType/SmsPhoneNumberItem.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
   7 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is
     |         |     Drupal\Core\Form\FormStateInterface.
 238 | WARNING | [ ] Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...s/contrib/phone_number/modules/sms_phone_number/src/Plugin/Field/FieldFormatter/SmsPhoneNumberVerifiedFormatter.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
   |       |     Drupal\Core\Field\FieldItemListInterface.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: .../modules/contrib/phone_number/modules/sms_phone_number/src/Plugin/rest/resource/RequestVerificationCodeResource.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\rest\Plugin\ResourceBase.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...modules/contrib/phone_number/modules/sms_phone_number/src/Plugin/Validation/Constraint/SmsPhoneNumberConstraint.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------
 24 | ERROR | Missing member variable doc comment
 25 | ERROR | Missing member variable doc comment
 26 | ERROR | Missing member variable doc comment
-------------------------------------------------------------------------------------------------------------------------


FILE: .../modules/contrib/phone_number/modules/sms_phone_number/src/Plugin/Validation/Constraint/SmsPhoneNumberValidator.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 131 | WARNING | Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------------------------------------------------


FILE: ...ects/drupal10-phone-number/web/modules/contrib/phone_number/modules/sms_phone_number/src/Element/SmsPhoneNumber.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
   |       |     Drupal\phone_number\Exception\PhoneNumberException.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...projects/drupal10-phone-number/web/modules/contrib/phone_number/modules/sms_phone_number/src/SmsPhoneNumberUtil.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is
    |         |     Drupal\Core\Flood\FloodInterface.
 13 | WARNING | [x] Unused use statement
 95 | WARNING | [ ] Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/timdiels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/PhoneNumberUtilInterface.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 115 | ERROR | Public method name "PhoneNumberUtilInterface::getRFC3966uri" is not in lowerCamel format
----------------------------------------------------------------------------------------------------------------------


FILE: .../timdiels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/Plugin/WebformElement/PhoneNumber.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 158 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: .../projects/drupal10-phone-number/web/modules/contrib/phone_number/src/Plugin/Field/FieldWidget/PhoneNumberWidget.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------
  92 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 108 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 141 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 142 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...iels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/Plugin/Field/FieldType/PhoneNumberItem.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemBase.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...phone-number/web/modules/contrib/phone_number/src/Plugin/Field/FieldFormatter/PhoneNumberInternationalFormatter.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
  7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
    |       |     Drupal\Core\Field\FieldItemListInterface.
 28 | ERROR | [ ] Missing member variable doc comment
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...pal10-phone-number/web/modules/contrib/phone_number/src/Plugin/Field/FieldFormatter/PhoneNumberCountryFormatter.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
   |       |     Drupal\Core\Field\FieldItemListInterface.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: ...rupal10-phone-number/web/modules/contrib/phone_number/src/Plugin/Field/FieldFormatter/PhoneNumberLocalFormatter.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 21 | ERROR | Missing member variable doc comment
-------------------------------------------------------------------------------------------------------------------------


FILE: ...s/drupal10-phone-number/web/modules/contrib/phone_number/src/Plugin/Validation/Constraint/PhoneNumberConstraint.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------
 22 | ERROR | Missing member variable doc comment
 23 | ERROR | Missing member variable doc comment
 24 | ERROR | Missing member variable doc comment
-------------------------------------------------------------------------------------------------------------------------


FILE: ...ts/drupal10-phone-number/web/modules/contrib/phone_number/src/Plugin/Validation/Constraint/PhoneNumberValidator.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 91 | WARNING | Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/timdiels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/Element/PhoneNumber.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
   9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is
     |         |     Drupal\Core\Render\Element\FormElement.
 174 | WARNING | [ ] Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: /Users/timdiels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/PhoneNumberUtil.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------
   7 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is libphonenumber\PhoneNumber.
 159 | ERROR   | [ ] Public method name "PhoneNumberUtil::getRFC3966uri" is not in lowerCamel format
 339 | WARNING | [ ] Only string literals should be passed to t() where possible
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: /Users/timdiels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/Exception/CountryException.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 5 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: /Users/timdiels/projects/drupal10-phone-number/web/modules/contrib/phone_number/src/Exception/TypeException.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
 5 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

roshni27 created an issue. See original summary.

roshni27’s picture

Issue tags: +Coding standards
roshni27’s picture

I am working on it.

roshni27’s picture

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

i have fixed some issues and some issues are remain which maintainer know there functionality much better ,please review MR.

tim-diels’s picture

Status: Needs review » Postponed (maintainer needs more info)

The 1.x branch is not supported anymore. Did you try to check the 2.x branch for this issue?

tim-diels’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Postponed (maintainer needs more info) » Needs work

I see the issue is also there for the 2.x branch. Could you please create MR for the 2.x branch? And also specify what is fixed and what not?

tim-diels’s picture

Issue summary: View changes

Updated the report after changing to the 2.x branch.

tim-diels’s picture

Status: Needs work » Needs review

@roshni27 As I'm not getting any feedback and I see some wrongly changed lines, I'm not going to credit you at this moment. Please feel free to react if you feel you are not handled correctly.

  • tim-diels committed bbff3b61 on 2.0.x authored by roshni27
    Issue #3372822 by tim-diels: Fix the warnings/errors reported by...
tim-diels’s picture

Status: Needs review » Fixed
tim-diels’s picture

Issue tags: +ddd2023
tim-diels’s picture

Status: Fixed » Closed (fixed)