Drupal Coding Standards Issues | phpcs

Created on 13 January 2023, almost 2 years ago
Updated 3 February 2023, almost 2 years ago

Problem/Motivation

Getting following errors/warnings

FILE: /app/modules/contrib/crop/crop.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added
| | by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be
| | added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added
| | by drupal.org packaging automatically
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/crop.module
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
13 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ontrib/crop/modules/crop_media_entity/crop_media_entity.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added
| | by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be
| | added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added
| | by drupal.org packaging automatically
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/src/CropInterface.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------
112 | ERROR | The text '@deprecated use getCropFromImageStyleId
| | instead.' does not match the standard format:
| | @deprecated in %deprecation-version% and is removed
| | from %removal-version%. %extra-info%.
112 | ERROR | Each @deprecated tag must have a @see tag immediately
| | following it
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/src/CropTypeListBuilder.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
71 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
112 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
131 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/src/Entity/Crop.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
124 | WARNING | [ ] Exceptions should not be translated
124 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
154 | ERROR | [ ] The trigger_error message
| | 'Crop::getCropFromImageStyle() is deprecated,
| | use Crop::getCropFromImageStyleId() instead.'
| | does not match the relaxed standard format:
| | %thing% is deprecated in %deprecation-version%
| | any free text %removal-version%. %extra-info%.
| | See %cr-link%
325 | WARNING | [x] 'TODO - we are not enforcing uniqueness on this
| | as we want to support more' should match the
| | format '@todo Fix problem X here.'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/src/Events/AutomaticCrop.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
47 | ERROR | Missing parameter comment
48 | ERROR | Missing parameter comment
49 | ERROR | Missing parameter comment
49 | ERROR | Missing parameter type
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/src/Form/CropTypeDeleteForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
47 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
61 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/src/Plugin/ImageEffect/CropEffect.php
----------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
121 | ERROR | [x] Array indentation error, expected 8 spaces but
| | found 10
122 | ERROR | [x] Array indentation error, expected 8 spaces but
| | found 10
123 | ERROR | [x] Array indentation error, expected 8 spaces but
| | found 10
124 | ERROR | [x] Array indentation error, expected 8 spaces but
| | found 10
125 | ERROR | [x] Array indentation error, expected 8 spaces but
| | found 10
126 | ERROR | [x] Array closing indentation error, expected 6 spaces
| | but found 8
----------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...modules/contrib/crop/tests/src/Functional/CropFunctionalTest.php
----------------------------------------------------------------------
FOUND 8 ERRORS AND 13 WARNINGS AFFECTING 21 LINES
----------------------------------------------------------------------
58 | ERROR | [ ] The array declaration extends to column 99 (the
| | limit is 80). The array content should be split
| | up over multiple lines
79 | ERROR | [x] Functions must not contain multiple empty lines
| | in a row; found 2 empty lines
85 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
86 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
89 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
92 | ERROR | [x] Functions must not contain multiple empty lines
| | in a row; found 2 empty lines
103 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
109 | ERROR | [x] Functions must not contain multiple empty lines
| | in a row; found 2 empty lines
112 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
113 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
118 | ERROR | [x] Functions must not contain multiple empty lines
| | in a row; found 2 empty lines
126 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
127 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
131 | ERROR | [ ] The array declaration extends to column 117 (the
| | limit is 80). The array content should be split
| | up over multiple lines
146 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
147 | ERROR | [x] Functions must not contain multiple empty lines
| | in a row; found 2 empty lines
152 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
153 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
157 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
158 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
172 | ERROR | [ ] The array declaration extends to column 90 (the
| | limit is 80). The array content should be split
| | up over multiple lines
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/tests/src/Kernel/CropCRUDTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 16 WARNINGS AFFECTING 16 LINES
----------------------------------------------------------------------
68 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
69 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
70 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
75 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
76 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
77 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
103 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
104 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
105 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
106 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
109 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
110 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
111 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
112 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
113 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
114 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------

FILE: /app/modules/contrib/crop/tests/src/Kernel/CropEffectTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
91 | WARNING | [x] The variable name should be defined after the
| | type
95 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 1.4 secs; Memory: 12MB

Steps to reproduce

Run the following command in the root folder.

Proposed resolution

Fix the above errors.

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia shivam-kumar

