- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.
- Status changed to RTBC
over 1 year ago 7:49am 21 June 2023 - ๐ฎ๐ณIndia Ashutosh Ahirwal India
I have updated the issue summary and also review the patch provided in #3.
all look good moving to RTBC. - Status changed to Needs work
over 1 year ago 10:19am 21 June 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
+/** + * @file + */ +
Adding a comment with just the
@file
tag is not sufficient. There must be a description, which is usually Hook implementations for the [module name] module. where [module name] is the module name shown in the .info.yml file.- // Gets the request from the route and checks only the permissions + // Gets the request from the route and checks only the permissions // associated with request states.
Since that comment is changed, Gets and checks need to be fixed too (by removing the final s).
- // Permissions to add responses are not needed as they permission to respond + // Permissions to add responses are not needed as they permission to respond // requests is tested instead.
Since the comment is edited, they should be replaced with their too.
+interface ContentEntityInterface extends + CoreContentEntityInterface, + EntityCreatedInterface, + EntityChangedInterface, + EntityOwnerInterface {
Class definitions are written in a single line.
* @return bool - * Returns TRUE if the request is in the specified state. Otherwise, + * Returns TRUE if the request is in the specified state. Otherwise, * returns FALSE.
Since that description is changed, return value descriptions must not start with Returns nor Return.
A better description would be:
TRUE when the request in the specified state, FALSE otherwise.
+ /** + * TestGetRequestType(). + */
Repeating the method name is not documenting a method. The documentation comment for methods/functions must include a better description and document parameters and return value.
- Assigned to nitin_lama
- Issue was unassigned.
- last update
over 1 year ago Patch Failed to Apply - First commit to issue fork.
- ๐ฎ๐ณIndia zkhan.aamir
Hi
MR #11 applied successfully.
Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib/user_request (8.x-1.x) $ curl https://git.drupalcode.org/project/user_request/-/merge_requests/1.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 85013 0 85013 0 0 69354 0 --:--:-- 0:00:01 --:--:-- 69511 patching file config/install/user_request.user_request_response_type.user_request_response.yml patching file config/install/user_request.user_request_type.user_request.yml patching file config/optional/sender.sender_message.user_request_received.yml patching file config/optional/sender.sender_message.user_request_sent.yml patching file config/optional/sender.sender_message.user_request_transition.yml patching file modules/user_request_ui/config/install/views.view.user_request_received.yml patching file modules/user_request_ui/config/install/views.view.user_request_sent.yml patching file modules/user_request_ui/user_request_ui.module patching file src/Access/RequestAccessControlHandler.php patching file src/Access/RequestEditFormAccessCheck.php patching file src/Access/RequestPermissionProvider.php patching file src/Access/ResponseAccessControlHandler.php patching file src/Access/ResponsePermissionProvider.php patching file src/Entity/ContentEntityBase.php patching file src/Entity/ContentEntityInterface.php patching file src/Entity/Request.php patching file src/Entity/RequestInterface.php patching file src/Entity/RequestTypeInterface.php patching file src/Entity/Response.php patching file src/Entity/ResponseInterface.php patching file src/EventSubscriber/DeleteResponseSubscriber.php patching file src/EventSubscriber/SendMessageSubscriber.php patching file src/Form/RequestTypeForm.php patching file src/Form/ResponseForm.php patching file src/Guard/RequestGuard.php patching file tests/src/Kernel/Entity/RequestTest.php patching file tests/src/Kernel/Entity/RequestTypeTest.php patching file tests/src/Kernel/Entity/ResponseTest.php patching file tests/src/Kernel/Form/ResponseFormTest.php patching file tests/src/Kernel/Routing/RequestHtmlRouteProviderTest.php patching file tests/src/Kernel/Routing/ResponseHtmlRouteProviderTest.php patching file tests/src/Kernel/TransitionFormAlterTest.php patching file tests/src/Traits/RequestMockTrait.php patching file tests/src/Unit/Access/AccessControlHandlerTest.php patching file tests/src/Unit/Access/AccessTest.php patching file tests/src/Unit/Access/FormAccessCheckTest.php patching file tests/src/Unit/Access/RequestAccessControlHandlerTest.php patching file tests/src/Unit/Access/RequestEditFormAccessCheckTest.php patching file tests/src/Unit/Access/ResponseAccessControlHandlerTest.php patching file tests/src/Unit/Access/ResponseFormAccessCheckTest.php patching file tests/src/Unit/EventSubscriber/DeleteResponseSubscriberTest.php patching file tests/src/Unit/EventSubscriber/EventSubscriberTest.php patching file tests/src/Unit/EventSubscriber/SendMessageSubscriberTest.php patching file tests/src/Unit/Guard/RequestGuardTest.php patching file tests/src/Unit/UnitTestCase.php patching file user_request.info.yml patching file user_request.module
Still there are remaining errors.
Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/contrib $ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml user_request/ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\modules\user_request_ui\user_request_ui.info.yml ------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------ 1 | WARNING | "core_version_requirement" property is missing in the info.yml file ------------------------------------------------------------------------------------------------------------------------------ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\modules\user_request_ui\user_request_ui.module ---------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------- 3 | ERROR | Missing short description in doc comment ---------------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Access\RequestAccessControlHandler.php ------------------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------ 32 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------------ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Access\RequestEditFormAccessCheck.php ----------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------- 30 | WARNING | Line exceeds 80 characters; contains 85 characters ----------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Access\ResponseAccessControlHandler.php ------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------- 32 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Entity\Request.php ----------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------- 58 | WARNING | The class short comment should describe what the class does and not simply repeat the class name ----------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Entity\RequestInterface.php ------------------------------------------------------------------------------------------------------------------ FOUND 2 ERRORS AFFECTING 2 LINES ------------------------------------------------------------------------------------------------------------------ 20 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph 54 | ERROR | Missing parameter name ------------------------------------------------------------------------------------------------------------------ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Entity\Response.php ----------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------- 53 | WARNING | The class short comment should describe what the class does and not simply repeat the class name ----------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Entity\ResponseInterface.php ------------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------ 20 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\EventSubscriber\SendMessageSubscriber.php --------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------- 63 | ERROR | Doc comment is empty --------------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Form\RequestTypeForm.php ------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES ------------------------------------------------------------------------------------------------------------------- 36 | ERROR | Missing parameter name 251 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Form\ResponseForm.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 25 | ERROR | Parameter $request is not described in comment 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\src\Guard\RequestGuard.php -------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------- 23 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 31 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph -------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\tests\src\Kernel\Entity\RequestTest.php --------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------- 25 | ERROR | Missing @var tag in member variable comment --------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\tests\src\Kernel\Entity\ResponseTest.php ---------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------- 24 | ERROR | Missing member variable doc comment ---------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\tests\src\Kernel\TransitionFormAlterTest.php -------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------------- 80 | WARNING | Line exceeds 80 characters; contains 100 characters 107 | WARNING | Line exceeds 80 characters; contains 123 characters -------------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\contrib\user_request\tests\src\Unit\Access\RequestEditFormAccessCheckTest.php -------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES -------------------------------------------------------------------------------------------------------------------------------------- 72 | WARNING | Line exceeds 80 characters; contains 81 characters 81 | WARNING | Line exceeds 80 characters; contains 91 characters 91 | WARNING | Line exceeds 80 characters; contains 97 characters 101 | WARNING | Line exceeds 80 characters; contains 95 characters 120 | WARNING | Line exceeds 80 characters; contains 81 characters 129 | WARNING | Line exceeds 80 characters; contains 81 characters 138 | WARNING | Line exceeds 80 characters; contains 91 characters 148 | WARNING | Line exceeds 80 characters; contains 95 characters 158 | WARNING | Line exceeds 80 characters; contains 95 characters 168 | WARNING | Line exceeds 80 characters; contains 97 characters -------------------------------------------------------------------------------------------------------------------------------------- Time: 1.14 secs; Memory: 12MB
- First commit to issue fork.
- First commit to issue fork.
- First commit to issue fork.
- ๐ฎ๐ณIndia zkhan.aamir
Hi,
MR #15 applied successfully.
Admin@DESKTOP-252TO6V MINGW64 ~/Desktop/projects/drupal/web/modules/user_request (8.x-1.x) $ curl https://git.drupalcode.org/project/user_request/-/merge_requests/1.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 90084 0 90084 0 0 141k 0 --:--:-- --:--:-- --:--:-- 141k patching file config/install/user_request.user_request_response_type.user_request_response.yml patching file config/install/user_request.user_request_type.user_request.yml patching file config/optional/sender.sender_message.user_request_received.yml patching file config/optional/sender.sender_message.user_request_sent.yml patching file config/optional/sender.sender_message.user_request_transition.yml patching file modules/user_request_ui/config/install/views.view.user_request_received.yml patching file modules/user_request_ui/config/install/views.view.user_request_sent.yml patching file modules/user_request_ui/user_request_ui.module patching file src/Access/RequestAccessControlHandler.php patching file src/Access/RequestEditFormAccessCheck.php patching file src/Access/RequestPermissionProvider.php patching file src/Access/ResponseAccessControlHandler.php patching file src/Access/ResponsePermissionProvider.php patching file src/Entity/ContentEntityBase.php patching file src/Entity/ContentEntityInterface.php patching file src/Entity/Request.php patching file src/Entity/RequestInterface.php patching file src/Entity/RequestTypeInterface.php patching file src/Entity/Response.php patching file src/Entity/ResponseInterface.php patching file src/EventSubscriber/DeleteResponseSubscriber.php patching file src/EventSubscriber/SendMessageSubscriber.php patching file src/Form/RequestTypeForm.php patching file src/Form/ResponseForm.php patching file src/Guard/RequestGuard.php patching file tests/src/Kernel/Entity/RequestTest.php patching file tests/src/Kernel/Entity/RequestTypeTest.php patching file tests/src/Kernel/Entity/ResponseTest.php patching file tests/src/Kernel/Form/ResponseFormTest.php patching file tests/src/Kernel/Routing/RequestHtmlRouteProviderTest.php patching file tests/src/Kernel/Routing/ResponseHtmlRouteProviderTest.php patching file tests/src/Kernel/TransitionFormAlterTest.php patching file tests/src/Traits/RequestMockTrait.php patching file tests/src/Unit/Access/AccessControlHandlerTest.php patching file tests/src/Unit/Access/AccessTest.php patching file tests/src/Unit/Access/FormAccessCheckTest.php patching file tests/src/Unit/Access/RequestAccessControlHandlerTest.php patching file tests/src/Unit/Access/RequestEditFormAccessCheckTest.php patching file tests/src/Unit/Access/ResponseAccessControlHandlerTest.php patching file tests/src/Unit/Access/ResponseFormAccessCheckTest.php patching file tests/src/Unit/EventSubscriber/DeleteResponseSubscriberTest.php patching file tests/src/Unit/EventSubscriber/EventSubscriberTest.php patching file tests/src/Unit/EventSubscriber/SendMessageSubscriberTest.php patching file tests/src/Unit/Guard/RequestGuardTest.php patching file tests/src/Unit/UnitTestCase.php patching file user_request.info.yml patching file user_request.module
Still issues remaining
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml user_request/ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\modules\user_request_ui\user_request_ui.info.yml ---------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------- 1 | WARNING | "core_version_requirement" property is missing in the info.yml file ---------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\src\Entity\Request.php ----------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------- 58 | WARNING | The class short comment should describe what the class does and not simply repeat the class name ----------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\src\Entity\Response.php ----------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------- 53 | WARNING | The class short comment should describe what the class does and not simply repeat the class name ----------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\src\Form\RequestTypeForm.php -------------------------------------------------------------------------------------------------- FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES -------------------------------------------------------------------------------------------------- 36 | ERROR | Missing parameter name 39 | ERROR | Parameter tags must be grouped together in a doc comment 39 | ERROR | Missing parameter name 250 | WARNING | Line exceeds 80 characters; contains 82 characters -------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\src\Form\ResponseForm.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\src\Guard\RequestGuard.php ------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------ 23 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ------------------------------------------------------------------------------------------------ FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\user_request\tests\src\Unit\Access\RequestEditFormAccessCheckTest.php ------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES ------------------------------------------------------------------------------------------------------------------------------ 72 | WARNING | Line exceeds 80 characters; contains 81 characters 81 | WARNING | Line exceeds 80 characters; contains 91 characters 91 | WARNING | Line exceeds 80 characters; contains 97 characters 101 | WARNING | Line exceeds 80 characters; contains 95 characters 120 | WARNING | Line exceeds 80 characters; contains 81 characters 129 | WARNING | Line exceeds 80 characters; contains 81 characters 138 | WARNING | Line exceeds 80 characters; contains 91 characters 148 | WARNING | Line exceeds 80 characters; contains 95 characters 158 | WARNING | Line exceeds 80 characters; contains 95 characters 168 | WARNING | Line exceeds 80 characters; contains 97 characters ------------------------------------------------------------------------------------------------------------------------------ Time: 908ms; Memory: 12MB
Issue summary as updated.
- First commit to issue fork.