Problem/Motivation

Fix phpcs errors:

  • Drupal.Classes.UnusedUseStatement
  • DrupalPractice.FunctionCalls.InsecureUnserialize
  • SlevomatCodingStandard.PHP.ShortList
  • Drupal.Semantics.FunctionT

Command

phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme modules/custom/pathauto/ --sniffs="Drupal.Classes.UnusedUseStatement,DrupalPractice.FunctionCalls.InsecureUnserialize,SlevomatCodingStandard.PHP.ShortList,Drupal.Semantics.FunctionT" -s

Result

FILE: tests/src/Functional/PathautoBulkUpdateTest.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement (Drupal.Classes.UnusedUseStatement.UnusedUse)
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------


FILE: tests/src/FunctionalJavascript/PathautoUiTest.php
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement (Drupal.Classes.UnusedUseStatement.UnusedUse)
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------


FILE: pathauto.module
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
 168 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
     |         | (Drupal.Semantics.FunctionT.BackslashSingleQuote)
-----------------------------------------------------------------------------


FILE: pathauto.install
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
 137 | ERROR | [x] list(...) is forbidden, use [...] instead.
     |       |     (SlevomatCodingStandard.PHP.ShortList.LongListUsed)
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------


FILE: src/Entity/PathautoPattern.php
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
 418 | ERROR | [x] list(...) is forbidden, use [...] instead.
     |       |     (SlevomatCodingStandard.PHP.ShortList.LongListUsed)
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------


FILE: src/Plugin/migrate/source/PathautoPattern.php
-------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------
  98 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
     |       | (DrupalPractice.FunctionCalls.InsecureUnserialize.InsecureUnserialize)
 117 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
     |       | (DrupalPractice.FunctionCalls.InsecureUnserialize.InsecureUnserialize)
-------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork pathauto-3411804

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nikolay Shapovalov created an issue. See original summary.

Nikolay Shapovalov’s picture

Status: Active » Needs review

Ready for review.

Nikolay Shapovalov’s picture

Issue summary: View changes
Nikolay Shapovalov’s picture

Update MR, add phpcs.xml file and exclude rules that will be fixed in different issues.
Gitlab CI check phpcs passed.

Nikolay Shapovalov’s picture

Issue summary: View changes

Update IS

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

Berdir’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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