https://git.drupal.org/project/mobile_number.git 8.x-1.x

Primary tabs

Review of the 8.x-1.x branch (commit 21f576e):
  • Your README.txt does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 .
    • The CONFIGURATION section is missing.
  • The mobile_number.module does not implement hook_help(). See https://www.drupal.org/docs/develop/documenting-your-project/module-docu... .
  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: .../web/vendor/drupal/pareviewsh/pareview_temp/src/MobileNumberUtil.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------
     201 | WARNING | Unused variable $region.
     261 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     290 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     294 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     312 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     387 | WARNING | User::load calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: .../drupal/pareviewsh/pareview_temp/src/Tests/MobileNumberFieldTest.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     102 | WARNING | Unused variable $tries.
    --------------------------------------------------------------------------
    
    
    FILE: ...viewsh/pareview_temp/src/Plugin/Field/FieldType/MobileNumberItem.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
     426 | WARNING | Unused variable $input.
     428 | WARNING | Unused variable $field_label.
     431 | WARNING | Unused variable $entity_type.
    --------------------------------------------------------------------------
    
    
    FILE: ...c/Plugin/Field/FieldFormatter/MobileNumberInternationalFormatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------
     41 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     56 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     59 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     70 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...mp/src/Plugin/Field/FieldFormatter/MobileNumberVerifiedFormatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
     26 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     31 | WARNING | Unused variable $mobile_number.
     33 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     33 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
    --------------------------------------------------------------------------
    
    
    FILE: ...emp/src/Plugin/Field/FieldFormatter/MobileNumberCountryFormatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------
     38 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     39 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     56 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     57 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     70 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...sh/pareview_temp/src/Plugin/Field/FieldWidget/MobileNumberWidget.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES
    --------------------------------------------------------------------------
      33 | WARNING | Unused variable $util.
      51 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      54 | WARNING | Unused variable $entity.
      62 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
      65 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
      77 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
      80 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
      88 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
      90 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     117 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     126 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     129 | WARNING | Unused variable $country_options.
     154 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     197 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...areviewsh/pareview_temp/src/Plugin/TfaValidation/MobileNumberTfa.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------
     24 | WARNING | Class name must be prefixed with the project name
        |         | "MobileNumber.info"
     46 | WARNING | Variable $context is undefined.
     46 | WARNING | Variable $context is undefined.
     47 | WARNING | Variable $context is undefined.
     50 | WARNING | Variable $context is undefined.
     50 | WARNING | Variable $context is undefined.
     51 | WARNING | Variable $context is undefined.
     56 | WARNING | Variable $context is undefined.
    --------------------------------------------------------------------------
    
    Time: 1.95 secs; Memory: 8Mb
    
This automated report was generated with PAReview.sh, your friendly project application review script.

FILE: ...00000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/README.txt
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 40 | WARNING | Line exceeds 80 characters; contains 85 characters
--------------------------------------------------------------------------


FILE: .../web/vendor/drupal/pareviewsh/pareview_temp/src/MobileNumberUtil.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 261 | WARNING | Only string literals should be passed to t() where
     |         | possible
--------------------------------------------------------------------------


FILE: ...or/drupal/pareviewsh/pareview_temp/src/MobileNumberUtilInterface.php
--------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------
  70 | ERROR   | Type hint "array" missing for $types
  92 | ERROR   | Type hint "array" missing for $types
 153 | WARNING | Line exceeds 80 characters; contains 88 characters
 191 | WARNING | Line exceeds 80 characters; contains 82 characters
 198 | ERROR   | Type hint "array" missing for $filter
 230 | ERROR   | Type hint "array" missing for $token_data
 272 | WARNING | Line exceeds 80 characters; contains 119 characters
 315 | WARNING | Line exceeds 80 characters; contains 84 characters
--------------------------------------------------------------------------


FILE: ...view_temp/src/Plugin/Validation/Constraint/MobileNumberValidator.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 94 | WARNING | Only string literals should be passed to t() where
    |         | possible
--------------------------------------------------------------------------


FILE: ...iew_temp/src/Plugin/Validation/Constraint/MobileNumberConstraint.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 13 | ERROR | Doc comment short description must be on a single line,
    |       | further text should be a separate paragraph
--------------------------------------------------------------------------


FILE: ...viewsh/pareview_temp/src/Plugin/Field/FieldType/MobileNumberItem.php
--------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------
 298 | WARNING | Only string literals should be passed to t() where
     |         | possible
 368 | WARNING | Line exceeds 80 characters; contains 85 characters
 418 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
 456 | WARNING | Line exceeds 80 characters; contains 82 characters
 456 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
 489 | WARNING | Line exceeds 80 characters; contains 82 characters
 490 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
 548 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
--------------------------------------------------------------------------


FILE: ...areviewsh/pareview_temp/src/Plugin/TfaValidation/MobileNumberTfa.php
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
  92 | ERROR | If the line declaring an array spans longer than 80
     |       | characters, each element should be broken into its own
     |       | line
  96 | ERROR | If the line declaring an array spans longer than 80
     |       | characters, each element should be broken into its own
     |       | line
 169 | ERROR | If the line declaring an array spans longer than 80
     |       | characters, each element should be broken into its own
     |       | line
--------------------------------------------------------------------------


FILE: .../vendor/drupal/pareviewsh/pareview_temp/src/Element/MobileNumber.php
--------------------------------------------------------------------------
FOUND 9 ERRORS AND 3 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------
  68 | ERROR   | [ ] Type hint "array" missing for $element
  93 | ERROR   | [x] Whitespace found at end of line
  97 | ERROR   | [ ] Missing parameter type
  97 | ERROR   | [x] Tag value indented incorrectly; expected 1 space but
     |         |     found 2
 193 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 290 | ERROR   | [ ] Type hint "array" missing for $element
 290 | ERROR   | [ ] Type hint "array" missing for $complete_form
 388 | ERROR   | [ ] Type hint "array" missing for $complete_form
 456 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 513 | ERROR   | [ ] Type hint "array" missing for $element
 531 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 539 | ERROR   | [ ] Type hint "array" missing for $element
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/mobile_number.api.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 9 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------


FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/mobile_number.install
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 5 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------

Time: 3.66 secs; Memory: 12Mb