Problem/Motivation

Getting following error/warnings.

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

FILE: /var/www/html/modules/contrib/permission_spreadsheet/tests/src/Functional/FormTestBase.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
47 | ERROR | The array declaration extends to column 104 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

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

FILE: /var/www/html/modules/contrib/permission_spreadsheet/src/RoleLoaderTrait.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
23 | ERROR | [x] Expected "\Generator\Drupal\user\Entity\Role" but found "\Generator<\Drupal\user\Entity\Role>" for function return type
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/permission_spreadsheet/src/Form/ImportForm.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
105 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
142 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
144 | ERROR | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/permission_spreadsheet/src/PhpSpreadsheetHelperTrait.php
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
23 | ERROR | Type hint "\PhpOffice\PhpSpreadsheet\Spreadsheet" missing for $spreadsheet
--------------------------------------------------------------------------------------------

Time: 7.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/permission_spreadsheet/

Proposed resolution

Above error/warnings need to be fixed.

CommentFileSizeAuthor
#2 3342226-2.patch5.36 KBsamitk
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
new5.36 KB

Above error/warnings are fixed.

ranjit1032002’s picture

I had Reviewed the patch and it's working as expected mentioned in comment #2

ranjit1032002’s picture

Status: Needs review » Reviewed & tested by the community

urvashi_vora made their first commit to this issue’s fork.

urvashi_vora’s picture

Issue tags: -, -

Reviewed and Tested patch provided in #2.

urvasi@urvasi-Inspiron-15-3552:/var/www/html/contribution/drupal/web/modules/contrib/permission_spreadsheet-3342226$ git apply -v 3342226-2.patch
Checking patch src/Form/ImportForm.php...
Checking patch src/PhpSpreadsheetHelperTrait.php...
Checking patch src/RoleLoaderTrait.php...
Checking patch tests/src/Functional/ExportFormTest.php...
Checking patch tests/src/Functional/FormTestBase.php...
Checking patch tests/src/Functional/ImportFormTest.php...
Applied patch src/Form/ImportForm.php cleanly.
Applied patch src/PhpSpreadsheetHelperTrait.php cleanly.
Applied patch src/RoleLoaderTrait.php cleanly.
Applied patch tests/src/Functional/ExportFormTest.php cleanly.
Applied patch tests/src/Functional/FormTestBase.php cleanly.
Applied patch tests/src/Functional/ImportFormTest.php cleanly.

Applied smoothly, LGTM

RTBC++

Committing the changes to help the maintainers.

hayashi’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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