This patch improves the organization of the use statements in the pathauto module files, adjusting them to comply with the coding standards recommended by Drupal. The goal is to ensure that dependencies are arranged logically and consistently, making the code easier to read and maintain.

Issue fork pathauto-3468241

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

andresalvarez created an issue. See original summary.

steinmb’s picture

Title: Coding Standards » Improve coding standards
Version: 8.x-1.13 » 8.x-1.x-dev
Assigned: andres alvarez » Unassigned
Category: Support request » Bug report
Status: Active » Needs review
Issue tags: -Coding standards
alyaj2a’s picture

Hi! I applied the patch but I still get Coding Standard errors.

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

FILE: .../web/modules/contrib/pathauto/src/Commands/PathautoCommands.php
-------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------
65 | ERROR | Doc comment short description must start with a capital letter
69 | ERROR | Parameter tags must be defined first in a doc comment
107 | ERROR | Parameter $options is not described in comment
112 | ERROR | Parameter tags must be defined first in a doc comment
170 | ERROR | Missing short description in doc comment
183 | ERROR | Missing short description in doc comment
197 | ERROR | Missing short description in doc comment
201 | ERROR | @throws tag comment must end with a full stop
216 | ERROR | Missing short description in doc comment
220 | ERROR | @throws tag comment must end with a full stop
-------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/Entity/PathautoPattern.php
----------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------
101 | ERROR | Missing short description in doc comment
127 | ERROR | Missing short description in doc comment
132 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/Form/PatternEditForm.php
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
25 | ERROR | Missing short description in doc comment
--------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/PathautoState.php
-------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------
30 | ERROR | Missing short description in doc comment
123 | ERROR | Description for the @return value is missing
-------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/PathautoGeneratorInterface.php
--------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------
13 | ERROR | Doc comment short description must start with a capital letter
13 | ERROR | Doc comment short description must end with a full stop
18 | ERROR | Doc comment short description must start with a capital letter
18 | ERROR | Doc comment short description must end with a full stop
23 | ERROR | Doc comment short description must start with a capital letter
23 | ERROR | Doc comment short description must end with a full stop
53 | ERROR | Description for the @return value is missing
81 | ERROR | Parameter comment must start with a capital letter
--------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/AliasUniquifier.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
105 | WARNING | Line exceeds 80 characters; contains 81 characters
---------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/AliasUniquifierInterface.php
------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
13 | WARNING | Line exceeds 80 characters; contains 81 characters
------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/PathautoPatternInterface.php
------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
------------------------------------------------------------------------------------------------
15 | ERROR | Description for the @return value is missing
22 | ERROR | Missing parameter comment
31 | ERROR | Description for the @return value is missing
35 | ERROR | Missing short description in doc comment
36 | ERROR | Description for the @return value is missing
43 | ERROR | Description for the @return value is missing
60 | ERROR | Description for the @return value is missing
128 | ERROR | Description for the @return value is missing
149 | ERROR | Description for the @return value is missing
174 | ERROR | Missing parameter type
177 | ERROR | Description for the @return value is missing
------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/PathautoWidget.php
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------
35 | WARNING | Line exceeds 80 characters; contains 144 characters
--------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php
----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
300 | ERROR | The text '@deprecated Use \Drupal\pathauto\PathautoState::bulkDelete() instead.' does not match
| | the standard format: @deprecated in %deprecation-version% and is removed from %removal-version%.
| | %extra-info%.
300 | ERROR | Each @deprecated tag must have a @see tag immediately following it
----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php
-------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------
23 | ERROR | Missing short description in doc comment
35 | ERROR | Missing short description in doc comment
-------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
16 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/PATCHES.txt
---------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------
1 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
5 | ERROR | [x] Expected 1 newline at end of file; 3 found
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: ...es/contrib/pathauto/tests/modules/pathauto_custom_punctuation_test/pathauto_custom_punctuation_test.module
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
3 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/Functional/PathautoEnablingEntityTypesTest.php
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
63 | ERROR | Doc comment short description must be on a single line, further text should be a separate
| | paragraph
----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/Functional/PathautoNodeWebTest.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------
184 | ERROR | Missing short description in doc comment
210 | WARNING | Line exceeds 80 characters; contains 92 characters
227 | WARNING | Line exceeds 80 characters; contains 81 characters
------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/Functional/PathautoBulkUpdateTest.php
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
75 | ERROR | Doc comment is empty
---------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/Kernel/PathautoTokenTest.php
------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------
23 | ERROR | Doc comment is empty
41 | WARNING | Line exceeds 80 characters; contains 81 characters
127 | ERROR | Doc comment is empty
------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
78 | ERROR | Parameter tags must be defined first in a doc comment
----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/FunctionalJavascript/PathautoUiTest.php
----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------
62 | ERROR | Doc comment is empty
75 | ERROR | Doc comment is empty
115 | WARNING | Line exceeds 80 characters; contains 97 characters
----------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/contrib/pathauto/tests/src/FunctionalJavascript/PathautoLocaleTest.php
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
45 | ERROR | Doc comment short description must be on a single line, further text should be a separate
| | paragraph
----------------------------------------------------------------------------------------------------------------

