Fix the issues reported by phpcs

Created on 13 April 2023, over 1 year ago
Updated 7 June 2024, 7 months ago

Cammand and arguments use is:-
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/custom/locale_extend

Problem/Motivation

FILE: ...www/html/contribution/drupal10/web/modules/contrib/locale_extend/README.md
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
59 | WARNING | Line exceeds 80 characters; contains 90 characters
63 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------------

FILE: ...odules/contrib/locale_extend/tests/src/Kernel/ExtendedLocaleStringTest.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AND 4 WARNINGS AFFECTING 19 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
12 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
25 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 'locale_extend'
51 | ERROR | [ ] The array declaration extends to column 96 (the limit is
| | 80). The array content should be split up over multiple
| | lines
53 | ERROR | [ ] The array declaration extends to column 92 (the limit is
| | 80). The array content should be split up over multiple
| | lines
65 | ERROR | [ ] The array declaration extends to column 99 (the limit is
| | 80). The array content should be split up over multiple
| | lines
68 | ERROR | [ ] The array declaration extends to column 128 (the limit is
| | 80). The array content should be split up over multiple
| | lines
73 | ERROR | [ ] The array declaration extends to column 99 (the limit is
| | 80). The array content should be split up over multiple
| | lines
93 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
97 | ERROR | [ ] The array declaration extends to column 118 (the limit is
| | 80). The array content should be split up over multiple
| | lines
98 | WARNING | [ ] Unused variable $source2.
98 | ERROR | [ ] The array declaration extends to column 118 (the limit is
| | 80). The array content should be split up over multiple
| | lines
100 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
120 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
124 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
126 | ERROR | [ ] The array declaration extends to column 132 (the limit is
| | 80). The array content should be split up over multiple
| | lines
134 | ERROR | [ ] The array declaration extends to column 132 (the limit is
| | 80). The array content should be split up over multiple
| | lines
146 | ERROR | [ ] The array declaration extends to column 94 (the limit is
| | 80). The array content should be split up over multiple
| | lines
151 | ERROR | [x] Expected 1 space before "*"; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...10/web/modules/contrib/locale_extend/tests/src/Kernel/LocaleStringTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
9 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
20 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
21 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
22 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
36 | WARNING | [ ] Possible useless method overriding detected
43 | WARNING | [ ] Possible useless method overriding detected
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...les/contrib/locale_extend/tests/src/Kernel/LocaleExtendKernelTestTrait.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 5 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
13 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
17 | ERROR | [x] Expected 1 space after trait name; 2 found
17 | ERROR | [x] Expected 1 space before opening brace; found 2
28 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ontribution/drupal10/web/modules/contrib/locale_extend/src/Translation.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AND 3 WARNINGS AFFECTING 16 LINES
--------------------------------------------------------------------------------
22 | WARNING | [ ] Line exceeds 80 characters; contains 105 characters
33 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
43 | ERROR | [x] Do not append variable name "$source_langcode" to the type
| | declaration in a member variable comment
45 | ERROR | [ ] Class property $source_langcode should use lowerCamel
| | naming without underscores
72 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4
| | spaces
72 | ERROR | [x] Parameter comment must end with a full stop
86 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4
| | spaces
86 | ERROR | [x] Parameter comment must end with a full stop
92 | ERROR | [x] Trailing punctuation for @see references is not allowed.
123 | ERROR | [x] Doc comment short description must end with a full stop
165 | WARNING | [ ] Only string literals should be passed to t() where
| | possible
178 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
179 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
180 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
181 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
183 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
184 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
185 | ERROR | [x] Expected 1 newline at end of file; 0 found
185 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../drupal10/web/modules/contrib/locale_extend/src/StringTranslationTrait.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
39 | ERROR | Class property $source_langcode should use lowerCamel naming
| | without underscores
46 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

FILE: ...odules/contrib/locale_extend/src/Service/ExtendedStringDatabaseStorage.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
33 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but
| | found 4
34 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
63 | ERROR | [ ] Type hint "\Drupal\locale\StringInterface" missing for
| | $string
70 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80).
| | The array content should be split up over multiple lines
95 | ERROR | [ ] Type hint "\Drupal\locale\StringInterface" missing for
| | $string
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...eb/modules/contrib/locale_extend/src/Service/ExtendedLocaleTranslation.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
25 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
65 | ERROR | [x] Expected 1 blank line after function; 0 found
66 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../modules/contrib/locale_extend/src/Service/ExtendedTranslatorInterface.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
15 | ERROR | [x] Doc comment short description must end with a full stop
35 | ERROR | [ ] Missing parameter comment
36 | ERROR | [ ] Missing parameter comment
38 | ERROR | [x] Expected "bool" but found "boolean" for function return type
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...pal10/web/modules/contrib/locale_extend/src/Service/TranslationManager.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
35 | WARNING | Line exceeds 80 characters; contains 91 characters
--------------------------------------------------------------------------------

