Problem/Motivation

To be prepared for the next development steps, the module should be clean regarding coding standards.
At the moment there are 123 coding standard violations which should be fixed https://www.drupal.org/pift-ci-job/2271967

facets.module
line 11	Unused use statement
238	Inline @var declarations should use the /** */ delimiters
301	'TODO find a better way to construct the url for a crumb maybe url' should match the format '@todo Fix problem X here.'
305	'TODO handle not grouped facets.' should match the format '@todo Fix problem X here.'
341	Expected 1 blank line after function; 2 found
modules/facets_range_widget/facets_range_widget.module
11	facets_range_widget_requirements() is an installation hook and must be declared in an install file
modules/facets_range_widget/src/Plugin/facets/widget/RangeSliderWidget.php
39	The array declaration extends to column 138 (the limit is 80). The array content should be split up over multiple lines
modules/facets_rest/src/Plugin/views/style/FacetsSerializer.php
115	Short array syntax must be used to define arrays
119	A comma should follow the last multiline array item. Found: )
122	Expected 1 space after FUNCTION keyword; 0 found
modules/facets_summary/src/Entity/FacetsSummary.php
140	Inline @var declarations should use the /** */ delimiters
181	Inline @var declarations should use the /** */ delimiters
191	Inline @var declarations should use the /** */ delimiters
modules/facets_summary/src/EventSubscriber/SearchApiSubscriber.php
10	Missing class doc comment
12	Missing short description in doc comment
55	Line exceeds 80 characters; contains 82 characters
modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
196	The array declaration extends to column 298 (the limit is 80). The array content should be split up over multiple lines
modules/facets_summary/src/Plugin/facets_summary/processor/ResetFacetsProcessor.php
48	Expected 1 space after IF keyword; 0 found
48	Expected 1 space after closing parenthesis; found 0
modules/facets_summary/tests/src/Functional/Rest/FacetSummaryResourceTestBase.php
10	The class short comment should describe what the class does and not simply repeat the class name
modules/facets_summary/tests/src/Kernel/ProcessorTest.php
11	The class short comment should describe what the class does and not simply repeat the class name
modules/facets_summary/tests/src/Unit/Plugin/Processor/HideWhenNotRenderedProcessorTest.php
17	The class short comment should describe what the class does and not simply repeat the class name
modules/facets_summary/tests/src/Unit/Plugin/Processor/ResetFacetsProcessorTest.php
16	The class short comment should describe what the class does and not simply repeat the class name
modules/facets_summary/tests/src/Unit/Plugin/Processor/ShowTextWhenEmptyProcessorTest.php
17	The class short comment should describe what the class does and not simply repeat the class name
115	The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
115	The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
README.txt
17	Line exceeds 80 characters; contains 81 characters
src/Controller/FacetBlockAjaxController.php
130	Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
src/Controller/FacetSourceController.php
8	Unused use statement
src/Entity/Facet.php
151	Doc comment short description must be on a single line, further text should be a separate paragraph
392	'TODO: do not hardcode on taxonomy, make this configurable (or better,' should match the format '@todo Fix problem X here.'
420	Inline @var declarations should use the /** */ delimiters
430	Inline @var declarations should use the /** */ delimiters
715	Inline @var declarations should use the /** */ delimiters
816	Inline @var declarations should use the /** */ delimiters
824	Inline @var declarations should use the /** */ delimiters
src/Event/QueryStringCreated.php
102	Type hint "array" missing for $filterParameters
125	Description for the @return value is missing
137	Description for the @return value is missing
src/EventSubscriber/SearchApiSubscriber.php
10	Missing class doc comment
12	Missing short description in doc comment
52	Line exceeds 80 characters; contains 82 characters
src/FacetManager/DefaultFacetManager.php
115	The array declaration extends to column 135 (the limit is 80). The array content should be split up over multiple lines
174	Inline @var declarations should use the /** */ delimiters
332	Key specified for array entry; first entry has no key
353	Key specified for array entry; first entry has no key
src/FacetSource/FacetSourcePluginManager.php
26	Expected 1 blank line after function; 2 found
src/Form/FacetForm.php
400	The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
702	The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
703	The array declaration extends to column 136 (the limit is 80). The array content should be split up over multiple lines
704	The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
725	The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
730	The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
731	The array declaration extends to column 115 (the limit is 80). The array content should be split up over multiple lines
732	The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
733	The array declaration extends to column 131 (the limit is 80). The array content should be split up over multiple lines
734	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
src/Form/FacetSettingsForm.php
280	The array declaration extends to column 281 (the limit is 80). The array content should be split up over multiple lines
src/Hierarchy/HierarchyInterface.php
7	The class short comment should describe what the class does and not simply repeat the class name
src/LanguageSwitcherLinksAlterer.php
81	Missing parameter type
113	Line exceeds 80 characters; contains 81 characters
186	Expected 1 blank line after function; 0 found
187	The closing brace for the class must have an empty line before it
src/Plugin/Block/FacetBlock.php
88	Inline @var declarations should use the /** */ delimiters
src/Plugin/facets/facet_source/SearchApiBaseFacetSource.php
26	Each @deprecated tag must have a @see tag immediately following it
80	The deprecation-version 'facets:8.x-1.5.' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n
src/Plugin/facets/hierarchy/Taxonomy.php
17	The class short comment should describe what the class does and not simply repeat the class name
src/Plugin/facets/processor/ExcludeSpecifiedItemsProcessor.php
82	Short array syntax must be used to define arrays
src/Plugin/facets/processor/UidToUserNameCallbackProcessor.php
6	Each PHP statement must be on a line by itself
src/Plugin/facets/query_type/SearchApiRange.php
63	Expected 1 space after WHILE keyword; 0 found
src/Plugin/facets/url_processor/QueryString.php
369	The array declaration extends to column 116 (the limit is 80). The array content should be split up over multiple lines
393	The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
src/Processor/ProcessorPluginBase.php
37	The trigger_error message '%s::%s() SHOULD receive %s on line %d, but %s was given. More information is available at https://www.drupal.org/node/2774077.' does not match the relaxed standard format: %thing% is deprecated in %deprecation-version% any fr...
tests/facets_events_test/src/EventListener.php
10	The class short comment should describe what the class does and not simply repeat the class name
18	A comma should follow the last multiline array item. Found: 'queryStringCreated'
tests/facets_query_processor/src/Plugin/Block/DisplayGeneratedLinkBlock.php
19	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Functional/AggregatedFieldTest.php
15	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Functional/FacetsUrlGeneratorTest.php
12	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Functional/IntegrationTest.php
339	The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
tests/src/Functional/Rest/FacetResourceTestBase.php
10	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Functional/Rest/FacetSourceResourceTestBase.php
10	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Functional/TestHelperTrait.php
6	Unused use statement
105	The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines
110	Doc comment short description must end with a full stop
154	The array declaration extends to column 191 (the limit is 80). The array content should be split up over multiple lines
tests/src/Functional/WidgetIntegrationTest.php
78	The array declaration extends to column 104 (the limit is 80). The array content should be split up over multiple lines
102	The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
124	The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
tests/src/FunctionalJavascript/JsBase.php
151	The array declaration extends to column 147 (the limit is 80). The array content should be split up over multiple lines
tests/src/FunctionalJavascript/WidgetJSTest.php
158	The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
159	The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
174	The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
184	The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
185	The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
319	The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
321	The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
347	The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
tests/src/Kernel/FacetManager/DefaultFacetManagerTest.php
13	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Kernel/Plugin/query_type/SearchApiDateTest.php
260	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
261	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
262	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
263	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
264	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
265	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
266	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
267	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
268	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
269	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
270	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
271	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
272	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php
127	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
132	The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
136	The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
tests/src/Unit/Plugin/processor/HideOnlyOneItemProcessorTest.php
15	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Unit/Plugin/processor/ListItemProcessorTest.php
134	Inline @var declarations should use the /** */ delimiters
178	Inline @var declarations should use the /** */ delimiters
tests/src/Unit/Plugin/processor/ShowOnlyDeepestLevelItemsProcessorTest.php
15	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Unit/Plugin/processor/TranslateEntityProcessorTest.php
130	Parameter tags must be defined first in a doc comment
180	Parameter tags must be defined first in a doc comment
231	Parameter tags must be defined first in a doc comment
tests/src/Unit/Result/ResultTest.php
14	The class short comment should describe what the class does and not simply repeat the class name
tests/src/Unit/Utility/FacetsUrlGeneratorTest.php
17	The class short comment should describe what the class does and not simply repeat the class name

