Fix the PHP_CodeSniffer warnings/errors shown in GitLab CI tests

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

GitLab CI reports PHP_CodeSniffer issues for this project. These issues should be fixed.

FILE: .../modules/custom/subrequests-3422416/tests/src/Unit/SubrequestsTreeTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 15 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 28 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...dules/custom/subrequests-3422416/tests/src/Unit/SubrequestsManagerTest.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
  6 | ERROR | [x] Use statements should be sorted alphabetically. The first
    |       |     wrong one is Drupal\subrequests\JsonPathReplacer.
    |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 27 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 32 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...modules/custom/subrequests-3422416/tests/src/Unit/JsonPathReplacerTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 21 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...requests-3422416/tests/src/Unit/Normalizer/MultiresponseNormalizerTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 15 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 20 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
 25 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 34 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ests-3422416/tests/src/Unit/Normalizer/MultiresponseJsonNormalizerTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 16 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 21 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
 26 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 35 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...uests-3422416/tests/src/Unit/Normalizer/JsonSubrequestDenormalizerTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 18 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 23 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
 52 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 61 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...quests-3422416/tests/src/Unit/Normalizer/JsonBlueprintDenormalizerTest.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first
    |         |     wrong one is
    |         |     Drupal\subrequests\Normalizer\JsonBlueprintDenormalizer.
    |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 19 | ERROR   | [ ] Missing short description in doc comment
    |         |     (Drupal.Commenting.DocComment.MissingShort)
 24 | ERROR   | [x] Missing function doc comment
    |         |     (Drupal.Commenting.FunctionComment.Missing)
 30 | ERROR   | [ ] Missing short description in doc comment
    |         |     (Drupal.Commenting.DocComment.MissingShort)
 39 | ERROR   | [x] Missing function doc comment
    |         |     (Drupal.Commenting.FunctionComment.Missing)
 48 | ERROR   | [x] Missing function doc comment
    |         |     (Drupal.Commenting.FunctionComment.Missing)
 64 | ERROR   | [x] Comments may not appear after statements
    |         |     (Drupal.Commenting.PostStatementComment.Found)
 64 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
    |         |     question marks, colons, or closing parentheses
    |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 82 | WARNING | [x] A comma should follow the last multiline array item. Found:
    |         |     'lorem?{{ipsum}}' (Drupal.Arrays.Array.CommaLastItem)
 84 | WARNING | [x] A comma should follow the last multiline array item. Found:
    |         |     ) (Drupal.Arrays.Array.CommaLastItem)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...stom/subrequests-3422416/tests/src/Unit/Blueprint/BlueprintManagerTest.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
  7 | ERROR | [x] Use statements should be sorted alphabetically. The first
    |       |     wrong one is Drupal\Core\Cache\CacheableResponse.
    |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 25 | ERROR | [ ] Missing short description in doc comment
    |       |     (Drupal.Commenting.DocComment.MissingShort)
 30 | ERROR | [x] Missing function doc comment
    |       |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...stom/subrequests-3422416/tests/modules/subrequests_test/src/TestPolicy.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 24 | ERROR | Missing parameter comment
    |       | (Drupal.Commenting.FunctionComment.MissingParamComment)
--------------------------------------------------------------------------------
FILE: ...sts-3422416/web/modules/custom/subrequests-3422416/src/SubrequestsTree.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 22 | ERROR | [ ] Missing parameter comment
    |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 34 | ERROR | [ ] Description for the @return value is missing
    |       |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 53 | ERROR | [x] Return type must not contain variable name "$request"
    |       |     (Drupal.Commenting.FunctionComment.ReturnVarName)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...-3422416/web/modules/custom/subrequests-3422416/src/SubrequestsManager.php
