- Issue created by @indrapatil
- Status changed to Needs work
almost 2 years ago 2:49pm 14 February 2023 - š®š¹Italy apaderno Brescia, š®š¹
The issue summary needs to be updated to describe exactly what needs to be changed, and why. At least, it needs to report:
- Which tool has been used to check the code
- Which arguments have been used for that tool
- What report that tool shown
- š®š³India indrapatil Bangalore
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml image_popup-3341557/
FILE: /var/www/html/drupal8/web/modules/image_popup-3341557/src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
246 | WARNING | [ ] ImageStyle::load calls should be avoided in classes, use dependency injection instead
282 | WARNING | [x] A comma should follow the last multiline array item. Found: )
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------FILE: /var/www/html/drupal8/web/modules/image_popup-3341557/src/Controller/ImagePopup.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------
17 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
30 | WARNING | ImageStyle::load calls should be avoided in classes, use dependency injection instead
35 | WARNING | ImageStyle::load calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------FILE: /var/www/html/drupal8/web/modules/image_popup-3341557/src/Form/EditorImagePopupDialog.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------
121 | ERROR | [x] Use null coalesce operator instead of ternary operator.
144 | ERROR | [x] Use null coalesce operator instead of ternary operator.
201 | ERROR | [x] Use null coalesce operator instead of ternary operator.
208 | ERROR | [x] Use null coalesce operator instead of ternary operator.
265 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------FILE: /var/www/html/drupal8/web/modules/image_popup-3341557/image_popup.module
------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] Missing file doc comment
37 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------Time: 124ms; Memory: 12MB
- @indra-patil opened merge request.
- @indra-patil opened merge request.
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 7:42am 15 February 2023 - Status changed to Needs work
almost 2 years ago 7:49am 15 February 2023 - š®š¹Italy apaderno Brescia, š®š¹
+/** + * @file + * Implements image popup module. + */
The top comment for a module should not start with Implements. That is for hook comments.
if (!empty($image_style)) { - $image_style = ImageStyle::load($image_style); + $image_style = $this->fileStorage->load($image_style);
The file storage service is not the one to load image styles.
- First commit to issue fork.
- Status changed to Needs review
almost 2 years ago 9:51am 1 March 2023 - š®š³India kkalashnikov Ghaziabad, India
Updated changes with this MR
- Status changed to Needs work
almost 2 years ago 10:12am 1 March 2023 - š®š¹Italy apaderno Brescia, š®š¹
- * @package Drupal\image_popup\Controller + * @package Drupal\image_popup\Controller.
That line is already correct.
+ /** + * The Get EntityTypeManagerInterface. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager;
The first comment does not describe that property.
+ /** + * Class constructor. + * + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity + * The Entity type manager service. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * Get entity_type_manager. + */ + public function __construct(EntityTypeManagerInterface $entity, EntityTypeManagerInterface $entity_type_manager) { + $this->entityTypeManager = $entity_type_manager; + }
A class constructor is described differently.
+ $data_img_popup = $file->uuid() . ':' . + $form_state->getValue(['attributes', 'alt']) . ':' . + $image_style . ':' . + $image_style_popup . ':' . $align;
If that line is going to be split in multiple lines, the lines after the first should be indented.
* @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager * The entity field manager. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * Get entity_type_manager.
See the
$entity_field_manager
line. - Assigned to arti_parmar
- Assigned to nitin_lama
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:57am 29 June 2023 - Status changed to Needs work
over 1 year ago 11:27am 29 June 2023 - š®š¹Italy apaderno Brescia, š®š¹
I get a slightly different report, probably because I am using a more recent version of the rule-sets used for Drupal coding standards.
- š®š³India zkhan.aamir
Hi,
MR #15 applied successfully.
Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/image_popup (2.x) $ curl https://git.drupalcode.org/project/image_popup/-/merge_requests/4.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10399 0 10399 0 0 29041 0 --:--:-- --:--:-- --:--:-- 29128 patching file image_popup.module patching file src/Controller/ImagePopup.php patching file src/Form/EditorImagePopupDialog.php Hunk #1 succeeded at 119 (offset 1 line). Hunk #2 succeeded at 142 (offset 1 line). Hunk #3 succeeded at 199 (offset 1 line). Hunk #4 succeeded at 263 (offset 1 line). patching file src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php
Remaining issues.
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 image_popup/ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\image_popup\src\Controller\ImagePopup.php -------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------- 58 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead -------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\image_popup\src\Form\EditorImagePopupDialog.php -------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------- 237 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead -------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\image_popup\src\Plugin\Field\FieldFormatter\ImagePopupFieldFormatter.php --------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES --------------------------------------------------------------------------------------------------------------------------------- 89 | WARNING | Line exceeds 80 characters; contains 92 characters 285 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead --------------------------------------------------------------------------------------------------------------------------------- Time: 356ms; Memory: 12MB
- š®š¹Italy apaderno Brescia, š®š¹
apaderno ā changed the visibility of the branch 3341557-coding-standards to hidden.
- š®š¹Italy apaderno Brescia, š®š¹
apaderno ā changed the visibility of the branch 2.x to hidden.
- Status changed to Needs review
7 months ago 10:56am 30 May 2024 - Status changed to RTBC
7 months ago 6:41am 6 June 2024 - šµšPhilippines cleavinjosh
Hi @silvi.addweb,
I applied patch #19. It was applied smoothly and fixed all the issues found by phpcs.
ā image_popup git:(2.x) ā curl https://www.drupal.org/files/issues/2024-05-30/3341557-19.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 15393 100 15393 0 0 36537 0 --:--:-- --:--:-- --:--:-- 36476 patching file image_popup.module patching file src/Controller/ImagePopup.php patching file src/Form/EditorImagePopupDialog.php patching file src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php ā image_popup git:(2.x) ā .. ā contrib git:(main) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml image_popup ā contrib git:(main) ā
Thank you.
- Status changed to Needs work
7 months ago 7:19am 6 June 2024 - š®š¹Italy apaderno Brescia, š®š¹
GitLab CI still reports issues that need to be fixed.
- Status changed to Needs review
7 months ago 7:22am 6 June 2024