Fix the errors/warnings reported by PHP_CodeSniffer

Created on 11 May 2023, over 1 year ago
Updated 22 August 2024, 4 months ago
šŸ“Œ Task
Status

RTBC

Version

2.1

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.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sidharth_soman
  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore

    I am working on fixing the above issue.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Since there are not patches nor MRs, the status is still Active.

  • Status changed to Active over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Assigned to Neha-Verma
  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    A summary must describe what needs to be changed, and eventually why. A screenshot is not sufficient, even in the case a patch/MR is provided.
    In the case of bug reports, the steps to reproduce the bug should be provided too. In the case of coding standards issues found using an automatic tool, the report given by that tool must be quoted too; in the case the report was given by a command, the used command must be shown too (including its parameters).

  • Merge request !3Fixed phpcs issue ā†’ (Open) created by Neha-Verma
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India Neha-Verma

    I have fixed the issues reported by phpcs. Please review! Thanks.

  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The status is for the issue summary, which still does not report the parameters passed to PHP_CodeSniffer.

  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India Neha-Verma

    Updated issue summary.

  • Status changed to Needs work 4 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @Neha-Verma,

    I applied MR!3, however, I encountered an error.

    āžœ  pantheon_advanced_page_cache git:(2.1.2) curl https://git.drupalcode.org/project/pantheon_advanced_page_cache/-/merge_requests/3.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 73918    0 73918    0     0   142k      0 --:--:-- --:--:-- --:--:--  142k
    <stdin>:174: trailing whitespace.
    data (in ways that will interact with both the Global CDN and internal Drupal
    <stdin>:188: trailing whitespace.
    A direct way of inspecting headers is with `curl -I`. This command will make
    <stdin>:189: trailing whitespace.
    a request and show just the response headers. Adding `-H "Pantheon-Debug:1"`
    Checking patch .circleci/config.yml...
    error: while searching for:
    version: 2
    # https://circleci.com/docs/configuration#machine
    jobs:
        build:
            docker:
                - image: quay.io/pantheon-public/build-tools-ci:7.x
            environment:
                TERMINUS_SITE: d9-papc3
            steps:
                - run:
                    name: login-pantheon
    
    error: patch failed: .circleci/config.yml:1
    error: .circleci/config.yml: patch does not apply
    Checking patch .circleci/scripts/setup-drupal-repo.sh...
    error: while searching for:
    set -e
    export TERMINUS_ENV=$CIRCLE_BUILD_NUM
    
    # Bring the code down to Circle so that modules can be added via composer.
    git clone $(terminus connection:info ${TERMINUS_SITE}.dev --field=git_url) --branch $TERMINUS_ENV drupal-site
    cd drupal-site
    
    # requiring other modules below was throwing an error if this dependency was not updated first.
    # I think because the composer.lock file for the site has dev-master as the version for this
    # dependency. But the CI process calling this file runs against a different branch name thanks to the
    
    error: patch failed: .circleci/scripts/setup-drupal-repo.sh:2
    error: .circleci/scripts/setup-drupal-repo.sh: patch does not apply
    Checking patch .github/workflows/ci.yml...
    error: .github/workflows/ci.yml: already exists in working directory
    Checking patch README.md...
    Checking patch composer.lock...
    error: while searching for:
            },
            {
                "name": "guzzlehttp/guzzle",
                "version": "6.5.3",
                "source": {
                    "type": "git",
                    "url": "https://github.com/guzzle/guzzle.git",
                    "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e"
                },
                "dist": {
                    "type": "zip",
                    "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e",
                    "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e",
                    "shasum": ""
                },
                "require": {
                    "ext-json": "*",
                    "guzzlehttp/promises": "^1.0",
                    "guzzlehttp/psr7": "^1.6.1",
                    "php": ">=5.5",
                    "symfony/polyfill-intl-idn": "^1.11"
                },
                "require-dev": {
                    "ext-curl": "*",
    
    error: patch failed: composer.lock:866
    error: composer.lock: patch does not apply
    Checking patch config/install/pantheon_advanced_page_cache.settings.yml...
    error: while searching for:
    override_list_tags: false
    error: patch failed: config/install/pantheon_advanced_page_cache.settings.yml:1
    error: config/install/pantheon_advanced_page_cache.settings.yml: patch does not apply
    Checking patch pantheon_advanced_page_cache.info.yml...
    error: while searching for:
    description: 'Advanced page cache capabilities for Pantheon.'
    package: Performance and scalability
    type: module
    core_version_requirement: ^8 || ^9
    
    error: patch failed: pantheon_advanced_page_cache.info.yml:2
    error: pantheon_advanced_page_cache.info.yml: patch does not apply
    Checking patch pantheon_advanced_page_cache.install...
    error: while searching for:
     */
    
    /**
     * Set override_list_tags to TRUE for backwards compatibility. We recommend manually changing to FALSE for more consistent clearing. See README
     */
    function pantheon_advanced_page_cache_update_8001() {
      \Drupal::configFactory()->getEditable('pantheon_advanced_page_cache.settings')->set('override_list_tags', TRUE)->save();
    }
    
    error: patch failed: pantheon_advanced_page_cache.install:6
    error: pantheon_advanced_page_cache.install: patch does not apply
    Checking patch pantheon_advanced_page_cache.services.yml...
    error: while searching for:
        arguments: ['pantheon_advanced_page_cache']
      pantheon_advanced_page_cache.cache_tags.invalidator:
        class: Drupal\pantheon_advanced_page_cache\CacheTagsInvalidator
        tags:
          - { name: cache_tags_invalidator }
      pantheon_advanced_page_cache.cacheable_response_subscriber:
    
    error: patch failed: pantheon_advanced_page_cache.services.yml:4
    error: pantheon_advanced_page_cache.services.yml: patch does not apply
    Checking patch src/CacheTagsInvalidator.php...
    error: while searching for:
    namespace Drupal\pantheon_advanced_page_cache;
    
    use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
    
    /**
     * Cache tags invalidator implementation that invalidates the Pantheon edge.
     */
    class CacheTagsInvalidator implements CacheTagsInvalidatorInterface {
    
      /**
       * {@inheritdoc}
       */
      public function invalidateTags(array $tags) {
        if (function_exists('pantheon_clear_edge_keys')) {
          pantheon_clear_edge_keys($tags);
        }
    
    error: patch failed: src/CacheTagsInvalidator.php:3
    error: src/CacheTagsInvalidator.php: patch does not apply
    Checking patch src/EventSubscriber/CacheableResponseSubscriber.php...
    error: while searching for:
    namespace Drupal\pantheon_advanced_page_cache\EventSubscriber;
    
    use Drupal\Core\Cache\CacheableResponseInterface;
    use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
    use Symfony\Component\HttpKernel\KernelEvents;
    use Symfony\Component\EventDispatcher\EventSubscriberInterface;
    use Psr\Log\LoggerInterface;
    use Drupal\Core\Logger\RfcLogLevel;
    use Drupal\Core\Config\ConfigFactoryInterface;
    
    /**
     * Adds Surrogate-Key header to cacheable master responses.
    
    error: patch failed: src/EventSubscriber/CacheableResponseSubscriber.php:3
    error: src/EventSubscriber/CacheableResponseSubscriber.php: patch does not apply
    Checking patch tests/behat/helper_classes/AgeTracker.php...
    Checking patch tests/behat/helper_classes/Contexts/FeatureContext.php...
    Checking patch tests/behat/helper_classes/tests/AgeTrackerTest.php...
    Checking patch tests/modules/pantheon_advanced_page_cache_test/pantheon_advanced_page_cache_test.info.yml...
    error: while searching for:
    description: 'Used during automated test of Pantheon Advanced Page Cache'
    package: Testing
    type: module
    core_version_requirement: ^8 || ^9
    
    error: patch failed: tests/modules/pantheon_advanced_page_cache_test/pantheon_advanced_page_cache_test.info.yml:2
    error: tests/modules/pantheon_advanced_page_cache_test/pantheon_advanced_page_cache_test.info.yml: patch does not apply
    Checking patch tests/modules/pantheon_advanced_page_cache_test/src/EventSubscriber/CacheableResponseSubscriber.php...
    error: while searching for:
    namespace Drupal\pantheon_advanced_page_cache_test\EventSubscriber;
    
    use Drupal\Core\Cache\CacheableResponseInterface;
    use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
    use Symfony\Component\HttpKernel\KernelEvents;
    use Symfony\Component\EventDispatcher\EventSubscriberInterface;
    
    /**
     * Adds Surrogate-Key header to cacheable master responses.
    
    error: patch failed: tests/modules/pantheon_advanced_page_cache_test/src/EventSubscriber/CacheableResponseSubscriber.php:3
    error: tests/modules/pantheon_advanced_page_cache_test/src/EventSubscriber/CacheableResponseSubscriber.php: patch does not apply
    āžœ  pantheon_advanced_page_cache git:(2.1.2)
    āžœ  pantheon_advanced_page_cache git:(2.1.2) curl https://git.drupalcode.org/project/pantheon_advanced_page_cache/-/merge_requests/3.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 73918    0 73918    0     0   154k      0 --:--:-- --:--:-- --:--:--  154k
    patching file .circleci/config.yml
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    4 out of 4 hunks ignored -- saving rejects to file .circleci/config.yml.rej
    patching file .circleci/scripts/setup-drupal-repo.sh
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    3 out of 3 hunks ignored -- saving rejects to file .circleci/scripts/setup-drupal-repo.sh.rej
    The next patch would create the file .github/workflows/ci.yml,
    which already exists!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file .github/workflows/ci.yml.rej
    patching file README.md
    patching file composer.lock
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    15 out of 15 hunks ignored -- saving rejects to file composer.lock.rej
    patching file config/install/pantheon_advanced_page_cache.settings.yml
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file config/install/pantheon_advanced_page_cache.settings.yml.rej
    patching file pantheon_advanced_page_cache.info.yml
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file pantheon_advanced_page_cache.info.yml.rej
    patching file pantheon_advanced_page_cache.install
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file pantheon_advanced_page_cache.install.rej
    patching file pantheon_advanced_page_cache.services.yml
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file pantheon_advanced_page_cache.services.yml.rej
    patching file src/CacheTagsInvalidator.php
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file src/CacheTagsInvalidator.php.rej
    patching file src/EventSubscriber/CacheableResponseSubscriber.php
    Hunk #1 FAILED at 3.
    Hunk #2 FAILED at 37.
    Hunk #3 FAILED at 61.
    3 out of 3 hunks FAILED -- saving rejects to file src/EventSubscriber/CacheableResponseSubscriber.php.rej
    patching file tests/behat/helper_classes/AgeTracker.php
    patching file tests/behat/helper_classes/Contexts/FeatureContext.php
    patching file tests/behat/helper_classes/tests/AgeTrackerTest.php
    patching file tests/modules/pantheon_advanced_page_cache_test/pantheon_advanced_page_cache_test.info.yml
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file tests/modules/pantheon_advanced_page_cache_test/pantheon_advanced_page_cache_test.info.yml.rej
    patching file tests/modules/pantheon_advanced_page_cache_test/src/EventSubscriber/CacheableResponseSubscriber.php
    Hunk #1 FAILED at 3.
    Hunk #2 FAILED at 15.
    2 out of 2 hunks FAILED -- saving rejects to file tests/modules/pantheon_advanced_page_cache_test/src/EventSubscriber/CacheableResponseSubscriber.php.rej
    āžœ  pantheon_advanced_page_cache git:(2.1.2)

    Please check and advise.
    Thank you.

  • Pipeline finished with Failed
    4 months ago
    Total: 35s
    #254237
  • First commit to issue fork.
  • Pipeline finished with Failed
    4 months ago
    Total: 36s
    #260769
  • Status changed to Needs review 4 months ago
  • šŸ‡ŗšŸ‡øUnited States joegraduate Arizona, USA

    Did not have access to change the target branch of existing MR to 2.x so I forked it and created another one targeting the 2.x branch and added some composer changes to hopefully make the GitLabCI checks happy.

  • Pipeline finished with Failed
    4 months ago
    Total: 39s
    #260774
  • Pipeline finished with Failed
    4 months ago
    Total: 142s
    #260779
  • Pipeline finished with Success
    4 months ago
    Total: 167s
    #260796
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    avpaderno ā†’ changed the visibility of the branch 3359544-phpcs to hidden.

  • Status changed to RTBC 4 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    4 months ago
    Total: 805s
    #261204
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    avpaderno ā†’ changed the visibility of the branch 3359544-gitlab-ci-reports to hidden.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
Production build 0.71.5 2024