- Merge request !13issue #3305083 by Dharti Patel: PHPCS Coding Standard Issues โ (Open) created by juancec
- Status changed to Needs work
12 months ago 11:46pm 27 November 2023 - ๐บ๐ธUnited States dave reid Nebraska USA
I cannot cleanly merge the MR currently with 8.x-1.x, it needs to be updated.
- First commit to issue fork.
- Status changed to Needs review
12 months ago 5:40am 28 November 2023 - ๐ฎ๐ณIndia ankithashetty Karnataka, India
Fixed conflicts in MR and rebased it.
Noticed additional phpcs errors:phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .
FILE: /entity_embed/entity_embed.api.php ---------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES ---------------------------------------------------------------------------------------------------- 1 | ERROR | [x] Missing file doc comment 5 | ERROR | [x] There must be one blank line after the last USE statement; 0 found; FILE: /entity_embed_test/src/Controller/TestEntityEmbedController.php --------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------- 13 | WARNING | Line exceeds 80 characters; contains 81 characters --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php --------------------------------------------------------------------------------------------------------------------------- FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 LINES --------------------------------------------------------------------------------------------------------------------------- 52 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters 213 | ERROR | [ ] The array declaration extends to column 116 (the limit is 80). The array content should be split up over multiple lines 275 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters 276 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters 278 | ERROR | [ ] The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines 557 | ERROR | [x] Missing function doc comment 757 | WARNING | [ ] Unused variable $page. --------------------------------------------------------------------------------------------------------------------------- FILE: entity_embed/tests/src/Kernel/EntityEmbedFilterDisabledIntegrationsTest.php --------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------- 56 | WARNING | [x] A comma should follow the last multiline array item. Found: ] --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/tests/src/Kernel/UpgradePathTest.php -------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------- 99 | ERROR | [x] Array indentation error, expected 16 spaces but found 18 102 | ERROR | [x] Array indentation error, expected 16 spaces but found 18 FILE: /entity_embed/entity_embed.module --------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES --------------------------------------------------------------------------------------------------------------------------- 11 | WARNING | [x] Unused use statement 12 | WARNING | [x] Unused use statement 13 | WARNING | [x] Unused use statement 329 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/entity_embed.install ---------------------------------------------------------------------------------------------------- FOUND 3 ERRORS AFFECTING 2 LINES ---------------------------------------------------------------------------------------------------- 9 | ERROR | [ ] Doc comment short description must start with a capital letter 9 | ERROR | [x] Doc comment star missing 10 | ERROR | [x] Expected 1 space(s) before asterisk; 2 found FILE: /entity_embed/src/Form/EntityEmbedDialog.php -------------------------------------------------------------------------------------------------------------- FOUND 3 ERRORS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------- 98 | ERROR | [ ] Parameter $file_url_generator is not described in comment 113 | ERROR | [ ] Missing parameter name 433 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10 -------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/src/Plugin/CKEditor5Plugin/DrupalEntityDeriver.php --------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------- 15 | ERROR | [x] Missing class doc comment --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/src/Plugin/CKEditor5Plugin/DrupalEntity.php --------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES --------------------------------------------------------------------------------------------------------------------------- 16 | ERROR | Missing short description in doc comment 29 | WARNING | Line exceeds 80 characters; contains 154 characters --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php --------------------------------------------------------------------------------------------------------------------------- FOUND 3 ERRORS AFFECTING 3 LINES --------------------------------------------------------------------------------------------------------------------------- 74 | ERROR | Public method name "EntityEmbed::mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem" is not in lowerCamel format 93 | ERROR | Public method name "EntityEmbed::mapCKEditor4SettingsToCKEditor5Configuration" is not in lowerCamel format 100 | ERROR | Public method name "EntityEmbed::computeCKEditor5PluginSubsetConfiguration" is not in lowerCamel format --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/src/Plugin/Filter/EntityEmbedFilter.php ----------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------- 90 | ERROR | Parameter $file_url_generator is not described in comment 107 | ERROR | Missing parameter name ----------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/src/Controller/EditEmbeddedEntity.php --------------------------------------------------------------------------------------------------------------------- FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES --------------------------------------------------------------------------------------------------------------------- 7 | ERROR | [x] Missing class doc comment 21 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead 23 | ERROR | [x] Expected 1 blank line after function; 3 found Fix the js files (that had broke the module) and the last PHPCS in entity_embeded.module. 26 | ERROR | [ ] More than 2 empty lines are not allowed 27 | ERROR | [x] The closing brace for the class must have an empty line before it ---------------------------------------------------------------------------------------------------------------------
Fixed these in the latest commit in the same MR.
Pending warnings are:FILE: /entity_embed/src/Plugin/CKEditor5Plugin/DrupalEntity.php --------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------- 31 | WARNING | Line exceeds 80 characters; contains 154 characters --------------------------------------------------------------------------------------------------------------------------- FILE: /entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php ------------------------------------------------------------------------------------------------------------------------------ FOUND 3 ERRORS AFFECTING 3 LINES --------------------------------------------------------------------------------------------------------------------------- 74 | ERROR | Public method name "EntityEmbed::mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem" is not in lowerCamel format 93 | ERROR | Public method name "EntityEmbed::mapCKEditor4SettingsToCKEditor5Configuration" is not in lowerCamel format 100 | ERROR | Public method name "EntityEmbed::computeCKEditor5PluginSubsetConfiguration" is not in lowerCamel format ---------------------------------------------------------------------------------------------------------------------------
Thank you!
- ๐ฎ๐ณIndia Vivek Panicker Kolkata
Vivek Panicker โ made their first commit to this issueโs fork.
- Status changed to Needs work
10 months ago 7:38am 16 January 2024 - ๐ท๐บRussia zniki.ru
I added changes to fix phpunit tests, but I think these changes need to be moved to separate issue.
Also I suggest to have scheduled pipeline run for main dev branch, to run tests once in a week. - Status changed to Needs review
10 months ago 7:53pm 16 January 2024 - ๐ท๐บRussia zniki.ru
I removed all the changes from MR, that is not related to phpcs report.
Only changes for unit tests left in the MR, to check that tests will pass.I think it's ready for review now.
P. S. I haven't rights to resolve threads in the MR.
- Status changed to Needs work
10 months ago 6:26am 17 January 2024 - Status changed to Needs review
10 months ago 7:27am 17 January 2024 - ๐ท๐บRussia zniki.ru
I hope tests will pass this time.
Changes to fix tests made in ๐ Fix tests Needs review , it would be great to merge that issue first.I have an idea to remove adding Dependency Injection to
- EditEmbeddedEntity
- EntityEmbedBuilder
from changes to simplify this MR, and move it to separate issue.
Some changes that I removed from MR, makes sense to implement in code base.
E.g. b5456b6, 13c0c7726.
But I think should be done in separate issues. - Status changed to Needs work
4 months ago 11:15pm 17 July 2024 Hi @AnkShetty @vivekp27 @Nikolay Shapovalov,
Confirmed your changes in MR !13 can be applied successfully, however, there are still errors reported. Please see below:
entity_embed git:(8.x-1.6) curl https://git.drupalcode.org/project/entity_embed/-/merge_requests/13.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 43320 0 43320 0 0 91347 0 --:--:-- --:--:-- --:--:-- 92762 patching file .gitlab-ci.yml patching file entity_embed.api.php patching file entity_embed.install patching file entity_embed.module patching file entity_embed.services.yml patching file src/Controller/EditEmbeddedEntity.php patching file src/EntityEmbedBuilder.php patching file src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php patching file src/EntityEmbedDisplay/EntityEmbedDisplayManager.php patching file src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php patching file src/Form/EntityEmbedDialog.php patching file src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php patching file src/Plugin/CKEditor5Plugin/DrupalEntity.php patching file src/Plugin/CKEditor5Plugin/DrupalEntityDeriver.php patching file src/Plugin/CKEditorPlugin/DrupalEntity.php patching file src/Plugin/Derivative/FieldFormatterDeriver.php patching file src/Plugin/Filter/EntityEmbedFilter.php patching file src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php patching file src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php patching file src/Plugin/entity_embed/EntityEmbedDisplay/MediaImageDecorator.php patching file tests/modules/entity_embed_test/entity_embed_test.routing.yml patching file tests/modules/entity_embed_test/src/Controller/TestEntityEmbedController.php patching file tests/src/Functional/EntityEmbedEntityBrowserTest.php patching file tests/src/Functional/EntityEmbedTestBase.php patching file tests/src/Functional/ViewModeFieldFormatterTest.php patching file tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php patching file tests/src/FunctionalJavascript/ConfigurationUiTest.php patching file tests/src/FunctionalJavascript/ContentTranslationTest.php patching file tests/src/FunctionalJavascript/ImageFieldFormatterTest.php patching file tests/src/FunctionalJavascript/MediaImageTest.php patching file tests/src/FunctionalJavascript/SortableTestTrait.php patching file tests/src/Kernel/EntityEmbedFilterDisabledIntegrationsTest.php patching file tests/src/Kernel/EntityEmbedFilterTest.php patching file tests/src/Kernel/EntityEmbedFilterTestBase.php patching file tests/src/Kernel/UpgradePathTest.php โ entity_embed git:(8.x-1.6) โ cd .. โ contrib git:(main) โ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig entity_embed FILE: ...ssue/web/modules/contrib/entity_embed/tests/src/Kernel/UpgradePathTest.php -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 3 | ERROR | [x] Expected strict_types=1, found strict_types = 1. -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- FILE: ...terns/Demo-site/drupal-orgissue/web/modules/contrib/entity_embed/README.md -------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------- 21 | WARNING | Line exceeds 80 characters; contains 91 characters 30 | WARNING | Line exceeds 80 characters; contains 201 characters 73 | WARNING | Line exceeds 80 characters; contains 231 characters -------------------------------------------------------------------------------- FILE: ...es/contrib/entity_embed/src/Plugin/CKEditor5Plugin/DrupalEntityDeriver.php -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 3 | ERROR | [x] Expected strict_types=1, found strict_types = 1. -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- FILE: ...b/modules/contrib/entity_embed/src/Plugin/CKEditor5Plugin/DrupalEntity.php -------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES -------------------------------------------------------------------------------- 3 | ERROR | [x] Expected strict_types=1, found strict_types = 1. 79 | ERROR | [x] Multi-line function declarations must have a trailing comma | | after the last parameter -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- FILE: ...odules/contrib/entity_embed/src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php -------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES -------------------------------------------------------------------------------- 50 | ERROR | [x] The first parameter of a multi-line function declaration must | | be on the line after the opening bracket 53 | ERROR | [x] Multi-line function declarations must have a trailing comma | | after the last parameter -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------- Time: 2.77 secs; Memory: 16MB
Kindly check
Thanks,
Jake- First commit to issue fork.
- Status changed to Needs review
4 months ago 5:40am 18 July 2024 - Status changed to RTBC
3 months ago 11:12pm 13 August 2024 Hi @atul_ghate,
I applied the latest changes on MR !13, it was applied smoothly and confirmed no errors were reported.
entity_embed git:(8.x-1.6) curl https://git.drupalcode.org/project/entity_embed/-/merge_requests/13.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 47083 0 47083 0 0 71663 0 --:--:-- --:--:-- --:--:-- 72435 patching file .gitlab-ci.yml patching file README.md patching file entity_embed.api.php patching file entity_embed.install patching file entity_embed.module patching file entity_embed.services.yml patching file src/Controller/EditEmbeddedEntity.php patching file src/EntityEmbedBuilder.php patching file src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php patching file src/EntityEmbedDisplay/EntityEmbedDisplayManager.php patching file src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php patching file src/Form/EntityEmbedDialog.php patching file src/Plugin/CKEditor4To5Upgrade/EntityEmbed.php patching file src/Plugin/CKEditor5Plugin/DrupalEntity.php patching file src/Plugin/CKEditor5Plugin/DrupalEntityDeriver.php patching file src/Plugin/CKEditorPlugin/DrupalEntity.php patching file src/Plugin/Derivative/FieldFormatterDeriver.php patching file src/Plugin/Filter/EntityEmbedFilter.php patching file src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php patching file src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php patching file src/Plugin/entity_embed/EntityEmbedDisplay/MediaImageDecorator.php patching file tests/modules/entity_embed_test/entity_embed_test.routing.yml patching file tests/modules/entity_embed_test/src/Controller/TestEntityEmbedController.php patching file tests/src/Functional/EntityEmbedEntityBrowserTest.php patching file tests/src/Functional/EntityEmbedTestBase.php patching file tests/src/Functional/ViewModeFieldFormatterTest.php patching file tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php patching file tests/src/FunctionalJavascript/ConfigurationUiTest.php patching file tests/src/FunctionalJavascript/ContentTranslationTest.php patching file tests/src/FunctionalJavascript/ImageFieldFormatterTest.php patching file tests/src/FunctionalJavascript/MediaImageTest.php patching file tests/src/FunctionalJavascript/SortableTestTrait.php patching file tests/src/Kernel/EntityEmbedFilterDisabledIntegrationsTest.php patching file tests/src/Kernel/EntityEmbedFilterTest.php patching file tests/src/Kernel/EntityEmbedFilterTestBase.php patching file tests/src/Kernel/UpgradePathTest.php โ entity_embed git:(8.x-1.6) โ cd .. โ contrib git:(main) โ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig entity_embed โ contrib git:(main) โ
Will now move this to RTBC
Thanks,
Jake- Merge request !45Created a new merge request to obtain the list of all the PHP_CodeSniffer errors/warnings to fix โ (Open) created by apaderno