Fix the issues reported by phpcs

Created on 27 July 2020, over 4 years ago
Updated 4 March 2023, almost 2 years ago

Problem/Motivation

There are some Drupal coding standard errors which needs to to be fixed.

Steps to reproduce

Run phpcs --standard=Drupal ./ from the CLI

../../../vendor/bin/phpcs --standard=Drupal ./

FILE: ...leryslider/src/Plugin/Field/FieldFormatter/GallerySliderFieldFormatter.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
   6 | WARNING | [x] Unused use statement
   9 | WARNING | [x] Unused use statement
  34 | ERROR   | [ ] Missing member variable doc comment
  35 | ERROR   | [ ] Missing member variable doc comment
 169 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...git/modules/contrib/galleryslider/src/Plugin/views/style/GallerySlider.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
  7 | WARNING | [x] Unused use statement
 55 | ERROR   | [ ] Missing parameter comment
 55 | ERROR   | [ ] Missing parameter type
 56 | ERROR   | [ ] Missing parameter comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /var/www/html/D-8.9.x-git/modules/contrib/galleryslider/js/slider.js
-----------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-----------------------------------------------------------------------------
   6 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
   7 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 384 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 483 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 484 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 485 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------


FILE: /var/www/html/D-8.9.x-git/modules/contrib/galleryslider/js/gridSlide.js
-----------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
-----------------------------------------------------------------------------
  23 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  26 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  35 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  42 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  97 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 100 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 109 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 116 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 119 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------


FILE: ...var/www/html/D-8.9.x-git/modules/contrib/galleryslider/js/galleryslider.js
--------------------------------------------------------------------------------
FOUND 56 ERRORS AFFECTING 49 LINES
--------------------------------------------------------------------------------
    24 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
    86 | ERROR | [x] Expected 1 space before "|"; 0 found
    86 | ERROR | [x] Expected 1 space after "|"; 0 found
    86 | ERROR | [x] Expected 1 space before "-"; 0 found
    86 | ERROR | [x] Expected 1 space after "-"; 0 found
    86 | ERROR | [x] Expected 1 space before "-"; 0 found
    86 | ERROR | [x] Expected 1 space after "-"; 0 found
    86 | ERROR | [x] Expected 1 space before "/"; 0 found
    86 | ERROR | [x] Expected 1 space after "/"; 0 found
   525 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  1831 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  1905 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  1950 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  1960 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  2035 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2036 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2037 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2038 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2039 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2040 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2041 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2042 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2721 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  2724 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  2727 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 3 empty lines
  2866 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  3123 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  3141 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3142 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3149 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3151 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3152 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3153 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3155 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3157 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3330 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3331 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3332 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3333 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  4883 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  6415 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  6437 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  6667 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  6822 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  6872 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  6887 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  7054 | ERROR | [x] Expected 1 space after first semicolon of FOR loop;
       |       |     newline found
  7771 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  7914 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 3 empty lines
  7916 | ERROR | [ ] More than 2 empty lines are not allowed
  7934 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  7963 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
  8732 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  9684 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
 10221 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
 10277 | ERROR | [x] Functions must not contain multiple empty lines in a row;
       |       |     found 2 empty lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 55 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...r/www/html/D-8.9.x-git/modules/contrib/galleryslider/css/galleryslider.css
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 19 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.31 secs; Memory: 160.01MB

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

RTBC

Version

3.0

Component

Code

Created by

