- Issue created by @sidharth_soman
- ๐ฎ๐ณIndia sidharth_soman Bangalore
I've fixed all the issues except two: the formatting of the @todo comment and the 'line exceeds 80 characters' error for a comment.
I'm keeping them both as it is for readability purposes.Please review the uploaded patch.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:16pm 7 July 2023 - Open on Drupal.org โCore: 10.0.5 + Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass The last submitted patch, 2: 3373192-2.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 2:23pm 10 July 2023 - ๐ฌ๐งUnited Kingdom Eli-T Manchester
Thanks for looking at this!
Some things we need to look at:
1. After applying your patch and running PHPCS I get a couple of errors not in your report:
โฐelliot.wardโ~/code/content_hub/prisoner-content-hub-backend/docroot/modules/contrib(gitโฑfix_c_b_tests)โฑโโป ../../..//vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig computed_breadcrumbs FILE: /Users/elliot.ward/code/content_hub/prisoner-content-hub-backend/docroot/modules/contrib/computed_breadcrumbs/tests/src/Kernel/ComputedBreadcrumbsKernelTest.php ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Breadcrumb\Breadcrumb. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/elliot.ward/code/content_hub/prisoner-content-hub-backend/docroot/modules/contrib/computed_breadcrumbs/src/EventListener.php ---------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------------------------- 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\EventDispatcher\EventSubscriberInterface. ---------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------------------------
Can we fix these at the same time? If you can't see these warnings can you check you have the latest module code on the 1.1.x branch?
2. Typo in the file comment - computer_breadcrumbs instead of computed_breadcrumbs.
+++ b/computed_breadcrumbs.module @@ -1,5 +1,10 @@ <?php +/** + * @file + * Defines the hooks for computer_breadcrumbs. + */ +
3. The line exceeding 80 characters warning can be fixed by splitting the constraints part of the annotation over multiple lines. Here's an example from core:
/** * Defines the 'language' entity field item. * * @FieldType( * id = "language", * label = @Translation("Language"), * description = @Translation("An entity field referencing a language."), * default_widget = "language_select", * default_formatter = "language", * no_ui = TRUE, * constraints = { * "ComplexData" = { * "value" = { * "Length" = {"max" = 12} * } * } * } * ) */ class LanguageItem extends FieldItemBase implements OptionsProviderInterface {
5. There is no reason to not fix the @todo item
// @todo Remove the request stack manipulation once the core issue described at https://www.drupal.org/node/2613044 is resolved. while ($requestStack->getCurrentRequest() === $request) { $requestStack->pop(); }
- ๐ฎ๐ณIndia sidharth_soman Bangalore
Yep, I couldn't see the error with the sorted use statements since my drupal/coder package wasn't updated.
I've fixed the concerns you've pointed out... and I'm uploading a new patch for it.
- Status changed to Needs review
over 1 year ago 3:06pm 10 July 2023 - last update
over 1 year ago Build Successful - ๐ฎ๐ณIndia sidharth_soman Bangalore
I can also issue an MR against 1.1.x if that makes things easier for you.
The last submitted patch, 7: 3373192-6.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 4:10pm 10 July 2023 - ๐ฌ๐งUnited Kingdom Eli-T Manchester
@sidharth_soman do you use this module? Have you tested your changes?
This code breaks the site
foreach ($links as $index) { $link = $links[$index];
The correct fix for the coding standard issue would be to change
foreach ($links as $index => $link) {
to
foreach ($links as $link) {
- Open on Drupal.org โCore: 10.0.5 + Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - @sidharth_soman opened merge request.
- last update
over 1 year ago Build Successful - @sidharth_soman opened merge request.
- last update
over 1 year ago Build Successful - Status changed to Fixed
over 1 year ago 7:10pm 10 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.