Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/intl_date/intl_date.services.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/intl_date.api.php
------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
29 | ERROR | [x] Doc comment long description must end with a full stop
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/intl_date.module
-----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------
12 | WARNING | [x] The variable name should be defined after the type
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
14 | WARNING | Line exceeds 80 characters; contains 102 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/src/Form/DateFormatDeleteForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/src/Form/DateFormatAddForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
19 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/src/Form/DateFormatEditForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
19 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/src/TwigExtension.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
23 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/src/Plugin/Field/FieldFormatter/IntlDateTimeDefaultFormatter.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
67 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/intl_date/src/IntlDateFormatListBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
20 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

Time: 4.9 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/intl_date/

Proposed resolution

Above error/warnings need to be fixed.

CommentFileSizeAuthor
#2 3346861-2.patch9.47 KBsamitk

Issue fork intl_date-3346861

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

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.47 KB

Above error/warnings has been fixed.

hardikpandya’s picture

Version: 1.1.1 » 1.0.x-dev
Status: Needs review » Reviewed & tested by the community

The patch fixes all phpcs issues reported in the issue. Marking RTBC!

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
Issue tags: -, -Phpcs Drupal coding standard issue
avpaderno’s picture

Priority: Normal » Minor

  • Aron Novak committed a46e3288 on 1.0.x
    Issue #3346861 by samit.310@gmail.com: Fix the issues reported by phpcs
    
aron novak’s picture

Partially addressed, thanks!

aron novak’s picture

I am happy to merge a MR, there are some conflicts actually.

aron novak’s picture

Status: Reviewed & tested by the community » Needs work

zniki.ru made their first commit to this issue’s fork.

nikolay shapovalov’s picture

Status: Needs work » Needs review

MR is ready for review.

I am confused, there are 2 module versions:

  • 1.0.x
  • 1.1.x

but dev branch 1.0.x is still using for latest 1.1.1.
I think it should be 2 dev branches

  • 1.0.x for 1.0.1
  • 1.1.x for 1.1.1

nikolay shapovalov’s picture

Status: Needs review » Fixed

@Aron Novak thanks a lot for merging these code changes to the code base.
Can we set issue status to Fixed?
Can you please check credits for this issue?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture