Fix the issues reported by phpcs

Created on 24 February 2023, almost 2 years ago
Updated 6 September 2024, 3 months ago

GitLab CI reportd the following PHP_CodeSniffer warnings/errors, which should be fixed.

FILE: ...44157/web/modules/custom/globallink-3344157/src/GlobalLinkTranslatorUi.php
--------------------------------------------------------------------------------
FOUND 75 ERRORS AND 2 WARNINGS AFFECTING 59 LINES
--------------------------------------------------------------------------------
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin
     |         |     with a file doc comment
     |         |     (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
  14 | ERROR   | [x] Use statements should be sorted alphabetically. The first
     |         |     wrong one is Drupal\Core\Form\FormStateInterface.
     |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 115 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ) (Drupal.Arrays.Array.CommaLastItem)
 117 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 121 | ERROR   | [x] Array indentation error, expected 12 spaces but found 14
     |         |     (Drupal.Arrays.Array.ArrayIndentation)
 122 | ERROR   | [x] Array indentation error, expected 12 spaces but found 14
     |         |     (Drupal.Arrays.Array.ArrayIndentation)
 123 | ERROR   | [x] Array indentation error, expected 12 spaces but found 14
     |         |     (Drupal.Arrays.Array.ArrayIndentation)
 124 | ERROR   | [x] Array indentation error, expected 12 spaces but found 14
     |         |     (Drupal.Arrays.Array.ArrayIndentation)
 127 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ) (Drupal.Arrays.Array.CommaLastItem)
 156 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 156 | ERROR   | [x] Short array syntax must be used to define arrays
     |         |     (Drupal.Arrays.DisallowLongArraySyntax.Found)
 157 | ERROR   | [x] No space found before comment text; expected "// Test
     |         |     duplicate project ids" but found "//Test duplicate project
     |         |     ids" (Drupal.Commenting.InlineComment.NoSpaceBefore)
 157 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
     |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 160 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE"
     |         |     but found "false" (Generic.PHP.UpperCaseConstant.Found)
 161 | ERROR   | [x] Expected 1 space after FOR keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 161 | ERROR   | [x] Expected 1 space before "="; 0 found
     |         |     (Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore)
 161 | ERROR   | [x] Expected 1 space after "="; 0 found
     |         |     (Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfter)
 161 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 162 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 163 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 164 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 164 | ERROR   | [x] Expected 1 space after FOREACH keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 164 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 165 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 166 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 167 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 168 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 168 | ERROR   | [x] Expected 1 space after FOR keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 168 | ERROR   | [x] Expected 1 space before "="; 0 found
     |         |     (Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore)
 168 | ERROR   | [x] Expected 1 space after "="; 0 found
     |         |     (Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfter)
 168 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 169 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 170 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 170 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 170 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 171 | ERROR   | [x] Line indented incorrectly; expected 12 spaces, found 18
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 171 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
     |         |     but found "true" (Generic.PHP.UpperCaseConstant.Found)
 172 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 173 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 175 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 175 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 176 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 176 | ERROR   | [x] There should be no white space after an opening "("
     |         |     (Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace)
 178 | ERROR   | [x] Expected 1 space after ELSEIF keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 178 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 179 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 179 | ERROR   | [x] There should be no white space after an opening "("
     |         |     (Drupal.WhiteSpace.OpenBracketSpacing.OpeningWhitespace)
 182 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 183 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 184 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 185 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 186 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 187 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 188 | ERROR   | [x] Line indented incorrectly; expected 12 spaces, found 18
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 189 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 190 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 192 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 193 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 194 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 195 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 196 | ERROR   | [x] Line indented incorrectly; expected 12 spaces, found 18
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 197 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 198 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 200 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 201 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 202 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 203 | ERROR   | [x] Line indented incorrectly; expected 12 spaces, found 18
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 204 | ERROR   | [x] Line indented incorrectly; expected 14 spaces, found 22
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 205 | ERROR   | [x] Line indented incorrectly; expected 12 spaces, found 18
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 206 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 14
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 207 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 337 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     |         |     (SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.NullCoalesceOperatorNotUsed)
 380 | ERROR   | [x] Data types in @param tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 395 | ERROR   | [x] Data types in @param tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 403 | ERROR   | [x] Expected 1 blank line after function; 2 found
     |         |     (Squiz.WhiteSpace.FunctionSpacing.After)
 457 | ERROR   | [x] Expected 1 blank line after function; 0 found
     |         |     (Squiz.WhiteSpace.FunctionSpacing.AfterLast)
 458 | ERROR   | [x] The closing brace for the class must have an empty line
     |         |     before it
     |         |     (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 77 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...nk-3344157/web/modules/custom/globallink-3344157/src/GlExchangeAdapter.php
--------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 10 LINES
--------------------------------------------------------------------------------
   3 | ERROR | [x] There must be one blank line after the namespace declaration
     |       |     (PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter)
  24 | ERROR | [ ] Missing short description in doc comment
     |       |     (Drupal.Commenting.DocComment.MissingShort)
  29 | ERROR | [ ] Missing short description in doc comment
     |       |     (Drupal.Commenting.DocComment.MissingShort)
  82 | ERROR | [ ] Public method name "GlExchangeAdapter::getPDConfig" is not
     |       |     in lowerCamel format
     |       |     (Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps)
 119 | ERROR | [x] Parameter comment must end with a full stop
     |       |     (Drupal.Commenting.FunctionComment.ParamCommentFullStop)
 147 | ERROR | [x] Parameter comment must end with a full stop
     |       |     (Drupal.Commenting.FunctionComment.ParamCommentFullStop)
 149 | ERROR | [ ] Description for the @return value is missing
     |       |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 162 | ERROR | [x] Expected 1 blank line after function; 0 found
     |       |     (Squiz.WhiteSpace.FunctionSpacing.After)
 163 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment
     |       |     */" or "// Comment" instead
     |       |     (Drupal.Commenting.InlineComment.DocBlock)
 164 | ERROR | [x] Doc comment short description must end with a full stop
     |       |     (Drupal.Commenting.DocComment.ShortFullStop)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...om/globallink-3344157/src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php
--------------------------------------------------------------------------------
FOUND 21 ERRORS AND 2 WARNINGS AFFECTING 18 LINES
--------------------------------------------------------------------------------
   6 | ERROR   | [x] Use statements should be sorted alphabetically. The first
     |         |     wrong one is Drupal\Core\Datetime\DrupalDateTime.
     |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
  11 | WARNING | [x] Unused use statement
     |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
  14 | WARNING | [x] Unused use statement
     |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
  22 | ERROR   | [x] There must be one blank line after the last USE statement;
     |         |     2 found;
     |         |     (PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse)
  41 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
  59 | ERROR   | [ ] Missing short description in doc comment
     |         |     (Drupal.Commenting.DocComment.MissingShort)
  64 | ERROR   | [ ] Missing short description in doc comment
     |         |     (Drupal.Commenting.DocComment.MissingShort)
 551 | ERROR   | [x] Data types in @param tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 552 | ERROR   | [x] Parameter comment must end with a full stop
     |         |     (Drupal.Commenting.FunctionComment.ParamCommentFullStop)
 595 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 595 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 597 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 597 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 702 | ERROR   | [x] Data types in @param tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 705 | ERROR   | [ ] @return doc comment specified, but function has no return
     |         |     statement
     |         |     (Drupal.Commenting.FunctionComment.InvalidNoReturn)
 745 | ERROR   | [ ] Description for the @return value is missing
     |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 809 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 816 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 816 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 817 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 10
     |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 857 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 857 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 857 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     |         |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...stom/globallink-3344157/src/EventSubscriber/GloballinkContinuousEvents.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
--------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
     |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
   9 | ERROR   | [x] Use statements should be sorted alphabetically. The first
     |         |     wrong one is Drupal\tmgmt\Events\ContinuousEvents.
     |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
  17 | ERROR   | [ ] Missing short description in doc comment
     |         |     (Drupal.Commenting.DocComment.MissingShort)
  22 | ERROR   | [ ] Missing short description in doc comment
     |         |     (Drupal.Commenting.DocComment.MissingShort)
  81 | ERROR   | [x] Case breaking statements must be followed by a single
     |         |     blank line
     |         |     (Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak)
 104 | ERROR   | [x] Expected 1 blank line after function; 0 found
     |         |     (Squiz.WhiteSpace.FunctionSpacing.AfterLast)
 105 | ERROR   | [x] The closing brace for the class must have an empty line
     |         |     before it
     |         |     (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...globallink-3344157/web/modules/custom/globallink-3344157/globallink.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
    |         |     (Drupal.Commenting.FileComment.Missing)
  4 | ERROR   | [x] Use statements should be sorted alphabetically. The first
    |         |     wrong one is Drupal\tmgmt\Entity\Job.
    |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 28 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
    |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 28 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
    |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
 58 | WARNING | [ ] Translatable strings must not begin or end with white
    |         |     spaces, use placeholders with t() for variables
    |         |     (Drupal.Semantics.FunctionT.WhiteSpace)
 58 | ERROR   | [ ] Concatenating translatable strings is not allowed, use
    |         |     placeholders instead and only one string literal
    |         |     (Drupal.Semantics.FunctionT.Concat)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...loballink-3344157/web/modules/custom/globallink-3344157/globallink.install
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
   |       |     (Drupal.WhiteSpace.OpenTagNewline.BlankLine)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 251ms; Memory: 8MB
📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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

  • Issue created by @samit.310@gmail.com
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India samit.310@gmail.com

    Above error/warnings need to be fixed.

    Only Following errors are remains.

    FILE: /var/www/html/modules/contrib/globallink/README.txt
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
    17 | WARNING | Line exceeds 80 characters; contains 83 characters
    ----------------------------------------------------------------------

    For above we already have issue opened. Replace README.txt with README.md 📌 Replace README.txt with README.md RTBC

    FILE: /var/www/html/modules/contrib/globallink/src/GlExchangeAdapter.php
    ----------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------
    87 | ERROR | Public method name "GlExchangeAdapter::getPDConfig" is not in lowerCamel format
    ----------------------------------------------------------------------------------------------

    I am not sure to changes getPDConfig function to lowerCamel format, Maintainers can confirm here.

  • Issue was unassigned.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work 9 months ago
  • 🇮🇳India Ashutosh Ahirwal India

    Hi, Patch provided in #2 is not getting apply throwing error
    Moving to need work
    Result after applying patch

    globallink % git apply -v 3344157-2.patch
    Checking patch config/schema/globallink.schema.yml...
    error: while searching for:
    label: Email notification levels
    pd_user_agent:
    type: select
    label: GlobalLink User Agent Level
    error: patch failed: config/schema/globallink.schema.yml:32
    error: config/schema/globallink.schema.yml: patch does not apply
    Checking patch globallink.install...
    Checking patch globallink.module...
    Checking patch src/EventSubscriber/GloballinkContinuousEvents.php...
    Checking patch src/GlExchangeAdapter.php...
    Checking patch src/GlobalLinkTranslatorUi.php...
    error: while searching for:

    $form['pd_url'] = [
    '#type' => 'url',
    '#title' => t('GlobalLink api url'),
    '#required' => TRUE,
    '#default_value' => $translator->getSetting('pd_url'),
    '#description' => t('Add the api url provided by translations.com'),
    ];
    $form['pd_username'] = [
    '#type' => 'textfield',
    '#title' => t('GlobalLink username'),
    '#required' => TRUE,
    '#default_value' => $translator->getSetting('pd_username'),
    '#description' => t('Add the username provided by translations.com'),
    ];
    $form['pd_password'] = [
    '#type' => 'password',
    '#title' => t('GlobalLink password'),
    '#required' => TRUE,
    '#default_value' => $translator->getSetting('pd_password'),
    '#description' => t('Add the password provided by translations.com'),
    ];
    $form['pd_projectid'] = [
    '#type' => 'textfield',
    '#title' => t('GlobalLink project id'),
    '#required' => TRUE,
    '#default_value' => $translator->getSetting('pd_projectid'),
    '#description' => t('Add the project id provided by translations.com'),
    ];
    $form['pd_submissionprefix'] = [
    '#type' => 'textfield',
    '#title' => t('GlobalLink submission prefix'),
    '#required' => TRUE,
    '#default_value' => $translator->getSetting('pd_submissionprefix'),
    '#description' => t('Choose a prefix'),
    ];
    $form['pd_classifier'] = [
    '#type' => 'textfield',
    '#title' => t('GlobalLink classifier'),
    '#required' => TRUE,
    '#default_value' => $translator->getSetting('pd_classifier'),
    '#description' => t('Add a classifier'),
    ];
    $form['pd_notify_emails'] = [
    '#type' => 'textfield',
    '#title' => t('Emails for notification'),
    '#default_value' => $translator->getSetting('pd_notify_emails'),
    '#description' => t('A space separated list of emails to notify. Leave blank for no notifications'),
    ];
    $form['pd_combine'] = [
    '#type' => 'checkbox',
    '#title' => t('Combine all items into a single document'),
    '#default_value' => $translator->getSetting('pd_combine'),
    '#description' => t('If checked, a single document will be sent for a translation job, otherwise a separate document within a single submission will be created for each job item.'),
    ];
    $form['pd_due_date_offset'] = [
    '#type' => 'textfield',
    '#title' => t('Default due date offset in working days'),
    '#default_value' => $translator->getSetting('pd_due_date_offset') ?: 3,
    '#description' => t('Controls the default due date, which then by default uses the configured amount of working days in the future.'),
    ];
    $form['pd_notify_level'] = [
    '#type' => 'checkboxes',
    '#title' => t('Email notification levels'),
    '#options' => [
    GlobalLinkTranslator::MSG_STATUS => t('Status'),
    GlobalLinkTranslator::MSG_DEBUG => t('Debug'),
    GlobalLinkTranslator::MSG_WARNING => t('Warning'),
    GlobalLinkTranslator::MSG_ERROR => t('Error'),
    ],
    '#default_value' => (array) $translator->getSetting('pd_notify_level'),
    '#description' => t('Select which tmgmt message types to send via email. Selecting all can result in a high volume of emails being sent.')
    ];
    $form['pd_user_agent'] = [
    '#type' => 'select',
    '#title' => t('Select Environment Type'),
    '#options' => [
    'dev' => $this->t('Development Environment'),
    'test' => $this->t('Test Environment'),
    'stage' => $this->t('Staging Environment'),
    'prod' => $this->t('Production Environment'),
    ],
    '#default_value' => (array) $translator->getSetting('pd_user_agent'),
    '#description' => t('Select which type of environment this is installed on. This will provide more information for Project Director.')
    ];

    return $form;
    }

    error: patch failed: src/GlobalLinkTranslatorUi.php:44
    error: src/GlobalLinkTranslatorUi.php: patch does not apply
    Checking patch src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php...
    Hunk #8 succeeded at 572 (offset 5 lines).
    Hunk #9 succeeded at 616 (offset 5 lines).
    Hunk #10 succeeded at 686 (offset 5 lines).
    error: while searching for:
    $this->glExchangeAdapter->getGlExchange($pd_config);
    }
    catch (\Exception $e) {
    return AvailableResult::no(t('@translator is not available. Make sure it is properly configured.', [
    '@translator' => $translator->label(),
    ':configured' => $translator->url(),
    ]));

    error: patch failed: src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php:681
    error: src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php: patch does not apply

  • Assigned to PrabuEla
  • Issue was unassigned.
  • Pipeline finished with Success
    8 months ago
    Total: 143s
    #124883
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Pipeline finished with Success
    8 months ago
    Total: 143s
    #124931
  • Pipeline finished with Success
    8 months ago
    Total: 145s
    #124964
  • Pipeline finished with Success
    8 months ago
    Total: 139s
    #124973
  • Assigned to apaderno
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I am assigning this issue to me, since I am working on it.

  • Pipeline finished with Success
    8 months ago
    Total: 138s
    #124991
  • Pipeline finished with Success
    8 months ago
    Total: 171s
    #125042
  • Pipeline finished with Success
    8 months ago
    Total: 139s
    #125091
  • Pipeline finished with Success
    8 months ago
    Total: 139s
    #125098
  • Issue was unassigned.
  • Status changed to Needs review 8 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The only shown warning cannot be fixed, since the description for the .install file needs to be Install, update and uninstall functions for the GlobalLink Connect for Drupal module.

  • Status changed to Needs work 4 months ago
  • 🇵🇭Philippines roberttabigue

    Hi @avpaderno,

    I got these errors below when applying MR!3 by using the plain diff to the GlobalLink Connect for Drupal module against 8.x-2.x-dev on my Drupal 10 site.

      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 37882    0 37882    0     0  92760      0 --:--:-- --:--:-- --:--:-- 94000
    Checking patch .gitlab-ci.yml...
    Checking patch composer.json...
    error: while searching for:
        "source": "https://www.drupal.org/project/globallink"
      },
      "require": {
        "drupal/core": "~8.1",
        "drupal/tmgmt": "~1.4",
        "translations-com/globallink-connect-api-php": "4.18.4"
      }
    }
    
    error: patch failed: composer.json:11
    error: composer.json: patch does not apply
    Checking patch config/schema/globallink.schema.yml...
    error: while searching for:
          label: Submission name Prefix
        pd_notify_emails:
          type: string
          label: Space separated list of emails to notify
        pd_combine:
          type: string
          label: Combine all items into a single document
    
    error: patch failed: config/schema/globallink.schema.yml:18
    error: config/schema/globallink.schema.yml: patch does not apply
    Checking patch globallink.info.yml...
    error: while searching for:
      - tmgmt:tmgmt
      - tmgmt:tmgmt_file
    type: module
    
    # Information added by Drupal.org packaging script on 2019-07-22
    version: '8.x-2.0-rc1'
    core: '8.x'
    project: 'globallink'
    datestamp: 1563812593
    
    error: patch failed: globallink.info.yml:7
    error: globallink.info.yml: patch does not apply
    Checking patch globallink.install...
    Checking patch globallink.module...
    error: while searching for:
    <?php
    
    use Drupal\tmgmt\Entity\Job;
    
    /**
     * Implements hook_theme().
    
    error: patch failed: globallink.module:1
    error: globallink.module: patch does not apply
    Checking patch globallink.services.yml...
    Checking patch src/EventSubscriber/GloballinkContinuousEvents.php...
    Checking patch src/GlExchangeAdapter.php...
    error: while searching for:
    <?php
    
    namespace Drupal\globallink;
    use Drupal\Core\Entity\EntityTypeManagerInterface;
    use Drupal\Core\Extension\ModuleHandlerInterface;
    
    
    error: patch failed: src/GlExchangeAdapter.php:1
    error: src/GlExchangeAdapter.php: patch does not apply
    Checking patch src/GlobalLinkTranslatorUi.php...
    error: while searching for:
          '#type' => 'textfield',
          '#title' => t('Emails for notification'),
          '#default_value' => $translator->getSetting('pd_notify_emails'),
          '#description' => t('A space separated list of emails to notify. Leave blank for no notifications'),
        ];
        $form['pd_combine'] = [
          '#type' => 'checkbox',
    
    error: patch failed: src/GlobalLinkTranslatorUi.php:88
    error: src/GlobalLinkTranslatorUi.php: patch does not apply
    Checking patch src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php...
    Hunk #1 succeeded at 8 (offset 1 line).
    Hunk #2 succeeded at 36 (offset 1 line).
    Hunk #3 succeeded at 48 (offset 1 line).
    error: while searching for:
        'ar-DZ' => 'Arabic, Algeria',
        'ar-EG' => 'Arabic, Egypt',
        'ar-IQ' => 'Arabic, Iraq',
        'ar-JO' => 'Arabic, Jordan',
        'ar-KW' => 'Arabic, Kuwait',
        'ar-LB' => 'Arabic, Lebanon',
    
    error: patch failed: src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php:129
    error: src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php: patch does not apply

    I'm moving this to ‘Needs work’ for your review.

    Thank you!

  • Status changed to Needs review 4 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    None of those errors were reported by GitLab CI PHP_CodeSniffer. The purpose of this issue is resolving those errors, not every error in the code.

    If the patch does not apply, it means it is probably applied to an old version of the code.
    Using a patch to verify a merge request is also using a wrong workflow. The issue fork page itself says if the merge request is not updated with the upstream repository; in this case, it says 16 commits ahead of the upstream repository. which means the merge request applies to the project repository.

    The only PHP_CodeSniffer error can be ignored, since Install, update, and uninstall hooks for the GlobalLink Connect for Drupal module. is the correct description for a .install file. It is not possible to tell PHP_CodeSniffer to ignore that line, as that comment must be the first one after the <?php tag, so it is not possible to add another comment before that.

  • Pipeline finished with Success
    4 months ago
    Total: 134s
    #239077
  • Status changed to Needs work 3 months ago
  • 🇵🇭Philippines roberttabigue

    Hi @avpaderno,

    I'm still seeing 1 PHPCS warning in the GitLab CI PHP_CodeSniffer: https://git.drupalcode.org/issue/globallink-3344157/-/jobs/2507007.

    FILE: ...loballink-3344157/web/modules/custom/globallink-3344157/globallink.install
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     5 | WARNING | Line exceeds 80 characters; contains 85 characters
       |         | (Drupal.Files.LineLength.TooLong)
    --------------------------------------------------------------------------------
    Time: 238ms; Memory: 8MB
    PHP CODE SNIFFER REPORT SUMMARY
    --------------------------------------------------------------------------------
    FILE                                                            ERRORS  WARNINGS
    --------------------------------------------------------------------------------
    ...57/web/modules/custom/globallink-3344157/globallink.install  0       1
    --------------------------------------------------------------------------------
    A TOTAL OF 0 ERRORS AND 1 WARNING WERE FOUND IN 6 FILES
    --------------------------------------------------------------------------------
    PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
    ----------------------------------------------------------------------
    SOURCE                                                           COUNT
    ----------------------------------------------------------------------
    Drupal.Files.LineLength.TooLong                                  1
    ----------------------------------------------------------------------
    A TOTAL OF 1 SNIFF VIOLATION WERE FOUND IN 1 SOURCE
    ----------------------------------------------------------------------

    I'm moving this to ‘Needs work’ for your review.

    Thank you!

  • Status changed to Needs review 3 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The only shown warning cannot be fixed, since the description for the .install file needs to be Install, update and uninstall functions for the GlobalLink Connect for Drupal module.

  • Status changed to RTBC 3 months ago
  • 🇵🇭Philippines roberttabigue

    Hi @avpaderno,

    I got it. I'm marking this now as 'RBTC'.

    Thank you.

Production build 0.71.5 2024