Live updates comments and jobs are added and updated live.
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.

  • First commit to issue fork.
  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia hardikpandya

    I have fixed all phpcs issues apart from .module file issues as I was not sure how to change the static variables defined there. Marking this as `Needs Work` so that someone can pick that up and complete this.

  • Assigned to himanshu_jhaloya
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu_jhaloya Indore

    Fixed phpcs issues applied the patch please review.

  • Merge request !15Fixed phpcs issues โ†’ (Open) created by Sonal Gyanani
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Sonal Gyanani

    Applying patch #6, but still shows the following error

    FILE: ...ues-9.5.x-dev\modules\image_widget_crop\image_widget_crop.module
    ----------------------------------------------------------------------
    FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
    ----------------------------------------------------------------------
      8 | WARNING | Global constants should not be used, move it to a
        |         | class or interface
      9 | WARNING | Global constants should not be used, move it to a
        |         | class or interface
     34 | ERROR   | All functions defined in a module file must be
        |         | prefixed with the module's name, found
        |         | "image_widget_cropfield_widget_info_alter" but
        |         | expected
        |         | "image_widget_crop_image_widget_cropfield_widget_info_alter"
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sahil.goyal

    Applying patch for address remaining errors.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akram Khan Cuttack, Odisha

    Checked #10 patch it applied smoothly and remove all PHPCS issue now great work by @sahil.goyal . so move to RTBC

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akram Khan Cuttack, Odisha
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡น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 and arguments have been used, and which report that command shown.

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Assigned to arti_parmar
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    -   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    +   * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory

    Code can use a local variable named $config_factory. (A method parameter is still a local variable.)

    Variables should be named using lowercase, and words should be separated either with uppercase characters (example: $lowerCamelCase) or with an underscore (example: $snake_case). Be consistent; do not mix camelCase and snake_case variable naming inside a file.

    +   * @param \Drupal\Core\Entity\EntityTypeManager $entityTypeManager
    +   *   The entity type manager.
    +   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity
    +   *   The Entity type manager service.
        */
    -  public function __construct(ConfigFactoryInterface $config_factory, FileUsageInterface $file_usage, ImageWidgetCropInterface $iwc_manager) {
    -    parent::__construct($config_factory);
    +  public function __construct(ConfigFactoryInterface $configFactory, FileUsageInterface $file_usage, ImageWidgetCropInterface $iwc_manager, EntityTypeManager $entityTypeManager, EntityTypeManagerInterface $entity) {
    +    parent::__construct($configFactory);
         $this->settings = $this->config('image_widget_crop_examples.settings');
    +    $this->entityTypeManager = $entityTypeManager;

    As per Drupal coding standards:

    [D]o not mix camelCase and snake_case variable naming inside a file

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    4 pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AkashKumar07

    The patch addresses the #19 suggestions. Please review.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Assigned to agunjan085
  • Issue was unassigned.
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia agunjan085

    Hi AkashKumar07

    I applied your patch 3333260-20.patch to my local and I confirmed that it fixes all the PHPCS issues.

    Please look at the screenshot attached for your reference

    Thank you

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
     /**
      * Implements hook_field_widget_info_alter().
      */
    -function image_widget_cropfield_widget_info_alter(array &$info) {
    +function image_widget_crop_widget_info_alter(array &$info) {

    Since that is code in the image_widget_crop.module file and the hook is hook_field_widget_info_alter(), the correct function name is image_widget_crop_field_widget_info_alter(), not image_widget_crop_widget_info_alter().

    -    $js = IMAGE_WIDGET_CROP_JS_CDN;
    +    $js = 'https://cdnjs.cloudflare.com/ajax/libs/cropper/4.0.0/cropper.min.js';

    There is nothing wrong in using a constant, even if it would be better to define it with const. Actually, the Drupal coding standards says:

    In Drupal 8 and later, constants should be defined using the const PHP language keyword (instead of define()), because it is better for performance:

    /**
     * Indicates that the item should be removed at the next general cache wipe.
     */
     const CACHE_TEMPORARY = -1;

    Note that const does not work with PHP expressions. define() should be used when defining a constant conditionally or with a non-literal value:

    if (!defined('MAINTENANCE_MODE')) {
      define('MAINTENANCE_MODE', 'error');
    }
    
    +   /**
    +    * Constructs a CropWidgetForm object.
    +    *

    The class namespace is missing from the description.

    +-   * @param \Drupal\Core\Image\ImageFactory $imageFactory
    ++   * @param \Drupal\Core\Image\ImageFactory $image_factory

    That part is adding extra - and +.

    +-  public function __construct(EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory, ImageFactory $imageFactory) {
    ++  public function __construct(EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory, ImageFactory $image_factory) {
    +     $this->entityTypeManager = $entity_type_manager;
    +     $this->cropStorage = $this->entityTypeManager->getStorage('crop');
    +     $this->cropTypeStorage = $this->entityTypeManager->getStorage('crop_type');
    +     $this->imageStyleStorage = $this->entityTypeManager->getStorage('image_style');
    +     $this->fileStorage = $this->entityTypeManager->getStorage('file');
    +     $this->imageWidgetCropSettings = $config_factory->get('image_widget_crop.settings');
    +-    $this->imageFactory = $imageFactory;
    ++    $this->imageFactory = $image_factory;

    Drupal coding standards allow to name a local variable $image_factory. It is the class properties that should be named $imageFactory.
    Also, that change is still adding extra - and +.

    +  /**
    +   * Drupal\Core\Entity\EntityTypeManager definition.
    +   *
    +   * @var \Drupal\Core\Entity\EntityTypeManager
    +   */
    +  protected $entityTypeManager;

    A property description does not repeat its type.

    +  /**
    +   * The storage handler class for files.
    +   *
    +   * @var \Drupal\file\FileStorage
    +   */
    +  private $fileStorage;

    The file storage. is sufficient.

    +   * @param \Drupal\Core\Entity\EntityTypeManager $entity_type_manager
    +   *   The entity type manager.
    +   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity
    +   *   The Entity type manager service.
        */
    -  public function __construct(ConfigFactoryInterface $config_factory, FileUsageInterface $file_usage, ImageWidgetCropInterface $iwc_manager) {
    +  public function __construct(ConfigFactoryInterface $config_factory, FileUsageInterface $file_usage, ImageWidgetCropInterface $iwc_manager, EntityTypeManager $entity_type_manager, EntityTypeManagerInterface $entity) {
         parent::__construct($config_factory);
         $this->settings = $this->config('image_widget_crop_examples.settings');
    +    $this->entityTypeManager = $entity_type_manager;
         $this->fileUsage = $file_usage;
         $this->imageWidgetCropManager = $iwc_manager;
    +    $this->fileStorage = $entity->getStorage('file');
       }
    

    Something is wrong in that definition. Why would a method get a \Drupal\Core\Entity\EntityTypeManager parameter and a \Drupal\Core\Entity\EntityTypeManagerInterface parameter, since EntityTypeManagerInterface is the interface implemented by the EntityTypeManager class?
    By the name, $entity is an entity object. Entity classes do not implement EntityTypeManagerInterface.

    -        $this->messenger()->addMessage($this->t('The crop "@cropType" was successfully updated for image "@filename".', ['@cropType' => $crop_type->label(), '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename()]));
    +        $this->messenger()->addMessage($this->t('The crop "@cropType" was successfully updated for image "@filename".',
    +        [
    +          '@cropType' => $crop_type->label(),
    +          '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename(),
    +        ]));
           }

    I would leave that code as it is, since it is simpler to understand.

    -                // If file-id key is not available, set it same as parent elements target_id
    +                // If file-id key is not available,
    +                // set it same as parent elements target_id.
    If the file ID key has not been set, set it to the parent elements target ID.
    -                // Parse all value of a crop_wrapper element and get properties
    -                // associate with her CropType.
    +                // Parse all value of a crop_wrapper element and get properties.
                     foreach ($crop_element['crop_wrapper'] as $crop_type_name => $properties) {
                       $properties = $properties['crop_container']['values'];
    

    I would rather remove that comment, since it is not true the code is parsing values. It is looping over an array, but that does not need any explanation: Every developer knows what foreach() does in PHP.

  • First commit to issue fork.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    2 pass, 1 fail
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The report is not updated for the recent changes in the ruleset. It also reports errors that are not present in the project files.

  • First commit to issue fork.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    2 pass, 1 fail
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Issue summary updated

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • First commit to issue fork.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 11 months ago
    2 pass, 1 fail
  • Status changed to Needs review 11 months ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 11 months ago
    Patch Failed to Apply
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev

    Please review.

  • Status changed to Needs work 5 months ago
  • Hi @sakthi_dev,

    Applied MR !15 successfully, but it threw multiple errors.

     image_widget_crop git:(c42c4e6) curl https://git.drupalcode.org/project/image_widget_crop/-/merge_requests/15.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 17786    0 17786    0     0  32933      0 --:--:-- --:--:-- --:--:-- 33621
    patching file image_widget_crop.module
    patching file image_widget_crop.services.yml
    patching file modules/image_widget_crop_examples/src/Form/ImageWidgetCropExamplesForm.php
    patching file src/Element/ImageCrop.php
    patching file src/Form/CropWidgetForm.php
    patching file src/ImageWidgetCropManager.php
    patching file src/Plugin/Field/FieldWidget/ImageCropWidget.php
    patching file tests/src/FunctionalJavascript/ImageWidgetCropTest.php
    โžœ  image_widget_crop git:(c42c4e6) โœ— cd ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig image_widget_crop
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/image_widget_crop/image_widget_crop.module
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      8 | WARNING | Global constants should not be used, move it to a class or interface
      9 | WARNING | Global constants should not be used, move it to a class or interface
     34 | ERROR   | All functions defined in a module file must be prefixed with the module's name, found "image_widget_cropfield_widget_info_alter" but expected
        |         | "image_widget_crop_image_widget_cropfield_widget_info_alter"
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/image_widget_crop/modules/image_widget_crop_examples/src/Form/ImageWidgetCropExamplesForm.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     55 | ERROR | Missing short description in doc comment
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/image_widget_crop/src/Form/CropWidgetForm.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
     10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Extension\ModuleHandlerInterface.
    ---------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/image_widget_crop/src/ImageWidgetCropInterface.php
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------
     58 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    ------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------
    
    Time: 1.02 secs; Memory: 14MB

    Kindly check.

    Thanks,
    Jake

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 5 months ago
    2 pass, 1 fail
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Balu Ertl Budapest ๐Ÿ‡ช๐Ÿ‡บ

    Balu Ertl โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    4 months ago
    Total: 157s
    #215768
  • Pipeline finished with Failed
    4 months ago
    Total: 160s
    #215818
  • Pipeline finished with Failed
    4 months ago
    Total: 152s
    #215846
  • Pipeline finished with Failed
    4 months ago
    Total: 182s
    #215901
  • Pipeline finished with Failed
    4 months ago
    Total: 153s
    #215919
  • Pipeline finished with Failed
    4 months ago
    Total: 184s
    #215931
  • Pipeline finished with Failed
    4 months ago
    Total: 156s
    #215937
  • Pipeline finished with Failed
    4 months ago
    #215948
  • Pipeline finished with Failed
    4 months ago
    Total: 1151s
    #216051
  • Pipeline finished with Failed
    4 months ago
    Total: 192s
    #216063
  • Pipeline finished with Failed
    4 months ago
    #216083
  • Pipeline finished with Failed
    4 months ago
    Total: 239s
    #216606
  • Pipeline finished with Failed
    4 months ago
    Total: 154s
    #216627
  • Pipeline finished with Failed
    4 months ago
    Total: 205s
    #218982
  • Pipeline finished with Failed
    4 months ago
    Total: 191s
    #219021
  • Pipeline finished with Success
    4 months ago
    Total: 192s
    #219173
  • Pipeline finished with Success
    4 months ago
    Total: 243s
    #219178
  • Pipeline finished with Success
    4 months ago
    Total: 158s
    #219188
  • Pipeline finished with Success
    4 months ago
    #219200
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Balu Ertl Budapest ๐Ÿ‡ช๐Ÿ‡บ
    • It took more time to dig it up than expected, but finally, PHPUnit tests are working again after not being run for 1,5 years ago โ†’ .
    • PHPCS, Stylelint, and composer-lint are all green.
    • I didn't touch eslint as JavaScript falls out of my expertise. Cspell and PHPStan also could be improved, but they should be good to go for now, I think.
    • @apaderno โ†’ 's comments went through and fixed those which was still unresolved.
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Balu Ertl Budapest ๐Ÿ‡ช๐Ÿ‡บ
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Balu Ertl Budapest ๐Ÿ‡ช๐Ÿ‡บ
  • Status changed to RTBC 1 day ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands eelkeblok Netherlands ๐Ÿ‡ณ๐Ÿ‡ฑ

    I scanned through the changes and didn't seen anything major. If there are any left-over concerns, I would advocate for getting the Gitlab and test-changes in first, and then creating follow-up issues for the various linters. I just spent about half an hour hunting down tests breaking in the module because I wanted to try to get ๐Ÿ› Crop widget not adjusting crop box when crop is applied Needs work over the last hump by writing a test. I first found out tests haven't been running since there is no Gitlab integration and then I found this issue...

Production build 0.71.5 2024