Closed (fixed)
Project:
Entity Usage
Version:
8.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 May 2024 at 06:54 UTC
Updated:
19 Dec 2024 at 20:34 UTC
Jump to comment: Most recent
GitLab CI reports the following PHP_CodeSniffer issues which should be fixed.
FILE: .../custom/entity_usage-3445394/tests/src/Kernel/EntityUsageTrackFileTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is
| | Drupal\Tests\file\Functional\FileFieldCreationTrait.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...b/modules/custom/entity_usage-3445394/tests/src/Kernel/EntityUsageTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Entity\EntityInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
255 | ERROR | [ ] Parameter $field_name is not described in comment
| | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...rc/FunctionalJavascript/EntityUsageLayoutBuilderEntityBrowserBlockTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
170 | ERROR | [x] Inline comments must start with a capital letter
| | (Drupal.Commenting.InlineComment.NotCapital)
229 | ERROR | [x] Inline comments must start with a capital letter
| | (Drupal.Commenting.InlineComment.NotCapital)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ntity_usage-3445394/tests/src/FunctionalJavascript/EmbeddedContentTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\file\Entity\File.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...394/tests/modules/entity_usage_test/src/Plugin/Block/DependenciesBlock.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
44 | ERROR | [x] Expected 1 blank line after function; 0 found
| | (Squiz.WhiteSpace.FunctionSpacing.AfterLast)
45 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
| | (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...45394/web/modules/custom/entity_usage-3445394/src/EntityUsageTrackBase.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Config\ConfigFactoryInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
17 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
59 | ERROR | [x] Whitespace found at end of line
| | (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
275 | ERROR | [x] Whitespace found at end of line
| | (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...b/modules/custom/entity_usage-3445394/src/EntityUsageQueueBatchManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Config\ConfigFactoryInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...45394/web/modules/custom/entity_usage-3445394/src/EntityUsageInterface.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
197 | ERROR | The text '@deprecated in branch 2.x. Use
| | \Drupal\entity_usage\EntityUsageInterface::listSources()
| | instead.' does not match the standard format: @deprecated in
| | %deprecation-version% and is removed from %removal-version%.
| | %extra-info%. (Drupal.Commenting.Deprecated.IncorrectTextLayout)
197 | ERROR | Each @deprecated tag must have a @see tag immediately following
| | it (Drupal.Commenting.Deprecated.DeprecatedMissingSeeTag)
219 | ERROR | The text '@deprecated in branch 2.x. Use
| | \Drupal\entity_usage\EntityUsageInterface::listTargets()
| | instead.' does not match the standard format: @deprecated in
| | %deprecation-version% and is removed from %removal-version%.
| | %extra-info%. (Drupal.Commenting.Deprecated.IncorrectTextLayout)
219 | ERROR | Each @deprecated tag must have a @see tag immediately following
| | it (Drupal.Commenting.Deprecated.DeprecatedMissingSeeTag)
--------------------------------------------------------------------------------
FILE: ...94/web/modules/custom/entity_usage-3445394/src/EntityUsageBatchManager.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Config\ConfigFactoryInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
73 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
74 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
75 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
76 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
77 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
111 | ERROR | [ ] The array declaration extends to column 141 (the limit is
| | 120). The array content should be split up over multiple
| | lines (Drupal.Arrays.Array.LongLineDeclaration)
111 | ERROR | [ ] The array declaration extends to column 140 (the limit is
| | 120). The array content should be split up over multiple
| | lines (Drupal.Arrays.Array.LongLineDeclaration)
151 | ERROR | [x] Expected 1 space before "==="; 2 found
| | (Squiz.WhiteSpace.OperatorSpacing.SpacingBefore)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ..._usage-3445394/web/modules/custom/entity_usage-3445394/src/EntityUsage.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\entity_usage\Events\EntityUsageEvent.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
327 | WARNING | [x] '@todo: Fix bigint support once fixed in core. More info
| | on #2680571 and' should match the format '@todo Fix
| | problem X here.'
| | (Drupal.Commenting.TodoComment.TodoFormat)
327 | ERROR | [x] There must be exactly one blank line before the tags in a
| | doc comment
| | (Drupal.Commenting.DocComment.SpacingBeforeTags)
330 | ERROR | [ ] Parameter tags must be defined first in a doc comment
| | (Drupal.Commenting.DocComment.ParamNotFirst)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...b/modules/custom/entity_usage-3445394/src/EntityUpdateManagerInterface.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
| | (Drupal.Commenting.ClassComment.Short)
--------------------------------------------------------------------------------
FILE: ...445394/web/modules/custom/entity_usage-3445394/src/EntityUpdateManager.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
13 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
| | (Drupal.Commenting.ClassComment.Short)
--------------------------------------------------------------------------------
FILE: ...3445394/src/Plugin/QueueWorker/EntityUsageRegenerateTrackingInfoWorker.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
9 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...es/custom/entity_usage-3445394/src/Plugin/EntityUsage/Track/MediaEmbed.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
37 | WARNING | [x] '@TODO Re-evaluate if this is worth the effort and
| | overhead.' should match the format '@todo Fix problem X
| | here.' (Drupal.Commenting.TodoComment.TodoFormat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...odules/custom/entity_usage-3445394/src/Plugin/EntityUsage/Track/LinkIt.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
40 | WARNING | [x] '@TODO Re-evaluate if this is worth the effort and
| | overhead.' should match the format '@todo Fix problem X
| | here.' (Drupal.Commenting.TodoComment.TodoFormat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...custom/entity_usage-3445394/src/Plugin/EntityUsage/Track/LayoutBuilder.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
16 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Path\PathValidatorInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
188 | ERROR | [x] list(...) is forbidden, use [...] instead.
| | (SlevomatCodingStandard.PHP.ShortList.LongListUsed)
230 | ERROR | [x] list(...) is forbidden, use [...] instead.
| | (SlevomatCodingStandard.PHP.ShortList.LongListUsed)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...s/custom/entity_usage-3445394/src/Plugin/EntityUsage/Track/EntityEmbed.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
39 | WARNING | [x] '@TODO Re-evaluate if this is worth the effort and
| | overhead.' should match the format '@todo Fix problem X
| | here.' (Drupal.Commenting.TodoComment.TodoFormat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...custom/entity_usage-3445394/src/Plugin/EntityUsage/Track/CkeditorImage.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
40 | WARNING | [x] '@TODO Re-evaluate if this is worth the effort and
| | overhead.' should match the format '@todo Fix problem X
| | here.' (Drupal.Commenting.TodoComment.TodoFormat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...es/custom/entity_usage-3445394/src/Plugin/EntityUsage/Track/BlockField.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
37 | ERROR | [x] list(...) is forbidden, use [...] instead.
| | (SlevomatCodingStandard.PHP.ShortList.LongListUsed)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...b/modules/custom/entity_usage-3445394/src/Form/EntityUsageSettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
227 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ] (Drupal.Arrays.Array.CommaLastItem)
232 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ] (Drupal.Arrays.Array.CommaLastItem)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...45394/web/modules/custom/entity_usage-3445394/src/Form/BatchUpdateForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Form\FormBase.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...modules/custom/entity_usage-3445394/src/Controller/ListUsageController.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
14 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
17 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Pager\PagerManagerInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
81 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1
| | spaces
| | (Drupal.Commenting.FunctionComment.ParamCommentIndentation)
124 | ERROR | [ ] The array declaration extends to column 147 (the limit is
| | 120). The array content should be split up over multiple
| | lines (Drupal.Arrays.Array.LongLineDeclaration)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...b/modules/custom/entity_usage-3445394/src/Commands/EntityUsageCommands.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\entity_usage\EntityUsageBatchManager.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...45394/web/modules/custom/entity_usage-3445394/entity_usage.post_update.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
5 | ERROR | [x] Doc comment short description must start with a capital
| | letter (Drupal.Commenting.DocComment.ShortNotCapital)
9 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Site\Settings.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
10 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
13 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements
| | hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "*
| | Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or
| | "* Implements hook_foo_BAR_ID_bar() for block templates."
| | (Drupal.Commenting.HookComment.HookCommentFormat)
14 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
| | (Drupal.Commenting.DocComment.ShortSingleLine)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ..._usage-3445394/web/modules/custom/entity_usage-3445394/entity_usage.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
118 | ERROR | [x] Closing parenthesis of array declaration must be on a new
| | line (Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine)
146 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: ) (Drupal.Arrays.Array.CommaLastItem)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...usage-3445394/web/modules/custom/entity_usage-3445394/entity_usage.install
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
260 | ERROR | [x] Expected one space after the comma, 0 found
| | (Drupal.WhiteSpace.Comma.NoSpace)
268 | ERROR | [x] Expected one space after the comma, 0 found
| | (Drupal.WhiteSpace.Comma.NoSpace)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 1.11 secs; Memory: 10MB
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
Comment #3
avpadernoComment #4
avpadernoComment #5
cleavinjosh commentedHi @avpaderno,
I applied MR!82, it was not applied smoothly and fixed most of the phpcs issues.
These are the remaining issues I encountered after I ran
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.Please check and advise.
Thank you.
Comment #6
kul.pratap commentedComment #7
kul.pratap commentedComment #8
arunsahijpal commentedWorking on it!
Comment #9
arunsahijpal commentedHi @cleavinjosh and @marcoscano,
I've removed all the phpcs errors , please check it once.
Comment #10
chandansha commentedI have tested MR 82 using @cleavinjosh given command there is still some of issue pending.
I move it to Need Work.
ThankS!!
Comment #11
chandansha commented@arunsahijpal sorry I have tested it on my local phpcs. In Pipeline are run successfully passed.
I move it to RTBC
Thanks!!
Comment #12
alexpottWe should add
to the .gitlab-ci.yml file and then we'll fail a build when a change causes PHPCS to fail.
Comment #13
arunsahijpal commentedHi @alexpott,
I've allowed phpcs failure and the phpcs is also passing the pipeline, kindly check.
Comment #14
alexpottLooks great
Comment #15
marcoscanoThanks for helping! This is ready to go but needs a re-roll
Comment #16
Anonymous (not verified) commentedakulsaxena made their first commit to this issue’s fork.
Comment #17
Anonymous (not verified) commented@marcoscano
Re-rolled as requested
Please have a look
Comment #18
Anonymous (not verified) commentedComment #19
Anonymous (not verified) commentedComment #20
alexpottLooking good again.
Comment #22
marcoscanoCommitted. Thanks all!