Fix the warnings reported by PHP_CodeSniffer

Created on 16 August 2023, over 1 year ago
Updated 15 August 2024, 3 months ago
šŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

šŸ‡«šŸ‡·France bakop Lille

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 @bakop
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡«šŸ‡·France bakop Lille
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • First commit to issue fork.
  • šŸ‡®šŸ‡³India mukhtarm

    Addressed the MR comments, please review

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

    In Constructs an ImageStyleImageFormatter object. there is no namespace.

  • šŸ‡®šŸ‡³India mukhtarm

    @apaderno Can you clarify a bit more? The namespace is included in as the first line in the class

    namespace Drupal\field_image_style\Plugin\Field\FieldFormatter;

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

    Constructs an ImageStyleImageFormatter object. does not contain any namespace. What the namespace for the file is does not matter.

  • Assigned to bakop
  • šŸ‡«šŸ‡·France bakop Lille
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡«šŸ‡·France bakop Lille

    There is a phpcs error on the constructor line. I did the modification.
    @apaderno why do we need to change the class name and add the namespace into it ? Actually we have "Plugin implementation of the 'image_style_formatter' formatter." with the "FieldFormatter" annotation.

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

    It does not matter. The construction description must be similar to the following one.

      /**
       * Constructs a \Drupal\user\AccountSettingsForm object.
       *
       * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
       *   The factory for configuration objects.
       * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
       *   The module handler.
       * @param \Drupal\user\RoleStorageInterface $role_storage
       *   The role storage.
       */
      /**
       * Constructs a \Drupal\migrate\Row object.
       *
       * @param array $values
       *   An array of values to add as properties on the object.
       * @param array $source_ids
       *   An array containing the IDs of the source using the keys as the field
       *   names.
       * @param bool $is_stub
       *   TRUE if the row being created is a stub.
       *
       * @throws \InvalidArgumentException
       *   Thrown when a source ID property does not exist.
       */
  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Conflict: This file was modified in both the source and target branches. Ask someone with write access to resolve it.

  • Assigned to bakop
  • šŸ‡«šŸ‡·France bakop Lille
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡«šŸ‡·France bakop Lille

    I can't modify the line in question because it no longer respects the 80 character rule.
    I rebased the branch and removed the added class comment

  • Status changed to Needs work 3 months ago
  • Hi @bakop,

    Applied the changes you committed on MR!2, it was applied smoothly but one error still reported. Please see below:

    āžœ  field_image_style git:(8.x-1.x) curl https://git.drupalcode.org/project/field_image_style/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 15536    0 15536    0     0  33434      0 --:--:-- --:--:-- --:--:-- 34070
    patching file field_image_style.module
    patching file src/Plugin/Field/FieldFormatter/ImageStyleImageFormatter.php
    patching file src/Plugin/Field/FieldType/ImageStyleItem.php
    āžœ  field_image_style git:(8.x-1.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig field_image_style
    
    
    FILE: ...d_image_style/src/Plugin/Field/FieldFormatter/ImageStyleImageFormatter.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     12 | ERROR | [x] Use statements should be sorted alphabetically. The first
        |       |     wrong one is Drupal\Core\File\FileUrlGeneratorInterface.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 247ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Pipeline finished with Success
    3 months ago
    #255015
  • Status changed to Needs review 3 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    3 months ago
    Total: 179s
    #255034
  • Pipeline finished with Success
    3 months ago
    Total: 129s
    #255047
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

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

Production build 0.71.5 2024