FILE: ...l10/web/modules/contrib/locale_extend/src/Service/ExtendedLocaleLookup.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
24 | ERROR | Class property $source_langcode should use lowerCamel naming
| | without underscores
112 | ERROR | The array declaration extends to column 147 (the limit is 80).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

FILE: ...drupal10/web/modules/contrib/locale_extend/src/Routing/RouteSubscriber.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
16 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
18 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
19 | ERROR | [x] Array indentation error, expected 12 spaces but found 14
20 | ERROR | [x] Array indentation error, expected 12 spaces but found 14
25 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../contribution/drupal10/web/modules/contrib/locale_extend/src/Translate.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
19 | ERROR | [x] Additional blank lines found at end of doc comment
26 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4
| | spaces
26 | ERROR | [x] Parameter comment must end with a full stop
30 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
40 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
53 | WARNING | [ ] Only string literals should be passed to t() where possible
63 | ERROR | [ ] Parameter tags must be defined first in a doc comment
64 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4
| | spaces
64 | ERROR | [x] Parameter comment must end with a full stop
74 | ERROR | [x] Doc comment short description must end with a full stop
86 | ERROR | [x] Expected 1 newline at end of file; 0 found
86 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...al10/web/modules/contrib/locale_extend/src/LocaleExtendServiceProvider.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
13 | ERROR | [x] Missing function doc comment
14 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
17 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...rupal10/web/modules/contrib/locale_extend/src/Form/TranslateFilterForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
17 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../drupal10/web/modules/contrib/locale_extend/src/Form/TranslateEditForm.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
109 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
110 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
111 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
112 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...drupal10/web/modules/contrib/locale_extend/src/Form/TranslateFormTrait.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 6 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
35 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
36 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
37 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
44 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
57 | ERROR | [ ] The array declaration extends to column 82 (the limit is
| | 80). The array content should be split up over multiple
| | lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...tribution/drupal10/web/modules/contrib/locale_extend/locale_extend.install
--------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
4 | ERROR | [x] Doc comment short description must end with a full stop
21 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
22 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
23 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
24 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
25 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
28 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../contribution/drupal10/web/modules/contrib/locale_extend/modules/README.md
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
32 | ERROR | [x] Expected 1 newline at end of file; 4 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...les/contrib/locale_extend/modules/locale_extend_ns/locale_extend_ns.module
--------------------------------------------------------------------------------
FOUND 178 ERRORS AFFECTING 68 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] The second line in the file doc comment must be "@file"
3 | ERROR | [x] Doc comment short description must end with a full stop
14 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
15 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
16 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
17 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
18 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
19 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
20 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
21 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
22 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
23 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
24 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
25 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
26 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
27 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
28 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
29 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
30 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
31 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
32 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
33 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
34 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
35 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
38 | ERROR | [x] There must be one blank line after the namespace declaration
39 | ERROR | [x] Missing function doc comment
39 | ERROR | [x] Expected 1 blank line before function; 0 found
39 | ERROR | [x] Opening brace must be the last content on the line
39 | ERROR | [x] There should be no white space after an opening "{"
39 | ERROR | [x] Closing brace must be on a line by itself
39 | ERROR | [x] Expected 1 blank line after function; 0 found
41 | ERROR | [x] There must be one blank line after the namespace declaration
42 | ERROR | [x] Missing function doc comment
42 | ERROR | [x] Expected 1 blank line before function; 0 found
42 | ERROR | [x] Opening brace must be the last content on the line
42 | ERROR | [x] There should be no white space after an opening "{"
42 | ERROR | [x] Closing brace must be on a line by itself
42 | ERROR | [x] Expected 1 blank line after function; 0 found
44 | ERROR | [x] There must be one blank line after the namespace declaration
45 | ERROR | [x] Missing function doc comment
45 | ERROR | [x] Expected 1 blank line before function; 0 found
45 | ERROR | [x] Opening brace must be the last content on the line
45 | ERROR | [x] There should be no white space after an opening "{"
45 | ERROR | [x] Closing brace must be on a line by itself
45 | ERROR | [x] Expected 1 blank line after function; 0 found
47 | ERROR | [x] There must be one blank line after the namespace declaration
48 | ERROR | [x] Missing function doc comment
48 | ERROR | [x] Expected 1 blank line before function; 0 found
48 | ERROR | [x] Opening brace must be the last content on the line
48 | ERROR | [x] There should be no white space after an opening "{"
48 | ERROR | [x] Closing brace must be on a line by itself
48 | ERROR | [x] Expected 1 blank line after function; 0 found
50 | ERROR | [x] There must be one blank line after the namespace declaration
51 | ERROR | [x] Missing function doc comment
51 | ERROR | [x] Expected 1 blank line before function; 0 found
51 | ERROR | [x] Opening brace must be the last content on the line
51 | ERROR | [x] There should be no white space after an opening "{"
51 | ERROR | [x] Closing brace must be on a line by itself
51 | ERROR | [x] Expected 1 blank line after function; 0 found
53 | ERROR | [x] There must be one blank line after the namespace declaration
54 | ERROR | [x] Missing function doc comment
54 | ERROR | [x] Expected 1 blank line before function; 0 found
54 | ERROR | [x] Opening brace must be the last content on the line
54 | ERROR | [x] There should be no white space after an opening "{"
54 | ERROR | [x] Closing brace must be on a line by itself
54 | ERROR | [x] Expected 1 blank line after function; 0 found
56 | ERROR | [x] There must be one blank line after the namespace declaration
57 | ERROR | [x] Missing function doc comment
57 | ERROR | [x] Expected 1 blank line before function; 0 found
57 | ERROR | [x] Opening brace must be the last content on the line
57 | ERROR | [x] There should be no white space after an opening "{"
57 | ERROR | [x] Closing brace must be on a line by itself
57 | ERROR | [x] Expected 1 blank line after function; 0 found
59 | ERROR | [x] There must be one blank line after the namespace declaration
60 | ERROR | [x] Missing function doc comment
60 | ERROR | [x] Expected 1 blank line before function; 0 found
60 | ERROR | [x] Opening brace must be the last content on the line
60 | ERROR | [x] There should be no white space after an opening "{"
60 | ERROR | [x] Closing brace must be on a line by itself
60 | ERROR | [x] Expected 1 blank line after function; 0 found
62 | ERROR | [x] There must be one blank line after the namespace declaration
63 | ERROR | [x] Missing function doc comment
63 | ERROR | [x] Expected 1 blank line before function; 0 found
63 | ERROR | [x] Opening brace must be the last content on the line
63 | ERROR | [x] There should be no white space after an opening "{"
63 | ERROR | [x] Closing brace must be on a line by itself
63 | ERROR | [x] Expected 1 blank line after function; 0 found
65 | ERROR | [x] There must be one blank line after the namespace declaration
66 | ERROR | [x] Missing function doc comment
66 | ERROR | [x] Expected 1 blank line before function; 0 found
66 | ERROR | [x] Opening brace must be the last content on the line
66 | ERROR | [x] There should be no white space after an opening "{"
66 | ERROR | [x] Closing brace must be on a line by itself
66 | ERROR | [x] Expected 1 blank line after function; 0 found
68 | ERROR | [x] There must be one blank line after the namespace declaration
69 | ERROR | [x] Missing function doc comment
69 | ERROR | [x] Expected 1 blank line before function; 0 found
69 | ERROR | [x] Opening brace must be the last content on the line
69 | ERROR | [x] There should be no white space after an opening "{"
69 | ERROR | [x] Closing brace must be on a line by itself
69 | ERROR | [x] Expected 1 blank line after function; 0 found
71 | ERROR | [x] There must be one blank line after the namespace declaration
72 | ERROR | [x] Missing function doc comment
72 | ERROR | [x] Expected 1 blank line before function; 0 found
72 | ERROR | [x] Opening brace must be the last content on the line
72 | ERROR | [x] There should be no white space after an opening "{"
72 | ERROR | [x] Closing brace must be on a line by itself
72 | ERROR | [x] Expected 1 blank line after function; 0 found
74 | ERROR | [x] There must be one blank line after the namespace declaration
75 | ERROR | [x] Missing function doc comment
75 | ERROR | [x] Expected 1 blank line before function; 0 found
75 | ERROR | [x] Opening brace must be the last content on the line
75 | ERROR | [x] There should be no white space after an opening "{"
75 | ERROR | [x] Closing brace must be on a line by itself
75 | ERROR | [x] Expected 1 blank line after function; 0 found
77 | ERROR | [x] There must be one blank line after the namespace declaration
78 | ERROR | [x] Missing function doc comment
78 | ERROR | [x] Expected 1 blank line before function; 0 found
78 | ERROR | [x] Opening brace must be the last content on the line
78 | ERROR | [x] There should be no white space after an opening "{"
78 | ERROR | [x] Closing brace must be on a line by itself
78 | ERROR | [x] Expected 1 blank line after function; 0 found
80 | ERROR | [x] There must be one blank line after the namespace declaration
81 | ERROR | [x] Missing function doc comment
81 | ERROR | [x] Expected 1 blank line before function; 0 found
81 | ERROR | [x] Opening brace must be the last content on the line
81 | ERROR | [x] There should be no white space after an opening "{"
81 | ERROR | [x] Closing brace must be on a line by itself
81 | ERROR | [x] Expected 1 blank line after function; 0 found
83 | ERROR | [x] There must be one blank line after the namespace declaration
84 | ERROR | [x] Missing function doc comment
84 | ERROR | [x] Expected 1 blank line before function; 0 found
84 | ERROR | [x] Opening brace must be the last content on the line
84 | ERROR | [x] There should be no white space after an opening "{"
84 | ERROR | [x] Closing brace must be on a line by itself
84 | ERROR | [x] Expected 1 blank line after function; 0 found
86 | ERROR | [x] There must be one blank line after the namespace declaration
87 | ERROR | [x] Missing function doc comment
87 | ERROR | [x] Expected 1 blank line before function; 0 found
87 | ERROR | [x] Opening brace must be the last content on the line
87 | ERROR | [x] There should be no white space after an opening "{"
87 | ERROR | [x] Closing brace must be on a line by itself
87 | ERROR | [x] Expected 1 blank line after function; 0 found
89 | ERROR | [x] There must be one blank line after the namespace declaration
90 | ERROR | [x] Missing function doc comment
90 | ERROR | [x] Expected 1 blank line before function; 0 found
90 | ERROR | [x] Opening brace must be the last content on the line
90 | ERROR | [x] There should be no white space after an opening "{"
90 | ERROR | [x] Closing brace must be on a line by itself
90 | ERROR | [x] Expected 1 blank line after function; 0 found
92 | ERROR | [x] There must be one blank line after the namespace declaration
93 | ERROR | [x] Missing function doc comment
93 | ERROR | [x] Expected 1 blank line before function; 0 found
93 | ERROR | [x] Opening brace must be the last content on the line
93 | ERROR | [x] There should be no white space after an opening "{"
93 | ERROR | [x] Closing brace must be on a line by itself
93 | ERROR | [x] Expected 1 blank line after function; 0 found
95 | ERROR | [x] There must be one blank line after the namespace declaration
96 | ERROR | [x] Missing function doc comment
96 | ERROR | [x] Expected 1 blank line before function; 0 found
96 | ERROR | [x] Opening brace must be the last content on the line
96 | ERROR | [x] There should be no white space after an opening "{"
96 | ERROR | [x] Closing brace must be on a line by itself
96 | ERROR | [x] Expected 1 blank line after function; 0 found
98 | ERROR | [x] There must be one blank line after the namespace declaration
99 | ERROR | [x] Missing function doc comment
99 | ERROR | [x] Expected 1 blank line before function; 0 found
99 | ERROR | [x] Opening brace must be the last content on the line
99 | ERROR | [x] There should be no white space after an opening "{"
99 | ERROR | [x] Closing brace must be on a line by itself
99 | ERROR | [x] Expected 1 blank line after function; 0 found
102 | ERROR | [x] Missing function doc comment
102 | ERROR | [x] Expected 1 blank line before function; 0 found
102 | ERROR | [x] Opening brace must be the last content on the line
102 | ERROR | [x] There should be no white space after an opening "{"
102 | ERROR | [x] Closing brace must be on a line by itself
103 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 178 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...dules/contrib/locale_extend/modules/locale_extend_t/locale_extend_t.module
--------------------------------------------------------------------------------
FOUND 156 ERRORS AND 1 WARNING AFFECTING 69 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] The second line in the file doc comment must be "@file"
3 | ERROR | [x] Doc comment short description must end with a full stop
6 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
11 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
12 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
13 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
14 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
15 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
16 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
17 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
18 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
19 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
20 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
21 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
22 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
23 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
24 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
25 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
26 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
27 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
28 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
29 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
30 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
31 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
32 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
35 | ERROR | [x] The open comment tag must be the only content on the line
35 | ERROR | [x] Doc comment short description must be on the first line
36 | ERROR | [x] Opening brace must be the last content on the line
36 | ERROR | [x] There should be no white space after an opening "{"
36 | ERROR | [x] Closing brace must be on a line by itself
36 | ERROR | [x] Expected 1 blank line after function; 0 found
37 | ERROR | [x] The open comment tag must be the only content on the line
37 | ERROR | [x] Doc comment short description must be on the first line
38 | ERROR | [x] Opening brace must be the last content on the line
38 | ERROR | [x] There should be no white space after an opening "{"
38 | ERROR | [x] Closing brace must be on a line by itself
38 | ERROR | [x] Expected 1 blank line after function; 0 found
39 | ERROR | [x] The open comment tag must be the only content on the line
39 | ERROR | [x] Doc comment short description must be on the first line
40 | ERROR | [x] Opening brace must be the last content on the line
40 | ERROR | [x] There should be no white space after an opening "{"
40 | ERROR | [x] Closing brace must be on a line by itself
40 | ERROR | [x] Expected 1 blank line after function; 0 found
41 | ERROR | [x] The open comment tag must be the only content on the line
41 | ERROR | [x] Doc comment short description must be on the first line
42 | ERROR | [x] Opening brace must be the last content on the line
42 | ERROR | [x] There should be no white space after an opening "{"
42 | ERROR | [x] Closing brace must be on a line by itself
42 | ERROR | [x] Expected 1 blank line after function; 0 found
43 | ERROR | [x] The open comment tag must be the only content on the line
43 | ERROR | [x] Doc comment short description must be on the first line
44 | ERROR | [x] Opening brace must be the last content on the line
44 | ERROR | [x] There should be no white space after an opening "{"
44 | ERROR | [x] Closing brace must be on a line by itself
44 | ERROR | [x] Expected 1 blank line after function; 0 found
45 | ERROR | [x] The open comment tag must be the only content on the line
45 | ERROR | [x] Doc comment short description must be on the first line
46 | ERROR | [x] Opening brace must be the last content on the line
46 | ERROR | [x] There should be no white space after an opening "{"
46 | ERROR | [x] Closing brace must be on a line by itself
46 | ERROR | [x] Expected 1 blank line after function; 0 found
47 | ERROR | [x] The open comment tag must be the only content on the line
47 | ERROR | [x] Doc comment short description must be on the first line
48 | ERROR | [x] Opening brace must be the last content on the line
48 | ERROR | [x] There should be no white space after an opening "{"
48 | ERROR | [x] Closing brace must be on a line by itself
48 | ERROR | [x] Expected 1 blank line after function; 0 found
49 | ERROR | [x] The open comment tag must be the only content on the line
49 | ERROR | [x] Doc comment short description must be on the first line
50 | ERROR | [x] Opening brace must be the last content on the line
50 | ERROR | [x] There should be no white space after an opening "{"
50 | ERROR | [x] Closing brace must be on a line by itself
50 | ERROR | [x] Expected 1 blank line after function; 0 found
51 | ERROR | [x] The open comment tag must be the only content on the line
51 | ERROR | [x] Doc comment short description must be on the first line
52 | ERROR | [x] Opening brace must be the last content on the line
52 | ERROR | [x] There should be no white space after an opening "{"
52 | ERROR | [x] Closing brace must be on a line by itself
52 | ERROR | [x] Expected 1 blank line after function; 0 found
53 | ERROR | [x] The open comment tag must be the only content on the line
53 | ERROR | [x] Doc comment short description must be on the first line
54 | ERROR | [x] Opening brace must be the last content on the line
54 | ERROR | [x] There should be no white space after an opening "{"
54 | ERROR | [x] Closing brace must be on a line by itself
54 | ERROR | [x] Expected 1 blank line after function; 0 found
55 | ERROR | [x] The open comment tag must be the only content on the line
55 | ERROR | [x] Doc comment short description must be on the first line
56 | ERROR | [x] Opening brace must be the last content on the line
56 | ERROR | [x] There should be no white space after an opening "{"
56 | ERROR | [x] Closing brace must be on a line by itself
56 | ERROR | [x] Expected 1 blank line after function; 0 found
57 | ERROR | [x] The open comment tag must be the only content on the line
57 | ERROR | [x] Doc comment short description must be on the first line
58 | ERROR | [x] Opening brace must be the last content on the line
58 | ERROR | [x] There should be no white space after an opening "{"
58 | ERROR | [x] Closing brace must be on a line by itself
58 | ERROR | [x] Expected 1 blank line after function; 0 found
59 | ERROR | [x] The open comment tag must be the only content on the line
59 | ERROR | [x] Doc comment short description must be on the first line
60 | ERROR | [x] Opening brace must be the last content on the line
60 | ERROR | [x] There should be no white space after an opening "{"
60 | ERROR | [x] Closing brace must be on a line by itself
60 | ERROR | [x] Expected 1 blank line after function; 0 found
61 | ERROR | [x] The open comment tag must be the only content on the line
61 | ERROR | [x] Doc comment short description must be on the first line
62 | ERROR | [x] Opening brace must be the last content on the line
62 | ERROR | [x] There should be no white space after an opening "{"
62 | ERROR | [x] Closing brace must be on a line by itself
62 | ERROR | [x] Expected 1 blank line after function; 0 found
63 | ERROR | [x] The open comment tag must be the only content on the line
63 | ERROR | [x] Doc comment short description must be on the first line
64 | ERROR | [x] Opening brace must be the last content on the line
64 | ERROR | [x] There should be no white space after an opening "{"
64 | ERROR | [x] Closing brace must be on a line by itself
64 | ERROR | [x] Expected 1 blank line after function; 0 found
65 | ERROR | [x] The open comment tag must be the only content on the line
65 | ERROR | [x] Doc comment short description must be on the first line
66 | ERROR | [x] Opening brace must be the last content on the line
66 | ERROR | [x] There should be no white space after an opening "{"
66 | ERROR | [x] Closing brace must be on a line by itself
66 | ERROR | [x] Expected 1 blank line after function; 0 found
67 | ERROR | [x] The open comment tag must be the only content on the line
67 | ERROR | [x] Doc comment short description must be on the first line
68 | ERROR | [x] Opening brace must be the last content on the line
68 | ERROR | [x] There should be no white space after an opening "{"
68 | ERROR | [x] Closing brace must be on a line by itself
68 | ERROR | [x] Expected 1 blank line after function; 0 found
69 | ERROR | [x] The open comment tag must be the only content on the line
69 | ERROR | [x] Doc comment short description must be on the first line
70 | ERROR | [x] Opening brace must be the last content on the line
70 | ERROR | [x] There should be no white space after an opening "{"
70 | ERROR | [x] Closing brace must be on a line by itself
70 | ERROR | [x] Expected 1 blank line after function; 0 found
71 | ERROR | [x] The open comment tag must be the only content on the line
71 | ERROR | [x] Doc comment short description must be on the first line
72 | ERROR | [x] Opening brace must be the last content on the line
72 | ERROR | [x] There should be no white space after an opening "{"
72 | ERROR | [x] Closing brace must be on a line by itself
72 | ERROR | [x] Expected 1 blank line after function; 0 found
73 | ERROR | [x] The open comment tag must be the only content on the line
73 | ERROR | [x] Doc comment short description must be on the first line
74 | ERROR | [x] Opening brace must be the last content on the line
74 | ERROR | [x] There should be no white space after an opening "{"
74 | ERROR | [x] Closing brace must be on a line by itself
74 | ERROR | [x] Expected 1 blank line after function; 0 found
75 | ERROR | [x] The open comment tag must be the only content on the line
75 | ERROR | [x] Doc comment short description must be on the first line
76 | ERROR | [x] Opening brace must be the last content on the line
76 | ERROR | [x] There should be no white space after an opening "{"
76 | ERROR | [x] Closing brace must be on a line by itself
76 | ERROR | [x] Expected 1 blank line after function; 0 found
77 | ERROR | [x] The open comment tag must be the only content on the line
77 | ERROR | [x] Doc comment short description must be on the first line
78 | ERROR | [x] Opening brace must be the last content on the line
78 | ERROR | [x] There should be no white space after an opening "{"
78 | ERROR | [x] Closing brace must be on a line by itself
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 156 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ntribution/drupal10/web/modules/contrib/locale_extend/locale_extend.module
--------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 12 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] The second line in the file doc comment must be "@file"
3 | ERROR | [x] Doc comment short description must end with a full stop
14 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4
| | spaces
15 | ERROR | [x] Expected 1 space(s) before asterisk; 3 found
16 | ERROR | [x] Expected 1 space(s) before asterisk; 3 found
16 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
17 | ERROR | [x] Expected 1 space(s) before asterisk; 3 found
38 | ERROR | [ ] Description for the @return value is missing
60 | ERROR | [ ] Description for the @return value is missing
70 | ERROR | [x] Expected "string|false" but found "string|FALSE" for function
| | return type
70 | ERROR | [ ] Description for the @return value is missing
72 | ERROR | [x] Expected 1 space between comma and argument "$langcode"; 2
| | found
72 | ERROR | [x] Expected one space after the comma, 2 found
72 | ERROR | [x] Incorrect spacing between argument "$context" and equals
| | sign; expected 1 but found 0
72 | ERROR | [x] Incorrect spacing between default value and equals sign for
| | argument "$context"; expected 1 but found 0
74 | ERROR | [x] There should be no white space before a closing ")"
75 | ERROR | [x] Expected 1 newline at end of file; 3 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...tion/drupal10/web/modules/contrib/locale_extend/locale_extend.services.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.36 secs; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig locale_extend/