--------------------------------------------------------------------------------
FOUND 14 ERRORS AND 1 WARNING AFFECTING 15 LINES
--------------------------------------------------------------------------------
  6 | WARNING | [x] Unused use statement
    |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
 10 | ERROR   | [x] Missing class doc comment
    |         |     (Drupal.Commenting.ClassComment.Missing)
 39 | ERROR   | [x] Missing function doc comment
    |         |     (Drupal.Commenting.FunctionComment.Missing)
 57 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 3
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 58 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 59 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 60 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 61 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 77 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 78 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 79 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 81 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 82 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 83 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 5
    |         |     (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)
 86 | ERROR   | [x] Closing brace indented incorrectly; expected 3 spaces,
    |         |     found 2 (Drupal.WhiteSpace.ScopeClosingBrace.Indent)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...requests-3422416/web/modules/custom/subrequests-3422416/src/Subrequest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
 43 | WARNING | [ ] Property name "$_resolved" should not be prefixed with an
    |         |     underscore to indicate visibility
    |         |     (Drupal.Classes.PropertyDeclaration.Underscore)
 43 | ERROR   | [ ] Class property $_resolved should use lowerCamel naming
    |         |     without underscores
    |         |     (Drupal.NamingConventions.ValidVariableName.LowerCamelName)
 69 | ERROR   | [x] Missing function doc comment
    |         |     (Drupal.Commenting.FunctionComment.Missing)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ts-3422416/web/modules/custom/subrequests-3422416/src/JsonPathReplacer.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 9 LINES