Proposed resolution

Fix coding standards.

Remaining tasks

Create patch to fix coding standards.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork facets-3255596

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

tim-diels created an issue. See original summary.

tim-diels’s picture

Assigned: Unassigned » tim-diels
tim-diels’s picture

tim-diels’s picture

Assigned: tim-diels » Unassigned
Status: Active » Needs work

Fixed almost all the Coding Standard issues mentioned above and more.
But I'm not sure how to fix the other problems.

FILE: .../modules/contrib/facets/src/FacetManager/DefaultFacetManager.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 337 | ERROR | Key specified for array entry; first entry has no key
 358 | ERROR | Key specified for array entry; first entry has no key
----------------------------------------------------------------------


FILE: ...dules/contrib/facets/src/Controller/FacetBlockAjaxController.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 146 | WARNING | \Drupal calls should be avoided in classes, use
     |         | dependency injection instead
----------------------------------------------------------------------


FILE: .../web/modules/contrib/facets/src/LanguageSwitcherLinksAlterer.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 100 | WARNING | Unused variable $facet_id.
----------------------------------------------------------------------


FILE: ...web/modules/contrib/facets/src/Processor/ProcessorPluginBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 37 | ERROR | The trigger_error message '%s::%s() SHOULD receive %s
    |       | on line %d, but %s was given. More information is
    |       | available at https://www.drupal.org/node/2774077.' does
    |       | not match the relaxed standard format: %thing% is
    |       | deprecated in %deprecation-version% any free text
    |       | %removal-version%. %extra-info%. See %cr-link%
----------------------------------------------------------------------


FILE: ...cets/src/Plugin/facets/facet_source/SearchApiBaseFacetSource.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 81 | WARNING | The deprecation-version 'facets:8.x-1.5.' does not
    |         | match the lower-case machine-name standard:
    |         | drupal:n.n.n or project:n.x-n.n
----------------------------------------------------------------------


FILE: ...modules/contrib/facets/tests/src/FunctionalJavascript/JsBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 151 | ERROR | The array declaration extends to column 147 (the limit
     |       | is 80). The array content should be split up over
     |       | multiple lines
----------------------------------------------------------------------

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

strykaizer’s picture

Status: Needs work » Needs review
borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, rtbc

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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