Proposed resolution

Resolve all the issues for Drupal and DrupalPractice coding standards.

Remaining tasks

Review the patch and fix remaining issues:
FILE: ...odules/contrib/locale_extend/tests/src/Kernel/ExtendedLocaleStringTest.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
115 | WARNING | Unused variable $source2.
--------------------------------------------------------------------------------

FILE: ...10/web/modules/contrib/locale_extend/tests/src/Kernel/LocaleStringTest.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
37 | WARNING | Possible useless method overriding detected
44 | WARNING | Possible useless method overriding detected
--------------------------------------------------------------------------------

FILE: ...ontribution/drupal10/web/modules/contrib/locale_extend/src/Translation.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
47 | ERROR | Class property $source_langcode should use lowerCamel naming
| | without underscores
167 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

FILE: .../drupal10/web/modules/contrib/locale_extend/src/StringTranslationTrait.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
39 | ERROR | Class property $source_langcode should use lowerCamel naming
| | without underscores
46 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

FILE: ...l10/web/modules/contrib/locale_extend/src/Service/ExtendedLocaleLookup.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
24 | ERROR | Class property $source_langcode should use lowerCamel naming
| | without underscores
--------------------------------------------------------------------------------

FILE: .../contribution/drupal10/web/modules/contrib/locale_extend/src/Translate.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
52 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

