GitlabCI: Fix PHPCS validation errors

Created on 28 July 2016, almost 8 years ago
Updated 28 May 2024, 26 days ago

There are 268 sniff violations reported in 41 sources by phpcs.

phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme modules/contrib/token/

Report:

https://git.drupalcode.org/project/token/-/jobs/668566
To get lastest phpcs report check https://git.drupalcode.org/project/token/-/pipelines

List of violation by rules

Drupal.Arrays.Array.ArrayClosingIndentation                            1
Drupal.Arrays.Array.ArrayIndentation                                   14
Drupal.Arrays.Array.CommaLastItem                                      8
Drupal.Arrays.Array.LongLineDeclaration                                12
Drupal.Arrays.DisallowLongArraySyntax.Found                            1
Drupal.Classes.ClassDeclaration.CloseBraceAfterBody                    15
Drupal.Classes.UnusedUseStatement.UnusedUse                            1
Drupal.Commenting.ClassComment.Missing                                 6
Drupal.Commenting.DocComment.MissingShort                              17
Drupal.Commenting.DocComment.ShortSingleLine                           2
Drupal.Commenting.DocComment.TagGroupSpacing                           1
Drupal.Commenting.FileComment.Missing                                  1
Drupal.Commenting.FileComment.SpacingAfterComment                      1
Drupal.Commenting.FunctionComment.Missing                              33
Drupal.Commenting.FunctionComment.MissingParamComment                  1
Drupal.Commenting.FunctionComment.MissingParamType                     7
Drupal.Commenting.FunctionComment.MissingReturnType                    1
Drupal.Commenting.FunctionComment.ParamCommentIndentation              1
Drupal.Commenting.FunctionComment.ReturnCommentIndentation             1
Drupal.Commenting.FunctionComment.WrongStyle                           1
Drupal.Commenting.HookComment.HookCommentFormat                        3
Drupal.Commenting.InlineComment.InvalidEndChar                         13
Drupal.Commenting.InlineComment.NoSpaceBefore                          4
Drupal.Commenting.InlineComment.NotCapital                             1
Drupal.Commenting.InlineComment.SpacingAfter                           3
Drupal.Commenting.InlineComment.SpacingBefore                          11
Drupal.Commenting.InlineVariableComment.VarInline                      9
Drupal.Commenting.VariableComment.Missing                              3
Drupal.Files.LineLength.TooLong                                        7
Drupal.NamingConventions.ValidFunctionName.NotCamelCaps                1
Drupal.NamingConventions.ValidVariableName.LowerCamelName              2
Drupal.Scope.MethodScope.Missing                                       33
Drupal.Semantics.FunctionT.BackslashSingleQuote                        1
Drupal.WhiteSpace.ScopeIndent.IncorrectExact                           5
DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter                3
Generic.PHP.UpperCaseConstant.Found                                    2
PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse                       1
SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.  12
SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl  11
SlevomatCodingStandard.PHP.ShortList.LongListUsed                      2
Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak            4
Squiz.WhiteSpace.FunctionSpacing.AfterLast                             15
Squiz.WhiteSpace.FunctionSpacing.Before                                1
Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines                      1

Fix rules by MR.

MR 54

  • SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses
  • Drupal.Classes.ClassDeclaration.CloseBraceAfterBody
  • Drupal.Classes.UnusedUseStatement.UnusedUse
  • PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse

MR 55

  • SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.NullCoalesceOperatorNotUsed

MR 56

  • Drupal.Arrays.Array.ArrayClosingIndentation
  • Drupal.Arrays.Array.ArrayIndentation
  • Drupal.Arrays.Array.CommaLastItem
  • Drupal.Arrays.Array.LongLineDeclaration
  • SlevomatCodingStandard.PHP.ShortList.LongListUsed

MR 57

  • Drupal.Scope.MethodScope.Missing
  • Drupal.NamingConventions.ValidFunctionName.NotCamelCaps

MR 58

  • Drupal.Commenting.ClassComment.Missing
  • Drupal.Commenting.DocComment.MissingShort
  • Drupal.Commenting.DocComment.ShortSingleLine
  • Drupal.Commenting.DocComment.TagGroupSpacing
  • Drupal.Commenting.FileComment.Missing
  • Drupal.Commenting.FileComment.SpacingAfterComment
  • Drupal.Commenting.FunctionComment.Missing
  • Drupal.Commenting.FunctionComment.MissingParamComment
  • Drupal.Commenting.FunctionComment.MissingParamType
  • Drupal.Commenting.FunctionComment.MissingReturnType
  • Drupal.Commenting.FunctionComment.ParamCommentIndentation
  • Drupal.Commenting.FunctionComment.ReturnCommentIndentation
  • Drupal.Commenting.FunctionComment.WrongStyle
  • Drupal.Commenting.HookComment.HookCommentFormat
  • Drupal.Commenting.InlineComment.InvalidEndChar
  • Drupal.Commenting.InlineComment.NoSpaceBefore
  • Drupal.Commenting.InlineComment.NotCapital
  • Drupal.Commenting.InlineComment.SpacingAfter
  • Drupal.Commenting.InlineComment.SpacingBefore
  • Drupal.Commenting.InlineVariableComment.VarInline
  • Drupal.Commenting.VariableComment.Missing
  • Drupal.Files.LineLength.TooLong
  • DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter

MR 64

  • Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak
  • Squiz.WhiteSpace.FunctionSpacing.AfterLast
  • Squiz.WhiteSpace.FunctionSpacing.Before
  • Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

MR 65

  • Drupal.NamingConventions.ValidVariableName.LowerCamelName
  • Drupal.Semantics.FunctionT.BackslashSingleQuote
  • Generic.PHP.UpperCaseConstant.Found

Note.

Branch 2774071-fix-cs-base-branch used as base branch for all the MRs. This will add phpcs.xml file, and disable allow-faillure on phpcs check on Gitlab CI.

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India vinod_kc

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024