- ๐ฎ๐ณIndia rishu_kumar
When I try to apply #4 patch but not apply cleanly.
See the attached screenshot.
So, Need to work.Thanks
- ๐ฎ๐ณIndia Charchil Khandelwal
Charchil Khandelwal โ made their first commit to this issueโs fork.
- Assigned to Charchil Khandelwal
- Merge request !47Issue #3332136: Drupal Coding Standards Issues | phpcs โ (Open) created by Charchil Khandelwal
- ๐ฎ๐ณIndia Charchil Khandelwal
Some of the warnings and errors are fixed now.
Please review.Thank You.
- Issue was unassigned.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
/** * @file - * hook_post_update_NAME functions for entity_usage module. + * Hook_post_update_NAME functions for entity_usage module. */
The short description for that file is Post update functions for the [module name] module.
/** - * Implements hook_post_update_NAME(). - * Re-generate entity_usage statistics. + * Implements hook_post_update_NAME() for Re-generate entity_usage statistics. */
The correct comment for a
hook_post_update_NAME()
implementation is the line describing what that hook does. In this case, that is the Re-generate entity_usage statistics. comment.* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The config factory service. + * The config factory service.
service is not necessary.
- * @return array<string, string> + * @return arraystringstring * An array of all embedded entities found, where keys are the uuids and the * values are the entity types.
arraystringstring
is not a type listed in the Drupal coding standards./** - * Class EntityUpdateManager. + * Entity Manager to update Entity.
Actually, that class is an entity update manager.
- * @return array<string, \Drupal\entity_usage\EntityUsageTrackInterface> + * @return arraystring\Drupal\entity_usage\EntityUsageTrackInterface * The enabled plugin instances keyed by plugin ID.
That is another type the Drupal coding standards do not list.
/** - * Class EntityUpdateManagerInterface. + * The EntityUpdateManagerInterface class. * * @package Drupal\entity_usage
A class short description must not repeat the class name.
Also, either it is an interface or it is a class. It cannot be both.- * @param 'revision'|'translation'|'default' $type + * @param revision|translation|default $type
The existing type-hinting says
$type
is a string.- $operations[] = ['\Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker', [$entity_type_id]]; + $operations[] = ['\Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker', [ + $entity_type_id, + ], + ];
Lines are allowed to be longer than 80 characters, if they are more readable. In this case, the existing code is more readable.
- $storage = $this->entityTypeManager->getStorage('entity_test_mulrevpub'); + // $storage = $this->entityTypeManager->getStorage('entity_test_mulrevpub');
If a line needs to be removed, it is not commented-out.
Anyway, why is that line commented out?+ * @param string $field_name + * The name of the field.
The field name. is shorter.
- ๐ฎ๐ณIndia pray_12
Preethy_ray โ made their first commit to this issueโs fork.
- First commit to issue fork.
- First commit to issue fork.
- Status changed to Needs review
9 months ago 7:56am 15 February 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch 3332136-drupal-coding-standards to hidden.
- Status changed to Needs work
7 months ago 3:15am 8 May 2024 - ๐ต๐ญPhilippines clarkssquared
Hi silvi
I applied your patch #17 and I can still see some PHPCS errors
โ entity_usage git:(642974e) curl https://www.drupal.org/files/issues/2024-04-24/3332136-entity-usage-17.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 36980 100 36980 0 0 65083 0 --:--:-- --:--:-- --:--:-- 66035 patching file entity_usage.install patching file entity_usage.module patching file entity_usage.post_update.php patching file 'src/Commands/EntityUsageCommands.php' patching file 'src/Controller/ListUsageController.php' patching file 'src/EntityUpdateManager.php' patching file 'src/EntityUpdateManagerInterface.php' patching file 'src/EntityUsage.php' patching file 'src/EntityUsageBatchManager.php' patching file 'src/EntityUsageInterface.php' patching file 'src/EntityUsageQueueBatchManager.php' patching file 'src/EntityUsageTrackBase.php' patching file 'src/Form/BatchUpdateForm.php' patching file 'src/Form/EntityUsageSettingsForm.php' patching file 'src/Plugin/EntityUsage/Track/BlockField.php' patching file 'src/Plugin/EntityUsage/Track/CkeditorImage.php' patching file 'src/Plugin/EntityUsage/Track/EntityEmbed.php' patching file 'src/Plugin/EntityUsage/Track/LayoutBuilder.php' patching file 'src/Plugin/EntityUsage/Track/LinkIt.php' patching file 'src/Plugin/EntityUsage/Track/MediaEmbed.php' patching file 'src/Plugin/QueueWorker/EntityUsageRegenerateTrackingInfoWorker.php' patching file 'tests/modules/entity_usage_test/config/install/field.storage.node.field_eu_test_related_nodes.yml' patching file 'tests/modules/entity_usage_test/src/Plugin/Block/DependenciesBlock.php' patching file 'tests/src/FunctionalJavascript/EmbeddedContentTest.php' patching file 'tests/src/FunctionalJavascript/EntityUsageLayoutBuilderEntityBrowserBlockTest.php' patching file 'tests/src/FunctionalJavascript/IntegrationTest.php' patching file 'tests/src/Kernel/EntityUsageTest.php' patching file 'tests/src/Kernel/EntityUsageTrackFileTest.php' โ entity_usage git:(642974e) โ .. โ contrib git:(master) โ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml entity_usage FILE: ...bing/Projects/d9/d9-local/web/modules/contrib/entity_usage/tests/src/FunctionalJavascript/EmbeddedContentTest.php ----------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------- 431 | ERROR | The array declaration extends to column 111 (the limit is 80). The array content should be split up | | over multiple lines ----------------------------------------------------------------------------------------------------------------------- FILE: ...ubing/Projects/d9/d9-local/web/modules/contrib/entity_usage/tests/src/Functional/EntityUsageLayoutBuilderTest.php ----------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------- 65 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over | | multiple lines 66 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over | | multiple lines ----------------------------------------------------------------------------------------------------------------------- FILE: ...ers/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/entity_usage/src/Commands/EntityUsageCommands.php ----------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------- 80 | ERROR | The array declaration extends to column 113 (the limit is 80). The array content should be split up over | | multiple lines ----------------------------------------------------------------------------------------------------------------------- Time: 2.35 secs; Memory: 16MB โ contrib git:(master) โ
If possible, add your fixes in the existing Merge Request so that maintainers can test it conveniently.
- Status changed to Needs review
6 months ago 7:26am 30 May 2024 - ๐ฎ๐ณIndia dev16.addweb
Hello,
I looked into it and resolved the issue you brought up. kindly check this one if it is possible.