Needs work
Project:
Image Widget Crop
Version:
8.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jan 2023 at 10:16 UTC
Updated:
10 Jan 2025 at 12:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
shivam-kumar commentedFixed the above errors and warnings. Please verify.
Comment #4
hardikpandya commentedI 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.
Comment #5
himanshu_jhaloya commentedComment #6
himanshu_jhaloya commentedFixed phpcs issues applied the patch please review.
Comment #8
Sonal Gyanani commentedApplied patch #6, but still showing the following error
Comment #9
himanshu_jhaloya commentedComment #10
sahil.goyal commentedApplying patch for address remaining errors.
Comment #11
akram khanChecked #10 patch it applied smoothly and remove all PHPCS issue now great work by @sahil.goyal . so move to RTBC
Comment #12
akram khanComment #13
avpadernoThe 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.
Comment #14
nitin_lamaComment #15
nitin_lamaComment #16
nitin_lamaComment #17
nitin_lamaComment #18
arti_parmar commentedComment #19
avpadernoCode can use a local variable named
$config_factory. (A method parameter is still a local variable.)As per Drupal coding standards:
Comment #20
akashkumar07 commentedThe patch addresses the #19 suggestions. Please review.
Comment #21
akashkumar07 commentedComment #22
agunjan085 commentedComment #23
agunjan085 commentedHi 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
Comment #24
avpadernoSince that is code in the image_widget_crop.module file and the hook is
hook_field_widget_info_alter(), the correct function name isimage_widget_crop_field_widget_info_alter(), notimage_widget_crop_widget_info_alter().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:The class namespace is missing from the description.
That part is adding extra
-and+.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+.A property description does not repeat its type.
The file storage. is sufficient.
Something is wrong in that definition. Why would a method get a
\Drupal\Core\Entity\EntityTypeManagerparameter and a\Drupal\Core\Entity\EntityTypeManagerInterfaceparameter, sinceEntityTypeManagerInterfaceis the interface implemented by theEntityTypeManagerclass?By the name,
$entityis an entity object. Entity classes do not implementEntityTypeManagerInterface.I would leave that code as it is, since it is simpler to understand.
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.Comment #26
bindu r commentedAddressed some phpcs issues
Comment #27
avpadernoThe report is not updated for the recent changes in the ruleset. It also reports errors that are not present in the project files.
Comment #29
zkhan.aamir commentedIssue summary updated
Comment #30
avpadernoComment #32
sakthi_dev commentedPlease review.
Comment #33
a.aaronjake commentedHi @sakthi_dev,
Applied MR !15 successfully, but it threw multiple errors.
Kindly check.
Thanks,
Jake
Comment #35
baluertlPHPCS,Stylelint, andcomposer-lintare all green.eslintas JavaScript falls out of my expertise.CspellandPHPStanalso could be improved, but they should be good to go for now, I think.Comment #36
baluertlComment #37
baluertlComment #38
eelkeblokI 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 #3214365: Crop widget not adjusting crop box when crop is applied 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...
Comment #39
dqdThanks for all the hard work in here! Gitlab CI file has been added by Drupal 11 compatibility issue merged into 8.x-2.x dev yesterday and this issue here is one commit behind with conflicts, but only 2 of them really required to look at. Can we please resolve the conflicts so that I can commit asap? https://git.drupalcode.org/project/image_widget_crop/-/merge_requests/15...
It is actually just 2 changes in some example and test code which differ between the previous commit and this MR and needs to be looked at and a careful decision which variant of change to keep. The difference in the Gitlab CI file belongs to template comments kept or removed and can be ignored.
Comment #41
tom kondaI rebased the issue branch and fixed some of validate stage errors.