- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Removing a branch is not something can be done with a patch. If a branch needs to be removed, an issue must be created only for that task.
The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command and arguments have been used, and which report that command shown.
- Status changed to Needs review
over 1 year ago 3:24pm 14 May 2023 - ๐ฎ๐ณIndia chaitanyadessai Goa
Please review Patch, checked with below phpcs commands, --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig
- Status changed to Needs work
over 1 year ago 10:18am 15 May 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
The issue summary still does not show which command and which arguments have been used. The status is for the issue summary that needs to be updated.
- Assigned to nitin_lama
- Status changed to Needs review
over 1 year ago 1:53pm 24 May 2023 - Issue was unassigned.
- Status changed to Needs work
over 1 year ago 3:44pm 24 May 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
-core: 8.x type: module +core_version_requirement: '^8'
The report does not say that
core: 8.x
must be removed. Furthermore,core: 8.x
andcore_version_requirement: '^8'
are not equivalent.core_version_requirement
is not even recognized before Drupal 8.7.7.- * setLoginButtonSettings() method sets up the settings for the login button. + * SetLoginButtonSettings() method sets up the settings for the login button.
Function and method names are not changed in a comment just to make it start with a capitalized word.
The correct comment is The setLoginButtonSettings() method sets up the settings for the login button./** * Implements hook_uninstall(). * - * deleteLoginButtonSettings() method deletes the settings for the login button. + * DeleteLoginButtonSettings() method deletes the settings for the login button.
Similar change must be done here.
+/** + * @file + * The module file. + */
The usual module description is Hook implementations for the [module name] module. where [module name] is replaced by the module name shown in the .info.yml file.
/** - * @param $form + * Altering the wechat user form. + * + * @param aray $form + * The form. * @param \Drupal\Core\Form\FormStateInterface $form_state - * @param $form_id - * Hide email and password field if the current user doesn't have admin users permission + * The current form state. + * @param string $form_id + * Hide email and password field if the current user doesn't have admin users + * permission. */ function social_auth_wechat_form_user_form_alter(&$form, FormStateInterface $form_state, $form_id) {
Documentation comments for hook implementations are different.
+ /** + * The configuration factory service. + * + * @var \Drupal\Core\Config\ConfigFactory + */ + protected $configFactory;
The configuration factory. is sufficient.
+ * @param \Drupal\Core\Config\ConfigFactory $configFactory + * Configuration object.
A definite article is missing in the description.
- public function __construct(NetworkManager $network_manager, - SocialAuthUserManager $user_manager, - MessengerInterface $messenger) { + public function __construct( + NetworkManager $network_manager, + SocialAuthUserManager $user_manager, + MessengerInterface $messenger, + ConfigFactory $configFactory + ) {
Method/function declarations are written in a single line.
* It later sets the permissions that should be asked for, and redirects the - * user to WeChat Accounts to allow him to grant those permissions. + * user to WeChat Accounts to allow it to grant those permissions.
- * After the user grants permission, WeChat redirects him to a url specified + * After the user grants permission, WeChat redirects it to a url specified * in the WeChat project settings. In this case, it should redirects to
it is not the pronoun used with user. It is better to replace user with users and it with them.
url is misspelled, since it is an acronym.- /** @var \Drupal\Core\Session\AccountInterface $current_user */ + /** + * @var \Drupal\Core\Session\AccountInterface $current_user + */
+ /** + * @var \Overtrue\Socialite\Providers\WeChatProvider $client + */
The existing comments are already correct.
+ /** * The request object. + * * @var \Symfony\Component\HttpFoundation\Request */
The request. is sufficient.
- // Checks if the dependency, the \Overtrue\Socialite\SocialiteManager library, is available. + // Checks if the dependency, the \Overtrue\Socialite\SocialiteManager + // library, is available.
Checks if \Overtrue\Socialite\SocialiteManager is available. would be sufficient, but it is not necessary to explain what a line containing
class_exists($class_name))
after a$class_name = '\Overtrue\Socialite\SocialiteManager';
line does.
- Assigned to sourabhjain
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 6:45am 30 May 2023 - ๐ฎ๐ณIndia sourabhjain
Fixed the issues mentioned in #39. Please review.
- Status changed to RTBC
over 1 year ago 4:45pm 22 June 2023 - ๐ต๐ญPhilippines roberttabigue
Hi @sourabhjain,
I reviewed the changes and after applying your patch #4, confirmed all PHPCS errors have been fixed.
I ran the following commands:
1. phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
2. phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,jsAttaching screenshots.
I'm moving this now to RTBC.
Thanks!
- Status changed to Needs work
over 1 year ago 6:14pm 22 June 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
/** - * @param $form + * Implements hook_form_FORM_ID_alter(). + * + * @param aray $form + * The form. * @param \Drupal\Core\Form\FormStateInterface $form_state - * @param $form_id - * Hide email and password field if the current user doesn't have admin users permission + * The current form state. + * @param string $form_id + * Hide email and password field if the current user doesn't have admin users + * permission. */ function social_auth_wechat_form_user_form_alter(&$form, FormStateInterface $form_state, $form_id) {
With hook implementations, the documentation comment contains only the description, not also the parameter descriptions.
+ * @param \Drupal\Core\Config\ConfigFactory $configFactory + * The Configuration object.
Configuration must not be capitalized, since it is not the first word in the description.
- * After the user grants permission, WeChat redirects him to a url specified + * After the users grants permission, WeChat redirects them to a url specified
It is After users are granted permission since users receive a new permission; they do not give a new permission.
Since that comment is changed, it is also specified URL.* @return \Symfony\Component\HttpFoundation\RedirectResponse + * A redirect response returned by controller.
A definite article is missing before controller.
- Status changed to Needs review
over 1 year ago 6:28am 23 June 2023 - ๐ฎ๐ณIndia sourabhjain
Fixed the issue mentioned in #44. Please review.
- Status changed to RTBC
over 1 year ago 3:51pm 23 June 2023 - ๐ต๐ญPhilippines roberttabigue
Hi @sourabhjain,
I reviewed your changes and all good for me.
And after applying your patch #44, confirmed no PHPCS errors were found.I reran the following commands:
1. phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
2. phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,jsApplied to Social Auth WeChat module with 8.x-2.x-dev version and with the Drupal core version of 9.5.x.
Attaching screenshots.
I'm moving this again to RTBC for review.
Thanks!
- Status changed to Needs work
over 1 year ago 4:07pm 23 June 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- $is_wechat_account = substr($form['account']['mail']['#default_value'], -strlen('wechat')) == 'wechat' ? true : false; + $is_wechat_account = substr($form['account']['mail']['#default_value'], -strlen('wechat')) == 'wechat' ? TRUE : FALSE;
There must be a space between
-
andstrlen
.* It later sets the permissions that should be asked for, and redirects the - * user to WeChat Accounts to allow him to grant those permissions. + * users to WeChat Accounts to allow it to grant those permissions.
The pronoun for users is them, not it.
Also, to allow them to grant those permissions is probably not correct, since users receive permissions; they do not grant permissions. In this case, the correct sentence is It later sets the permissions that should be asked for, and redirects users to WeChat Accounts to give them those permissions.- // Checks if the dependency, the \Overtrue\Socialite\SocialiteManager library, is available. + // Checks if \Overtrue\Socialite\SocialiteManager is available.
Inside functions and methods, verbs are declined on the second person singular (check, not checks).
- Status changed to Needs review
over 1 year ago 6:43am 25 June 2023 - ๐ฎ๐ณIndia bharath-kondeti Hyderabad
Addressed #46 and updated the patch. Please review
- Status changed to Needs work
over 1 year ago 8:06am 25 June 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- $is_wechat_account = substr($form['account']['mail']['#default_value'], -strlen('wechat')) == 'wechat' ? true : false; + $is_wechat_account = substr($form['account']['mail']['#default_value'], - strlen('wechat')) == 'wechat' ? TRUE : FALSE;
I apologize: I missed the comma before
strlen('wechat')
. The code is not subtracting a value from another one; it is making a number negative. The space after-
is not necessary.* It later sets the permissions that should be asked for, and redirects the - * user to WeChat Accounts to allow him to grant those permissions. + * users to WeChat Accounts to allow them to grant those permissions.
Apart from changing the used pronoun, the sentence has not been changed as per my previous comment.
- // Checks if the dependency, the \Overtrue\Socialite\SocialiteManager library, is available. + // Check if \Overtrue\Socialite\SocialiteManager is available. $class_name = '\Overtrue\Socialite\SocialiteManager'; if (!class_exists($class_name)) { throw new SocialApiException(sprintf('The PHP SDK for WeChat OAuth could not be found. Class: %s.', $class_name)); }
The change is correct, but that comment can be removed, as there is no need to document what the code that calls
class_exists()
does. - Status changed to Needs review
over 1 year ago 7:35am 10 July 2023 - ๐ฎ๐ณIndia mrinalini9 New Delhi
Updated patch #47 by addressing #48, please review it.
Thanks & Regards,
Mrinalini - Status changed to RTBC
over 1 year ago 1:09pm 11 July 2023 - ๐ต๐ญPhilippines roberttabigue
Hi,
I reviewed the changes of @mrinalini9 and confirmed her patch was applied cleanly.
Checking patch social_auth_wechat.info.yml... Checking patch social_auth_wechat.install... Checking patch social_auth_wechat.module... Checking patch social_auth_wechat.routing.yml... Checking patch src/Controller/WeChatAuthController.php... Checking patch src/Form/WeChatAuthSettingsForm.php... Checking patch src/Plugin/Network/WeChatAuth.php... Checking patch src/Settings/WeChatAuthSettings.php... Applied patch social_auth_wechat.info.yml cleanly. Applied patch social_auth_wechat.install cleanly. Applied patch social_auth_wechat.module cleanly. Applied patch social_auth_wechat.routing.yml cleanly. Applied patch src/Controller/WeChatAuthController.php cleanly. Applied patch src/Form/WeChatAuthSettingsForm.php cleanly. Applied patch src/Plugin/Network/WeChatAuth.php cleanly. Applied patch src/Settings/WeChatAuthSettings.php cleanly.
After running the phpcs command, there are no PHPCS errors anymore.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig social_auth_wechat
Please see attached file for reference and moving this now to RTBC.
Thank you!
- Status changed to Needs work
over 1 year ago 9:27am 12 July 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- * setLoginButtonSettings() method sets up the settings for the login button. + * The setLoginButtonSettings() method sets up the settings for login button.
Since that comment is changed, for login button should be changed to for the login button.
- * deleteLoginButtonSettings() method deletes the settings for the login button. + * The deleteLoginButtonSettings() method deletes the settings for login button.
The same change should be done there.
Truly, I would remove the full sentence in both the case, since it is not necessary to explain what thesetLoginButtonSettings()
method or thedeleteLoginButtonSettings()
method does because that is already clear from the method name. - Status changed to Needs review
over 1 year ago 10:56am 12 July 2023 - ๐ฎ๐ณIndia sourabhjain
Updated the changes suggested in #51. Please review.
- Status changed to RTBC
over 1 year ago 1:31pm 12 July 2023 - ๐ต๐ญPhilippines roberttabigue
Hi,
I applied the patch provided by @sourabhjain and confirmed the Patch applied cleanly without affecting the other coding standards.
Checking patch social_auth_wechat.info.yml... Checking patch social_auth_wechat.install... Checking patch social_auth_wechat.module... Checking patch social_auth_wechat.routing.yml... Checking patch src/Controller/WeChatAuthController.php... Checking patch src/Form/WeChatAuthSettingsForm.php... Checking patch src/Plugin/Network/WeChatAuth.php... Checking patch src/Settings/WeChatAuthSettings.php... Applied patch social_auth_wechat.info.yml cleanly. Applied patch social_auth_wechat.install cleanly. Applied patch social_auth_wechat.module cleanly. Applied patch social_auth_wechat.routing.yml cleanly. Applied patch src/Controller/WeChatAuthController.php cleanly. Applied patch src/Form/WeChatAuthSettingsForm.php cleanly. Applied patch src/Plugin/Network/WeChatAuth.php cleanly. Applied patch src/Settings/WeChatAuthSettings.php cleanly.
I attached a screenshot for reference.
Moving this again to RTBC.
Thank you!