Time: 1.39 secs; Memory: 10MB

šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @urvashi_vora
  • šŸ‡®šŸ‡³India Akram Khan Cuttack, Odisha

    still issue remaining so move to NW

    FILE: ...s/akram.khan/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/tests/src/Kernel/LocaleStringTest.php
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------------------
    37 | WARNING | Possible useless method overriding detected
    44 | WARNING | Possible useless method overriding detected
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: ...khan/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/tests/src/Kernel/ExtendedLocaleStringTest.php
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------
    115 | WARNING | Unused variable $source2.
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: ...n/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/modules/locale_extend_ns/locale_extend_ns.module
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 22 ERRORS AFFECTING 22 LINES
    ------------------------------------------------------------------------------------------------------------------------------
    45 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    56 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    67 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    78 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    89 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    100 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    111 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    122 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    133 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    144 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    155 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    166 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    177 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    188 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    199 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    210 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    221 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    232 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    243 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    254 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    265 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    276 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "tr" but expected
    | | "locale_extend_ns_tr"
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: ...han/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/modules/locale_extend_t/locale_extend_t.module
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 22 ERRORS AFFECTING 22 LINES
    ------------------------------------------------------------------------------------------------------------------------------
    40 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_bg" but expected
    | | "locale_extend_t_t_bg"
    46 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_cs" but expected
    | | "locale_extend_t_t_cs"
    52 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_da" but expected
    | | "locale_extend_t_t_da"
    58 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_de" but expected
    | | "locale_extend_t_t_de"
    64 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_et" but expected
    | | "locale_extend_t_t_et"
    70 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_el" but expected
    | | "locale_extend_t_t_el"
    76 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_es" but expected
    | | "locale_extend_t_t_es"
    82 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_fi" but expected
    | | "locale_extend_t_t_fi"
    88 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_fr" but expected
    | | "locale_extend_t_t_fr"
    94 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_hr" but expected
    | | "locale_extend_t_t_hr"
    100 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_hu" but expected
    | | "locale_extend_t_t_hu"
    106 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_is" but expected
    | | "locale_extend_t_t_is"
    112 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_it" but expected
    | | "locale_extend_t_t_it"
    118 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_lt" but expected
    | | "locale_extend_t_t_lt"
    124 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_lv" but expected
    | | "locale_extend_t_t_lv"
    130 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_pl" but expected
    | | "locale_extend_t_t_pl"
    136 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_pt" but expected
    | | "locale_extend_t_t_pt"
    142 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_ro" but expected
    | | "locale_extend_t_t_ro"
    148 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_ru" but expected
    | | "locale_extend_t_t_ru"
    154 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_sk" but expected
    | | "locale_extend_t_t_sk"
    160 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_sl" but expected
    | | "locale_extend_t_t_sl"
    166 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "t_sv" but expected
    | | "locale_extend_t_t_sv"
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/akram.khan/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/src/Translation.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------
    47 | ERROR | Class property $source_langcode should use lowerCamel naming without underscores
    167 | WARNING | Only string literals should be passed to t() where possible
    -----------------------------------------------------------------------------------------------------------------

    FILE: /Users/akram.khan/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/src/Translate.php
    ---------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------
    52 | WARNING | [ ] Only string literals should be passed to t() where possible
    82 | ERROR | [x] list(...) is forbidden, use [...] instead.
    ---------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------

    FILE: ...rs/akram.khan/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/src/Service/ExtendedLocaleLookup.php
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------
    24 | ERROR | Class property $source_langcode should use lowerCamel naming without underscores
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/akram.khan/Desktop/Contribution/drupal9.5.x/drupal/modules/contrib/locale_extend/src/StringTranslationTrait.php
    ----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ----------------------------------------------------------------------------------------------------------------------------
    39 | ERROR | Class property $source_langcode should use lowerCamel naming without underscores
    46 | WARNING | Only string literals should be passed to t() where possible
    ----------------------------------------------------------------------------------------------------------------------------

    Time: 572ms; Memory: 10MB

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡³India ashutosh ahirwal India

    Providing patch with phpcs fixes some "Possible useless method overriding detected" Issue remaining.
    also issue summary updated with command and arguments.

  • Assigned to arpitk
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
     /**
      * @file
    - * Drupal module install file: locale_extend
    + * Drupal module install file: locale_extend.
      */

    The usual description is Install, update, and uninstall function for the Locale Extend module. (Locale Extend must be the module name given in its .info.yml file.)

    - * Drupal module: locale_extend
    + * @file
    + * Drupal module: locale_extend.

    The usual description is Hook implementations for the Locale Extend module. (Locale Extend must be the module name given in its .info.yml file.)

    -   * @return \Drupal\Core\StringTranslation\TranslationInterface
    -   *   A string translation service with predefined source language.
    + *   Language code to translate from.
    + *
    + * @return \Drupal\Core\StringTranslation\TranslationInterface
    + *   A string translation service with predefined source language.
      */
     function locale_extend_translation($source_langcode) {
       return Translate::translation($source_langcode);

    That is not what that function returns. I know the existing comment already says that, but since the comment is edited, that should be corrected too.

      * @return \Drupal\Core\StringTranslation\TranslatableMarkup
    + *   Return TranslatableMarkup.

    The description does not repeat what the @return line made already clear.

    - * @return string|FALSE
    + * @return string|false
    + *   Return string/NULL.

    The description is not correct. It should also say what is returned and when, not the return value type, which is already reported in the previous line.

     /**
    - * Define tr() function for different namespaces
    + * @file
    + * Define tr() function for different namespaces.

    Since that is a module description, it should be different.

    +  /**
    +   * Translate from Bulgarian. @see t()
    +   */

    The verb must be declined to the third person singular.
    The parameter and the return value descriptions are missing.
    @see needs to be in its own line, after the parameter and the return value descriptions.

    - * languages will be added, it is easy enough to add new ones in your custom module.
    + * languages will be added,
    + * it is easy enough to add new ones in your custom module.

    It is correct to avoid that comment lines exceed 80 characters, but they should still be close to 80 characters as much as possible. This means avoiding to make a line 10-character long.

    +  /**
    +   * Alters the container to replace some locale and translation services.
    +   *
    +   * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
    +   *   The container builder.
    +   */
       public function alter(ContainerBuilder $container) {

    Since that is a method defined in an interface, its documentation comment must be different.

    -    // Change path '/admin/config/regional/translate'
    +    // Change path '/admin/config/regional/translate'.

    It is better to say Alter the /admin/config/regional/translate path. It is not necessary to quote the path.

    -    return new TranslatableMarkup($string, $args, $options);
    +    return new TranslatableMarkup('@string', '@args', '@options', [
    +      '@string' => $string,
    +      '@args' => $args,
    +      '@options' => $options,
    +    ]);

    This change is not correct. The new code is translating '@string', not $string. Furthermore, the second and the third parameter must be two arrays, not two strings.

  • Assigned to nitin_lama
  • Issue was unassigned.
  • šŸ‡®šŸ‡³India nitin_lama India

    Addressed 7.1, 7.2, 7.4, 7.8, 7.10, 7.11. Updated patch.

    There were still remaining errors. I've fixed it.

    FILE: /home/system/Documents/contribution/locale_extend/src/Service/ExtendedStringDatabaseStorage.php
    -----------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------
     63 | ERROR | Type hint "\Drupal\locale\StringInterface" missing for $string
     97 | ERROR | Type hint "\Drupal\locale\StringInterface" missing for $string
    -----------------------------------------------------------------------------------------------------
    
    Time: 142ms; Memory: 8MB
    
  • First commit to issue fork.
  • @bharath-kondeti opened merge request.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs work 7 months ago
  • Hi @nitin_lama,,

    Applied patch #9 successfully, however it still threw 2 warnings. Please see below:

    locale_extend git:(1.0.x) curl https://www.drupal.org/files/issues/2023-06-19/phpcs-issue-fixes-3353934-9.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 56548  100 56548    0     0   357k      0 --:--:-- --:--:-- --:--:--  391k
    patching file README.md
    patching file locale_extend.install
    patching file locale_extend.module
    patching file locale_extend.services.yml
    patching file modules/README.md
    patching file modules/locale_extend_ns/locale_extend_ns.module
    patching file modules/locale_extend_t/locale_extend_t.module
    patching file src/Form/TranslateEditForm.php
    patching file src/Form/TranslateFilterForm.php
    patching file src/Form/TranslateFormTrait.php
    patching file src/LocaleExtendServiceProvider.php
    patching file src/Routing/RouteSubscriber.php
    patching file src/Service/ExtendedLocaleLookup.php
    patching file src/Service/ExtendedLocaleTranslation.php
    patching file src/Service/ExtendedStringDatabaseStorage.php
    patching file src/Service/ExtendedTranslatorInterface.php
    patching file src/Service/TranslationManager.php
    patching file src/StringTranslationTrait.php
    patching file src/Translate.php
    patching file src/Translation.php
    patching file tests/src/Kernel/ExtendedLocaleStringTest.php
    patching file tests/src/Kernel/LocaleExtendKernelTestTrait.php
    patching file tests/src/Kernel/LocaleStringTest.php
    āžœ  locale_extend git:(1.0.x) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig locale_extend
    
    FILE: ...sers/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/locale_extend/src/Translation.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     167 | WARNING | Only string literals should be passed to t() where possible
    -----------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/locale_extend/src/Translate.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     52 | WARNING | Only string literals should be passed to t() where possible
    -----------------------------------------------------------------------------------------------------------
    
    Time: 731ms; Memory: 12MB

    Kindly check.

    Thanks,
    Jake

Production build 0.71.5 2024