--------------------------------------------------------------------------------
   6 | ERROR   | [x] Use statements should be sorted alphabetically. The first
     |         |     wrong one is Drupal\Component\Serialization\Json.
     |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
  10 | ERROR   | [x] Missing class doc comment
     |         |     (Drupal.Commenting.ClassComment.Missing)
  36 | ERROR   | [ ] Doc comment short description must be on a single line,
     |         |     further text should be a separate paragraph
     |         |     (Drupal.Commenting.DocComment.ShortSingleLine)
 116 | ERROR   | [x] Expected 1 space after FOREACH keyword; 0 found
     |         |     (Drupal.ControlStructures.ControlSignature.SpaceAfterKeyword)
 230 | ERROR   | [ ] Parameter $pool is not described in comment
     |         |     (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
 246 | ERROR   | [ ] Missing parameter name
     |         |     (Drupal.Commenting.FunctionComment.MissingParamName)
 259 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
     |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 343 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ] (Drupal.Arrays.Array.CommaLastItem)
 349 | ERROR   | [ ] Parameter $provided_id is not described in comment
     |         |     (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...s/custom/subrequests-3422416/src/Normalizer/JsonSubrequestDenormalizer.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------
 19 | ERROR | Parameter comment must start with a capital letter
    |       | (Drupal.Commenting.FunctionComment.ParamCommentNotCapital)
 21 | ERROR | Parameter comment must start with a capital letter
    |       | (Drupal.Commenting.FunctionComment.ParamCommentNotCapital)
 23 | ERROR | Parameter comment must start with a capital letter
    |       | (Drupal.Commenting.FunctionComment.ParamCommentNotCapital)
 25 | ERROR | Parameter comment must start with a capital letter
    |       | (Drupal.Commenting.FunctionComment.ParamCommentNotCapital)
 27 | ERROR | Description for the @return value is missing
    |       | (Drupal.Commenting.FunctionComment.MissingReturnComment)
 71 | ERROR | Doc comment short description must be on a single line, further
    |       | text should be a separate paragraph
    |       | (Drupal.Commenting.DocComment.ShortSingleLine)
 80 | ERROR | Description for the @return value is missing
    |       | (Drupal.Commenting.FunctionComment.MissingReturnComment)
--------------------------------------------------------------------------------
FILE: ...es/custom/subrequests-3422416/src/Normalizer/JsonBlueprintDenormalizer.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  16 | ERROR | [x] Use statements should be sorted alphabetically. The first
     |       |     wrong one is Symfony\Component\Serializer\Serializer.
     |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
  23 | ERROR | [ ] Missing short description in doc comment
     |       |     (Drupal.Commenting.DocComment.MissingShort)
 171 | ERROR | [x] Expected 1 blank line after function; 2 found
     |       |     (Squiz.WhiteSpace.FunctionSpacing.After)
 227 | ERROR | [x] Data types in @return tags need to be fully namespaced
     |       |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
 227 | ERROR | [x] Data types in @return tags need to be fully namespaced
     |       |     (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: .../web/modules/custom/subrequests-3422416/src/Controller/FrontController.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
  7 | WARNING | [x] Unused use statement
    |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
  8 | WARNING | [x] Unused use statement
    |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
 12 | WARNING | [x] Unused use statement
    |         |     (Drupal.Classes.UnusedUseStatement.UnusedUse)
 19 | ERROR   | [ ] Missing short description in doc comment
    |         |     (Drupal.Commenting.DocComment.MissingShort)
 24 | ERROR   | [ ] Missing short description in doc comment
    |         |     (Drupal.Commenting.DocComment.MissingShort)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------
------------------
FILE: .../web/modules/custom/subrequests-3422416/src/Blueprint/BlueprintManager.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------
  12 | ERROR   | [x] Missing class doc comment
     |         |     (Drupal.Commenting.ClassComment.Missing)
  25 | ERROR   | [ ] Parameter $request is not described in comment
     |         |     (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
  31 | ERROR   | [ ] Description for the @return value is missing
     |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
  43 | ERROR   | [ ] Missing short description in doc comment
     |         |     (Drupal.Commenting.DocComment.MissingShort)
 110 | WARNING | [x] The variable name should be defined after the type
     |         |     (Drupal.Commenting.InlineVariableComment.VarInlineOrder)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 332ms; Memory: 6MB
📌 Task
Status

Closed: outdated

Version

3.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sidharth_soman
  • Issue was unassigned.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    4 pass, 4 fail
  • 🇮🇳India Ashutosh Ahirwal India

    Providing patch with phpcs issue fixes and also issue summary updated.

  • Status changed to Needs work over 1 year ago
  • 🇮🇳India Shreya_98

    Providing patch with phpcs issue fixes .This patch fixed all the phpcs issues .Kindly check and review it.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    5 pass, 4 fail
  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama India

    There were still phpcs errors an warning. Providing the updated patch.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    8 pass
  • Status changed to RTBC over 1 year ago
  • Hi @nitin_lama, I have applied your patch and run successfully .

    These are the steps I followed:

    1. Took clone from git version 3.x in drupal 10.1.x

    2. Ran this command:

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig modules/contrib/subrequests/

    3. Applied patch and again ran phpcs command.

    found no errors.

    Moving to RTBC.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    + * The BlueprintManager class handles the creation and management of
    + * blueprints used for generating Subrequests within the Subrequests module.

    It is for generating sub-requests.

    +  /**
    +   * Class BlueprintManager.
    +   *
    +   * @package Drupal\subrequests\Blueprint
    +   */
       public function __construct(Serializer $serializer) {

    The description just repeats the class name, which is also wrong since that description is for the constructor, not the class. Either the constructor is not documented (as the updated Drupal coding standards say to do), or its documentation comment describes the method purpose and its parameters.
    @package Drupal\subrequests\Blueprint is used for classes, not their methods.

      /**
    +   * The Subrequests Manager service.

    Only the first word must be capitalized.

    +   * Constructs a new object with the provided logger.
    +   *
    +   * @param \Psr\Log\LoggerInterface $logger
    +   *   The logger service used for logging.
    +   */

    Since the documentation comment is provided, it should include the name-spaced class name.
    The logger service. is sufficient.

    -  public $_resolved;
    +  public $resolved;

    Since that is a public property, changing its name is not a BC change.

    +  /**
    +   * Constructs a Subrequest object.
    +   *

    Since the documentation comment is provided, it must include the class namespace.

    +  protected function processBatchesSequence(SubrequestsTree $tree, $_sequence = 0, array $_responses = []) {
    +    $batch = $tree[$_sequence];
    +    // Perform all the necessary replacements for the elements in the batch.
    +    $batch = $this->replacer->replaceBatch($batch, $_responses);
    +    $results = array_map(function (Subrequest $subrequest) use ($tree) {
    +      $master_request = $tree->getMasterRequest();
    +      // Create a Symfony Request object based on the Subrequest.
    +      /** @var \Symfony\Component\HttpFoundation\Request $request */
    +      $request = $this->serializer->denormalize(
    +        $subrequest,
    +        Request::class,
    +        NULL,
    +        ['master_request' => $master_request]
    +      );
    +      $response = $this->httpKernel
    +        ->handle($request, HttpKernelInterface::MASTER_REQUEST);
    +      // Set the Content-ID header in the response.
    +      $content_id = sprintf('<%s>', $subrequest->requestId);
    +      $response->headers->set('Content-ID', $content_id);
    +      return $response;
    +    }, $batch);
    +    // Accumulate the responses for the current batch.
    +    $_responses = array_merge($_responses, $results);

    Parameter names do not start with underscores. Since its a parameter, its name can be corrected.

    +   * The System Under Test (SUT) - BlueprintManager instance.
    +   *
        * @var \Drupal\subrequests\Blueprint\BlueprintManager

    The System Under Test (SUT) - is not necessary. The property must be described as other properties are.

    +   * The JsonBlueprintDenormalizer instance for testing.
    +   *
        * @var \Drupal\subrequests\Normalizer\JsonBlueprintDenormalizer

    The class name is already given in the @var line; there is no need to repeat it.

  • 🇮🇳India pray_12

    Preethy_ray → made their first commit to this issue’s fork.

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    8 pass
  • 🇮🇳India pray_12

    Phpcs issues are fixed.

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I did not have time to review all the patch, but I would like to point out this wrong change.

    +  /**
    +   * Constructs an instance of MyClass.
    +   *

    The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.
    The class is BlueprintManager, not MyClass.

  • 🇮🇳India sakthi_dev

    Addressed the comment #14. Please review.

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    8 pass
  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +   * @param \Symfony\Component\HttpFoundation\Request $request
    +   *   The HTTP request object associated with the input.

    *The active request.* is probably sufficient.

        * @return \Drupal\subrequests\SubrequestsTree
    +   *   A subrequest tree prepared for execution based on the provided input.
        */

    based on the provided input is not necessary.

       /**
    +   * Blueprint Manager instance for handling blueprints.
    +   *
    +   * This variable holds an instance of the BlueprintManager class,
    +   * responsible for handling and managing blueprints within the system.
    +   *
        * @var \Drupal\subrequests\Blueprint\BlueprintManager
        */
       protected $blueprintManager;


    The Blueprint manager.
    is sufficient. There is no need to use a long description which essentially repeats what the short description says.

    +   * Subrequests Manager instance for handling subrequests.
    +   *
    +   * This variable holds an instance of the SubrequestsManager class,
    +   * responsible for managing and handling subrequests within the system.
    +   *
        * @var \Drupal\subrequests\SubrequestsManager
        */

    The subrequest manager. is sufficient.

    +/**
    + * Handles replacing JSON paths within data structures.
    + */


    Replaces JSON paths with data structures.
    is sufficient.

    -   * Searches for JSONPath tokens in the request and replaces it with the values
    -   * from previous responses.
    +   * Searches for JSONPath tokens in the request and replaces it with values.
    +   *
    +   * From previous responses.

    Splitting a short description in a short description and a long description like that is wrong. If the problem is the length of the short description, the short description must be rewritten. Replaces JSONPath tokens in the request. should be shorter than 80 characters.

       /**
    +   * Serializer instance for data serialization and deserialization.
    +   *
        * @var \Symfony\Component\Serializer\Serializer

    The serializer. is sufficient.

    +  /**
    +   * Constructor for initializing the object with a logger.
    +   *
    +   * @param \Psr\Log\LoggerInterface $logger
    +   *   The logger instance used for logging purposes.
    +   */
       public function __construct(LoggerInterface $logger) {

    The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.
    The logger. is sufficient to describe $logger.

    -   * @return SubrequestsTree
    +   * @return \Drupal\subrequests\SubrequestsTree
        *   The sequence of IDs grouped by execution order.

    Since the return value is an instance of \Drupal\subrequests\SubrequestsTree, it cannot be a sequence of IDs.

    -  public $_resolved;
    +  public $resolved;

    Since it is changing the name of a public property, that is not a BC change. It should be better to open a new issue for that type of change.

    +  /**
    +   * Convert the object to its string representation.
    +   *
    +   * This method is invoked when an object is used in a string context.
    +   *
    +   * @return string
    +   *   The string representation of the object.
    +   */
       public function __toString() {

    Since that is a magic method used by PHP, the long description is not necessary.

    +  /**
    +   * Set up the test environment before each test method runs.
    +   *
    +   * This method is called before each test method to prepare the test
    +   * environment or perform any necessary initialization steps.
    +   */
       protected function setUp(): void {
         parent::setUp();

    Methods inherited from a parent class or defined in an interface have a simpler documentation comment.

  • First commit to issue fork.
  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama India
  • 🇮🇳India nitin_lama India

    Addressed comment #17. Providing updated patch.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 12 months ago
    Patch Failed to Apply
  • Merge request !25#3357024: MR for the changes. → (Open) created by nitin_lama
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 12 months ago
    9 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 12 months ago
    9 pass
  • Status changed to Needs review 12 months ago
  • 🇮🇳India nitin_lama India

    Please review. Thanks.

  • 🇮🇳India nitin_lama India
  • Issue was unassigned.
  • 🇮🇳India nitin_lama India
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 11 months ago
    Patch Failed to Apply
  • Status changed to Needs work 11 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    There are merge conflicts that must be manually fixed.

  • 🇮🇳India zkhan.aamir

    Hi,

    I applied patch #27,

    Patch not applying properly, getting rejected, Please check

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/subrequests (3.x)
    $ curl https://www.drupal.org/files/issues/2024-02-08/subrequests.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 22331  100 22331    0     0  60697      0 --:--:-- --:--:-- --:--:-- 61013
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/Blueprint/BlueprintManager.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/Controller/FrontController.php
    Hunk #2 FAILED at 14.
    1 out of 2 hunks FAILED -- saving rejects to file src/Controller/FrontController.php.rej
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/JsonPathReplacer.php
    Hunk #4 FAILED at 259.
    1 out of 5 hunks FAILED -- saving rejects to file src/JsonPathReplacer.php.rej
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/Normalizer/JsonBlueprintDenormalizer.php
    Hunk #4 succeeded at 175 (offset 14 lines).
    Hunk #5 succeeded at 228 (offset 14 lines).
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/Normalizer/JsonSubrequestDenormalizer.php
    Hunk #2 FAILED at 131.
    1 out of 2 hunks FAILED -- saving rejects to file src/Normalizer/JsonSubrequestDenormalizer.php.rej
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/Subrequest.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/SubrequestsManager.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file src/SubrequestsTree.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/Blueprint/BlueprintManagerTest.php
    Hunk #1 FAILED at 2.
    Hunk #2 FAILED at 10.
    Hunk #3 succeeded at 27 with fuzz 1.
    2 out of 3 hunks FAILED -- saving rejects to file tests/src/Unit/Blueprint/BlueprintManagerTest.php.rej
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/JsonPathReplacerTest.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/Normalizer/JsonBlueprintDenormalizerTest.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/Normalizer/JsonSubrequestDenormalizerTest.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/Normalizer/MultiresponseJsonNormalizerTest.php
    Hunk #2 succeeded at 35 with fuzz 1.
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/Normalizer/MultiresponseNormalizerTest.php
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/SubrequestsManagerTest.php
    Hunk #2 succeeded at 9 with fuzz 1.
    Hunk #3 succeeded at 29 (offset 1 line).
    (Stripping trailing CRs from patch; use --binary to disable.)
    patching file tests/src/Unit/SubrequestsTreeTest.php
    
  • Merge request !27Resolve #3357024 "Fix the issues" → (Open) created by sakthi_dev
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    7 pass, 2 fail
  • 🇮🇳India sakthi_dev

    sakthi_dev → changed the visibility of the branch 3.x to hidden.

  • Pipeline finished with Failed
    10 months ago
    Total: 143s
    #90584
  • 🇮🇳India zkhan.aamir

    Hi,

    MR #29 applied successfully.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/subrequests (3.x)
    $ curl https://git.drupalcode.org/project/subrequests/-/merge_requests/27.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 34625    0 34625    0     0  77044      0 --:--:-- --:--:-- --:--:-- 77287
    patching file SPECIFICATION.md
    patching file src/Blueprint/BlueprintManager.php
    patching file src/Controller/FrontController.php
    patching file src/JsonPathReplacer.php
    patching file src/Normalizer/JsonBlueprintDenormalizer.php
    patching file src/Normalizer/JsonSubrequestDenormalizer.php
    patching file src/Normalizer/MultiresponseJsonNormalizer.php
    patching file src/Subrequest.php
    patching file src/SubrequestsManager.php
    patching file src/SubrequestsTree.php
    patching file tests/src/Unit/Blueprint/BlueprintManagerTest.php
    patching file tests/src/Unit/JsonPathReplacerTest.php
    patching file tests/src/Unit/Normalizer/JsonBlueprintDenormalizerTest.php
    patching file tests/src/Unit/Normalizer/JsonSubrequestDenormalizerTest.php
    patching file tests/src/Unit/Normalizer/MultiresponseJsonNormalizerTest.php
    patching file tests/src/Unit/Normalizer/MultiresponseNormalizerTest.php
    patching file tests/src/Unit/SubrequestsManagerTest.php
    patching file tests/src/Unit/SubrequestsTreeTest.php
    

    Still some issues remaining

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules
    $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml subrequests/
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\subrequests\src\Normalizer\JsonBlueprintDenormalizer.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
     47 | WARNING | Line exceeds 80 characters; contains 86 characters
    -----------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\subrequests\src\Subrequest.php
    ------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------
     43 | WARNING | Property name "$_resolved" should not be prefixed with an underscore to indicate visibility
     43 | ERROR   | Class property $_resolved should use lowerCamel naming without underscores
    ------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\subrequests\tests\modules\subrequests_test\src\TestPolicy.php
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------
     24 | ERROR | Missing parameter comment
    ----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\subrequests\tests\modules\subrequests_test\subrequests_test.routing.yml
    --------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------------------------
      6 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
     13 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
    --------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\subrequests\tests\src\Unit\Blueprint\BlueprintManagerTest.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     63 | ERROR | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
    -------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 576ms; Memory: 12MB
    

    .

  • 🇮🇳India Jasjeet Kaur Brar

    Jasjeet Kaur Brar → made their first commit to this issue’s fork.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    7 pass, 2 fail
  • Status changed to Needs review 10 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    Patch Failed to Apply
  • Pipeline finished with Failed
    10 months ago
    Total: 139s
    #98452
  • Status changed to Needs work 10 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Since this module uses GitLab CI, it is better to see what GitLab CI complains about, and fix its report.

  • Assigned to ankitv18
  • 🇮🇳India ankitv18

    ankitv18 → changed the visibility of the branch 3357024-phpcs-ci-job-fix to hidden.

  • Issue was unassigned.
  • Status changed to Closed: outdated 6 months ago
Production build 0.71.5 2024