- 🇮🇹Italy apaderno Brescia, 🇮🇹
- $config_key = $this->getModuleKeyConfigPrefix($form_state->getValue(['custom', 'custom_module']), $form_state->getValue(['custom', 'custom_module_key'])); + $config_key = $this + ->getModuleKeyConfigPrefix( + $form_state->getValue(['custom', 'custom_module']), + $form_state->getValue(['custom', 'custom_module_key']));
The coding standards describe exactly which lines need to be long less than 80 characters. There are many exceptions that needs to be observed. Writing the variable containing the object in a line and the called method in a new line does not make the code easier to read.
- if (($form_state->getValue(['custom', 'custom_formatter']) == '') && ($form_state->getValue(['custom', 'custom_sender']) == '')) { + if (($form_state->getValue(['custom', 'custom_formatter']) == '') && + ($form_state->getValue(['custom', 'custom_sender']) == '')) { $form_state->setErrorByName('custom][custom_formatter', $this->t('At least a formatter or sender is required.'));
I think that is given as example of how not to split a statement, in the coding standards.
name: Mailsystem Test type: module +description: Mailsystem test module package: Testing hidden: true
Is the description for a test module necessary, given that module is hidden?
requirements: + # Please add comment manually here. _access: 'TRUE'
That is not a necessary comment, which does not describe anything about the following line.
- 🇮🇳India kkalashnikov Ghaziabad, India
Include comment #9 in current patch.
- Status changed to Needs review
over 1 year ago 9:11am 13 March 2023 - Assigned to himanshu_jhaloya
- Issue was unassigned.
- 🇮🇳India himanshu_jhaloya Indore
#10 patch applied cleanly, no issue found, Reroll the patch #10 small change.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
Implementing
hook_help()
is not part of this issue, sincephpcs
has not reported anything about that. The last patch contains off-topic changes. - Status changed to Needs work
over 1 year ago 5:14pm 13 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+ if (($form_state->getValue(['custom', 'custom_formatter']) == '') + &&($form_state->getValue(['custom', 'custom_sender']) == '')) {
I think the Drupal coding standards uses code similar to that to show how not to split a
if
statement.+ $config->set('defaults.sender', + $form_state->getValue(['mailsystem', 'default_sender']));
I am not sure that line should be split too. In the case it is, the second line should be indented, to make more evident it is part of the previous line.
- foreach ([MailsystemManager::MAILSYSTEM_TYPE_FORMATTING, MailsystemManager::MAILSYSTEM_TYPE_SENDING] as $type) { + foreach ([MailsystemManager::MAILSYSTEM_TYPE_FORMATTING, + MailsystemManager::MAILSYSTEM_TYPE_SENDING, + ] as $type) {
That seems more code formatted as per PSR12 coding standards.
- Status changed to Needs review
over 1 year ago 6:11am 14 March 2023 - Status changed to Needs work
over 1 year ago 8:45am 14 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+ if ($form_state->hasValue(['custom', 'modules']) && is_array( + $form_state->getValue(['custom', 'modules']))) {
- foreach ([MailsystemManager::MAILSYSTEM_TYPE_FORMATTING, MailsystemManager::MAILSYSTEM_TYPE_SENDING] as $type) { + foreach ([MailsystemManager::MAILSYSTEM_TYPE_FORMATTING, MailsystemManager::MAILSYSTEM_TYPE_SENDING, + ] as $type) {
It is still better to leave the control statement on a single line.
- Assigned to elber
- 🇧🇷Brazil elber Brazil
Hi I fixed the phpcs errors and I did the rebase, please revise.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 3:15pm 1 May 2023 - 🇮🇳India Yashaswi18
Hello, after checking out to the branch and running the phpcs command I found one issue.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,js,yml mailsystem/ FILE: /home/yashaswi/contribs/mailsystem/tests/modules/mailsystem_test/mailsystem_test.info.yml ----------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------- 1 | WARNING | "Description" property is missing in the info.yml file -----------------------------------------------------------------------------------------------
- last update
8 months ago 4 pass - last update
8 months ago 4 pass - Status changed to RTBC
6 months ago 5:17pm 28 May 2024 - 🇵ðŸ‡Philippines roberttabigue
Hi @arunkumark,
I have reviewed the changes and confirmed that Patch #23 was applied cleanly to the Mail System module against 8.x-4.x on Drupal 10.
And all PHPCS errors have been fixed.
I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig mailsystem
Please see the attached file for reference.
I'm moving this now to ‘RTBC’.
Thank you!
- First commit to issue fork.
- last update
6 months ago PHPLint Failed - Status changed to Needs work
6 months ago 6:55pm 1 June 2024