🇮🇳India nitesh624 Ranchi, India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    - * @param null $key
    + * @param string $key
    + *   The default keys in galleryslider settings.
      *
      * @return array|mixed
    + *   An array with all settings key.
    

    Since the parameter is $key and it is a string, probably the default keys (plural) is not correct. It is not even the default key.
    The function does not always return an array. That needs to be made clear.

      * @return mixed
    + *   Formatted js array.
      */
    -function _galleryslider_format_settings($settings) {
    +function _galleryslider_format_settings(array $settings) {

    If it is mixed, it is not an array.

    -  var rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g;
    +  var rvalidescape = /\\(?:["\\\/bfnrt] | u[\da - fA - F]{4}) / g;

    Spaces inside a regular expression are wrong, except in the case they are part of the regular expression, which does not seem in this case.

    +   *    options: an optional list of space-separated options that will change how
    +   *            the callback list behaves or a more traditional option object
    

    Lines are indented by two spaces.

    -   *	once:			will ensure the callback list can only be fired once (like a Deferred)
    +   *    once:            will ensure the callback list can only be fired once (like a Deferred)
    

    The line was already correctly indented (two spaces).

  • First commit to issue fork.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India chaitanyadessai Goa

    Fixed issues reported by phpcs.

  • 🇮🇳India arpitk Indore

    Hi I reviewed the patch #19 it applied cleanly. No more errors/warnings are produced. I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig . to test on version 8.x-3.x-dev and drupal 9.5.9

    Thanks!

  • Hello Folks !!
    Created a patch for galleryslider 8.x-3.x-dev . The patch seems to fix the phpcs issues.
    Can someone please review the patch.

    Thank you for your support!!!

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Patch Failed to Apply
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Build Successful
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Build Successful
  • Status changed to RTBC over 1 year ago
  • 🇮🇳India Anmol_Specbee

    The patch#20 mentioned in the comment#21 is working and is resolving all the issues.

  • @Anmol_Specbee , thanks for confirmation :)

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -/**
    - * @file
    - * Contains galleryslider.module..
    - */

    A module file needs to contain that comment, but the description given there is Hook implementations for the Gallery Slider for Multiple Images module. (assuming that the module name shown in the .info.yml file is Gallery Slider for Multiple Images).

    diff --git a/galleryslider.module b/galleryslider.module
    index b3ea4ce..52553c2 100644
    --- a/galleryslider.module
    +++ b/galleryslider.module
    @@ -1,159 +1,89 @@
     <?php
     
    -/**
    - * @file
    - * Contains galleryslider.module..
    - */
    +namespace Drupal\galleryslider\Plugin\views\style;
     
    -use Drupal\Core\Routing\RouteMatchInterface;
    +use Drupal\Core\Form\FormStateInterface;
    +use Drupal\views\Plugin\views\style\StylePluginBase;
     
     /**
    - * Implements hook_help().
    + * Style plugin to render each item into a simple carousel.
      *
    - * @param $route_name
    - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
    + * @ingroup views_style_plugins
      *
    - * @return string
    + * @ViewsStyle(
    + *   id = "galleryslider",
    + *   title = @Translation("Gallery Slider"),
    + *   help = @Translation("Displays rows as a gallery slider."),
    + *   theme = "galleryslider_views",
    + *   display_types = {"normal"}
    + * )
      */
    -function galleryslider_help($route_name, RouteMatchInterface $route_match) {
    -  switch ($route_name) {
    -    // Main module help for the simple module.
    -    case 'help.page.galleryslider':
    -      $output = '';
    -      $output .= '<h3>' . t('About') . '</h3>';
    -      $output .= '<p>' . t('simple Carousel: Download code at drupal.org') . '</p>';
    -      $output .= '<p>' . t('Video tutorial will be uploaded soon') . '</p>';
    -      return $output;
    -
    -    default:
    -  }
    -}
    +class GallerySlider extends StylePluginBase {
     
    -/**
    - * Implements hook_theme().
    - */
    -function galleryslider_theme() {
    -  return [
    -    'galleryslider' => [
    -      'variables' => ['items' => NULL, 'settings' => NULL],
    -    ],
    -    'galleryslider_views' => [
    -      'variables' => [],
    -    ],
    -  ];
    -}
    -
    -/**
    - * Themeable for galleryslider.
    - *
    - * @param $variables
    - */
    -function template_preprocess_galleryslider(&$variables) {
    -  $items = $variables['items'];
    -  $settings = _galleryslider_format_settings($variables['settings']);
    -  $variables['attributes']['class'][] = 'slider';
    -  $variables['attributes']['class'][] = '';
    -  $variables['attributes']['data-settings'] = json_encode($settings);
    -  $html = '';
    -  if (!empty($items)) {
    -    $i = 0;
    -    $html .= '<ul data-title="Row">';
    -    foreach ($items as $item) {
    -      $html .= '<li  ' . $i . '>' . render($item) . '</li>';
    -      $i++;
    -    }
    -  }
    +  /**
    +   * Indicates whether the style plugin allows the use of row plugins.
    +   *
    +   * @var bool
    +   */
    +  protected $usesRowPlugin = TRUE;
     
    -  $html .= '</ul>';
    -  $output = [
    -    '#type' => 'markup',
    -    '#markup' => $html,
    -  ];
    -  $variables['output'] = render($output);
    -}
    +  /**
    +   * Indicates whether the style plugin supports custom CSS class for the rows.
    +   *
    +   * @var bool
    +   */
    +  protected $usesRowClass = TRUE;
     
    -/**
    - * Prepares variables for Views galleryslider carousel templates.
    - *
    - * Default template: galleryslider-views.html.twig.
    - *
    - * @param array $variables
    - *   An associative array containing:
    - *   - view: A View object.
    - */
    -function template_preprocess_galleryslider_views(array &$variables) {
    -  $handler = $variables['view']->style_plugin;
    -  $settings = _galleryslider_format_settings($handler->options);
    -  $variables['attributes']['class'][] = 'slider ';
    -  $variables['attributes']['class'][] = '';
    -  $variables['attributes']['data-settings'] = json_encode($settings);
    -  template_preprocess_views_view_unformatted($variables);
    -}
    +  /**
    +   * Defines the default options for the style plugin.
    +   */
    +  protected function defineOptions() {
    +    $options = parent::defineOptions();
     
    -/**
    - * Settings to display view at front page.
    - *
    - * @param $variables
    - */
    -function galleryslider_preprocess_page(&$variables) {
    -  $node = \Drupal::routeMatch()->getParameter('node');
    -  $frontpage = \Drupal::service('path.matcher')->isFrontPage();
    -  if ($node || $frontpage) {
    -    $variables['#attached']['library'][] = 'galleryslider/galleryslider';
    +    $settings = _galleryslider_default_settings();
    +    foreach ($settings as $k => $v) {
    +      $options[$k] = ['default' => $v];
    +    }
    +    return $options;
       }
    -}
     
    -/**
    - * Default settings for simple.
    - *
    - * @param null $key
    - *
    - * @return array|mixed
    - */
    -function _galleryslider_default_settings($key = NULL) {
    -  $settings = [
    -    'menu' => 'grid',
    -    'imgGrid' => '',
    -    'speed' => 300,
    -    'image_style' => '',
    -    'image_link' => '',
    -  ];
    -
    -  return isset($settings[$key]) ? $settings[$key] : $settings;
    -}
    

    Removing the hook implementations from that file to add a class (which should not be placed in a .module file) is blatantly wrong.

  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • hello @apaderno, hope you are doing well.
    updated the patch addressed #24 issues.
    kindly review the updated patch.
    Thank you for your support.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    diff --git a/galleryslider.module b/galleryslider.module
    index 52553c2..ff875fd 100644
    --- a/galleryslider.module
    +++ b/galleryslider.module
    @@ -1,89 +1,166 @@
     <?php
     
    -namespace Drupal\galleryslider\Plugin\views\style;
    +/**
    + * @file
    + * Contains the Gallery Slider for Multiple Images module.
    + */

    I take the patch is created from the wrong files, since the first lines from the galleryslider.module are the following one.

    <?php
    
    /**
     * @file
     * Contains galleryslider.module..
     */
    
    use Drupal\Core\Routing\RouteMatchInterface;
    
    /**
     * Implements hook_help().
     *
     * @param $route_name
     * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
     *
     * @return string
     */
    
  • 🇮🇳India AkashKumar07

    This patch addresses the #11 changes. Please review.
    Thanks!

  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • Status changed to Needs review over 1 year ago
  • The last submitted patch, 27: 3161596-27.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • 🇮🇳India zkhan.aamir

    Hi,

    Patch #27 applied successfully.

    Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/galleryslider (8.x-3.x)
    $ curl https://www.drupal.org/files/issues/2023-06-22/3161596-27.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 17884  100 17884    0     0  33384      0 --:--:-- --:--:-- --:--:-- 33490
    patching file css/galleryslider.css
    patching file galleryslider.module
    patching file js/galleryslider.js
    patching file js/gridSlide.js
    patching file js/slider.js
    patching file src/Plugin/Field/FieldFormatter/GallerySliderFieldFormatter.php
    patching file src/Plugin/views/style/GallerySlider.php
    

    All the issue resolved.

  • Hi, patch #27 applied cleanly but it not fixes all the phpcs issues.

    phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml galleryslider/
    
    FILE: C:\Users\Nisha\galleryslider\css\galleryslider.css
    ----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\galleryslider\css\gridslide.css
    ----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\galleryslider\galleryslider.install
    ----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\galleryslider\galleryslider.module
    ------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------
       1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     121 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\galleryslider\src\Plugin\Field\FieldFormatter\GallerySliderFieldFormatter.php
    -----------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------
       1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
     172 | WARNING | [x] 'TODO: Implement settings summary.' should match the format '@todo Fix problem
         |         |     X here.'
     242 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
    -----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------
    
    
    FILE: C:\Users\Nisha\galleryslider\src\Plugin\views\style\GallerySlider.php
    ----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------
    
    Time: 474ms; Memory: 10MB
    
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    Waiting for branch to pass
  • Pipeline finished with Canceled
    12 months ago
    Total: 67s
    #118978
  • Pipeline finished with Success
    12 months ago
    Total: 196s
    #118980
  • haris khan jadoon changed the visibility of the branch 3161596-fix-the-issues to hidden.

  • 🇵🇭Philippines roberttabigue

    Hi,

    I have applied the latest MR !4 to the Gallery Slider for Multiple Images module with 8.x-3.x-dev and confirmed all PHPCS errors have been fixed. Please see the attached file for reference.

    However, when I reran the PHPCS in the GitLab CI pipeline, the jobs failed to pass.

    Running with gitlab-runner 17.8.1 (a1fca00e)
      on gitlab-runner-5d87599478-mlgfr s8ex1X2yJ, system ID: r_5VJgs5AORaQn
    Resolving secrets
    Preparing the "kubernetes" executor
    00:00
    "CPURequest" overwritten with "2"
    Using Kubernetes namespace: gitlab-runner
    Using Kubernetes executor with image drupalci/php-8.1-apache:production ...
    Using attach strategy to execute scripts...
    Preparing environment
    00:31
    Using FF_USE_POD_ACTIVE_DEADLINE_SECONDS, the Pod activeDeadlineSeconds will be set to the job timeout: 1h0m0s...
    Waiting for pod gitlab-runner/runner-s8ex1x2yj-project-107719-concurrent-0-h2y792bb to be running, status is Pending
    Running on runner-s8ex1x2yj-project-107719-concurrent-0-h2y792bb via gitlab-runner-5d87599478-mlgfr...
    Getting source from Git repository
    00:02
    Fetching changes with git depth set to 50...
    Initialized empty Git repository in /builds/issue/galleryslider-3161596/.git/
    Created fresh repository.
    Checking out 15fa264a as detached HEAD (ref is apaderno-8.x-3.x-patch-7f68)...
    Skipping Git submodules setup
    Downloading artifacts
    00:09
    Downloading artifacts for composer (1063176)...
    Downloading artifacts from coordinator... ok        host=drupal-gitlab-job-artifacts.s3.us-west-2.amazonaws.com id=1063176 responseStatus=200 OK token=glcbt-64
    Executing "step_script" stage of the job script
    00:02
    $ [[ $_CURL_TEMPLATES_REF == "" ]] && export _CURL_TEMPLATES_REF=$_GITLAB_TEMPLATES_REF # collapsed multi-line command
    $ test -f phpcs.xml.dist || curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/scripts/phpcs.xml.dist
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 47203    0 47203    0     0   331k      0 --:--:-- --:--:-- --:--:--  331k
    $ vendor/bin/phpcs --version
    PHP_CodeSniffer version 3.9.0 (stable) by Squiz and PHPCSStandards
    $ composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}';
    dealerdirect/phpcodesniffer-composer-installer 1.0.0
    drupal/coder 8.3.23
    sirbrillig/phpcs-variable-analysis 2.11.17
    slevomat/coding-standard 8.15.0
    squizlabs/php_codesniffer 3.9.0
    $ vendor/bin/phpcs --config-show installed_paths
    Using config file: /builds/issue/galleryslider-3161596/vendor/squizlabs/php_codesniffer/CodeSniffer.conf
    installed_paths: ../../drupal/coder/coder_sniffer,../../sirbrillig/phpcs-variable-analysis,../../slevomat/coding-standard
    $ vendor/bin/phpcs -i
    The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Drupal, DrupalPractice, VariableAnalysis and SlevomatCodingStandard
    $ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source
    ERROR: Ruleset /builds/issue/galleryslider-3161596/phpcs.xml.dist is not valid
    - On line 10, column 8: Opening and ending tag mismatch: meta line 4 and head
    - On line 73, column 9: Opening and ending tag mismatch: head line 4 and html
    - On line 74, column 1: EndTag: '</' not found
    Run "phpcs --help" for usage information
    Uploading artifacts for failed job
    00:00
    Uploading artifacts...
    WARNING: junit.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/issue/galleryslider-3161596) 
    ERROR: No files to upload                          
    Uploading artifacts...
    WARNING: junit.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/issue/galleryslider-3161596) 
    ERROR: No files to upload                          
    Cleaning up project directory and file based variables
    00:01
    ERROR: Job failed: command terminated with exit code 1

    Please refer to this link: https://git.drupalcode.org/issue/galleryslider-3161596/-/jobs/4152058

    I'm moving this to 'Needs work' for now.

    Thank you.

Production build 0.71.5 2024