- Issue created by @samit.310@gmail.com
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 9:43am 3 March 2023 - Status changed to Needs work
over 1 year ago 12:24pm 3 March 2023 - š®š¹Italy apaderno Brescia, š®š¹
The only tag for coding standard issues is Coding standards.
- š®š³India kkalashnikov Ghaziabad, India
Include all the changes which is in #5 in current patch.
- Status changed to Needs review
over 1 year ago 10:56am 16 March 2023 - š®š¹Italy apaderno Brescia, š®š¹
+ // This is based on code in core node module NodeTypeForm.php. + if ($this->moduleHandler->moduleExists('language')) {
Spaces are not used as separator in file paths.
There are other corrections to be done.
- Status changed to Needs work
over 1 year ago 11:49am 16 March 2023 - Status changed to Needs review
over 1 year ago 9:49am 23 June 2023 - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.6last update
over 1 year ago Waiting for branch to pass - Status changed to Needs work
over 1 year ago 3:54pm 23 June 2023 - š®š¹Italy apaderno Brescia, š®š¹
+/** + * Form controller for the usermanualtype entity edit forms. + */
It does not seem usermanualtype is the entity type.
- // This is based on code in core node module NodeTypeForm.php. - if ($this->moduleHandler->moduleExists('language')) { + // This is based on code in core node module NodeTypeForm.php.
This code is based on code found in the Drupal core NodeTypeForm.php file.
- return $this->generatePermissions(UserManualType::loadMultiple(), [$this, 'buildPermissions']); + return $this->generatePermissions(UserManualType::loadMultiple(), + [$this, 'buildPermissions']);
I would leave the code as it is. If you want to split in multiple lines, the last line must be indented, and the last parenthesis put on its own line.
- $manual_entries = _user_manual_test_manual_entries(_user_manual_test_user_manual_types(), [1, 2, 3, 4]); + $manual_entries = _user_manual_test_manual_entries(_user_manual_test_user_manual_types(), + [1, 2, 3, 4]);
I would rather leave the code as it is, since Line length and wrapping ā , part of the Drupal coding standards, says:
- Lines containing longer function names, function/class definitions, variable declarations, etc are allowed to exceed 80 characters.
- Control structure conditions may exceed 80 characters, if they are simple to read and understand.
(Emphasis is mine.)
* @param string $label - * label for user manual type. + * Label for user manual type.
I would check the name of the entity type.
- // If admin_toolbar is exists, then we will add dropdown menu by user manual topics. + // If admin_toolbar is exists, then we will add dropdown + // menu by user manual topics.
Since that comment is edited, the verb needs to be fixed. It is exists, not is exists.
- // Set name field display + // Set name field display.
That is probably Set the field display name.
- š®š¹Italy apaderno Brescia, š®š¹
- // This is based on code in core node module NodeTypeForm.php. - if ($this->moduleHandler->moduleExists('language')) { + // This is based on code in core node module NodeTypeForm.php. + if ($this->moduleHandler->moduleExists('language')) {
See my previous comment.
/** - * Verify that taxonomy terms appear in the toolbar + * Verify that taxonomy terms appear in the toolbar. */
The verb must be declined to the third person singular. That is true for all the method/function/class descriptions.
- * @param string $block_type_id - * Id of the block type. + * @param string $user_manual_type_id + * Id of the user manual type. * * @throws \Drupal\Core\Entity\EntityStorageException */ function user_manual_add_default_fields($user_manual_type_id) {
The descriptions are each missing a definite article. The correct spelling of Id is ID.
- // Set name field display + // Set name field display. $view_modes = \Drupal::service('entity_display.repository')->getViewModes('user_manual');
Since that comment is changed, it should also be corrected. At least, a definite article is missing.
- Assigned to nitin_lama
- š®š³India nitin_lama India
Addressing #12 and fixing possible phpcs issues.
- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.6last update
12 months ago Waiting for branch to pass - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.6last update
12 months ago Waiting for branch to pass - Issue was unassigned.
- Status changed to Needs review
12 months ago 11:58am 1 December 2023 - Status changed to Needs work
6 months ago 11:41am 30 May 2024 Hi @nitin_lama,
Applied patch #14 successfully, but it throws an error and a warning.
user_manual git:(1.0.x) curl https://www.drupal.org/files/issues/2023-12-01/phpcs-fixes-3345706-14.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14227 100 14227 0 0 20707 0 --:--:-- --:--:-- --:--:-- 21108 patching file src/DocsListing.php patching file src/Entity/UserManual.php patching file src/Entity/UserManualType.php patching file src/Form/UserManualTypeEntityForm.php patching file src/UserManualAccessControlHandler.php patching file src/UserManualPermissions.php patching file tests/modules/user_manual_test/user_manual_test.install patching file tests/src/Functional/AccessTest.php patching file tests/src/Functional/ToolbarTest.php patching file user_manual.module ā user_manual git:(1.0.x) ā cd .. ā contrib git:(main) ā phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig user_manual FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/user_manual/templates/user-manual.html.twig -------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------- 55 | ERROR | [x] Expected 1 newline at end of file; 2 found -------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------- FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/user_manual/src/Form/UserManualTypeEntityForm.php -------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------------- 51 | WARNING | Line exceeds 80 characters; contains 81 characters -------------------------------------------------------------------------------------------------------------------------- Time: 596ms; Memory: 12MB
Kindly check.
Thanks,
Jake- Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.6last update
6 months ago Waiting for branch to pass - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.6last update
6 months ago Waiting for branch to pass - Open on Drupal.org āCore: 9.5.x + Environment: PHP 7.3 & MySQL 5.6last update
6 months ago Waiting for branch to pass - Status changed to Needs review
6 months ago 2:49pm 31 May 2024