Time: 1.29 secs; Memory: 16MB

alyaj2a’s picture

steinmb’s picture

Status: Needs review » Needs work

Based on feedback in #4

andres alvarez’s picture

hello sorry I uploaded a test patch that I had and I will upload the updated one.

andres alvarez’s picture

StatusFileSize
new31.9 KB

i upload real patch adjusted

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

chaitanyadessai’s picture

Status: Needs work » Needs review
chaitanyadessai’s picture

Raised MR from #7 which fixes all code standard issue.

pilot3’s picture

I have applied the #7 patch and still see more errors:

FILE: ../docroot/modules/contrib/pathauto/tests/src/FunctionalJavascript/PathautoLocaleTest.php 
 31 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 65 | ERROR | The array declaration extends to column 102 (the limit is 80). The array content should be split up over multiple lines
 83 | ERROR | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
 87 | ERROR | The array declaration extends to column 120 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

and

FILE:./docroot/modules/contrib/pathauto/tests/src/Functional/PathautoSettingsFormWebTest.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
 224 | ERROR | Type hint "array" missing for $settings
-----------------------------------------------------------

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

andresalvarez changed the visibility of the branch 3468241-improve-coding-standards to hidden.

rajesh.vishwakarma made their first commit to this issue’s fork.

rajesh.vishwakarma’s picture

After reviewing the patch #7 it show below problems

FILE: /home/rajesh/Desktop/ddev-project/drupal-patches/pathauto/src/Plugin/migrate/source/PathautoPattern.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 41 | ERROR | [x] Parameter $migration has null default value, but is not marked as nullable.
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------


FILE: /home/rajesh/Desktop/ddev-project/drupal-patches/pathauto/src/Plugin/Action/UpdateAction.php
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
 31 | ERROR | [x] Parameter $account has null default value, but is not marked as nullable.
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------


FILE: /home/rajesh/Desktop/ddev-project/drupal-patches/pathauto/src/Commands/PathautoCommands.php
-------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------
  89 | ERROR | [x] Parameter $types has null default value, but is not marked as nullable.
 134 | ERROR | [x] Parameter $types has null default value, but is not marked as nullable.
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: /home/rajesh/Desktop/ddev-project/drupal-patches/pathauto/src/PathautoGenerator.php
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 139 | ERROR | [x] Parameter $alias_type_manager has null default value, but is not marked as nullable.
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------


FILE: /home/rajesh/Desktop/ddev-project/drupal-patches/pathauto/src/AliasStorageHelper.php
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 79 | ERROR | [x] Parameter $entity_type_manager has null default value, but is not marked as nullable.
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

Time: 486ms; Memory: 16MB

So I created new MR 101

andres alvarez’s picture

Hello,

Why, instead of creating a new PR, are we continuing to adjust PR 90, which is where we keep track of validity?

acbramley’s picture

mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Status: Fixed » Closed (fixed)