- Merge request !6Issue #3329641: Drupal Coding Standards Issues | phpcs โ (Open) created by Charchil Khandelwal
- ๐ฎ๐ณIndia Charchil Khandelwal
Thanks @samit.310@gmail.com, patch #2 applied cleanly, all errors and warnings are fixed.
And i also created MR for same.
Please review. - Status changed to Needs work
over 1 year ago 2:03pm 13 May 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
-`composer require oomphinc/composer-installers-extender npm-asset/quicklink:^2.0` +`composer require oomphinc/composer-installers-extender + npm-asset/quicklink:^2.0`
Lines showing commands should not be split on two or more lines or be formatted to make clear the command is only one.
/** - * Class QuicklinkConfig. + * The Class QuicklinkConfig. */ class QuicklinkConfigForm extends ConfigFormBase {
That description is still repeating the class name instead of describing what the class does.
Also, the report does not show any warning/error for that line, which means that either the report is not complete, or the patch is changing files that should not change. (I take it is the first, since Class QuicklinkConfig. is not describing what the class does.)+ /** + * The quicklink_config_form_validate function. + * @codingStandardsIgnoreStart + */ public function quicklink_config_form_validate($form, &$form_state) {
There is no need to use
@codingStandardsIgnoreStart
.dependencies: - - quicklink + - drupal:quicklink
The Quicklink module (this module) is not a Drupal core module.
- ๐ฎ๐ณIndia Anita verma
Anita Verma โ made their first commit to this issueโs fork.
- last update
about 1 year ago 3 pass - Status changed to Needs review
about 1 year ago 10:43am 1 December 2023 - last update
about 1 year ago 3 pass - ๐ฎ๐ณIndia Anita verma
Hello
Updated the suggested changes as per #6 .
Kindly review the changes.
Thankyou. - Status changed to Needs work
6 months ago 6:36am 13 June 2024 - ๐ฎ๐ณIndia dev16.addweb
Hello,
After checking, I discovered one more error. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch 3329641-drupal-coding-standards to hidden.
- last update
6 months ago 3 pass - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
It seems part of the changes done in this issue has been already committed. The only PHP_CodeSniffer error reported by GitLab CI is the following one.
FILE: ...9641/web/modules/custom/quicklink-3329641/src/Form/QuicklinkConfigForm.php -------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 65 | ERROR | Public method name | | "QuicklinkConfigForm::quicklink_config_form_validate" is not in | | lowerCamel format | | (Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps) -------------------------------------------------------------------------------- Time: 237ms; Memory: 6MB
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Trully, that method can be removed: It is not used and it duplicates
/** * The validateForm method for the QuicklinkConfigForm. */ public function quicklink_config_form_validate($form, &$form_state) { $parameterFieldsToValidate = [ 'total_request_limit', 'concurrency_throttle_limit', 'viewport_delay', 'idle_wait_timeout', ]; foreach ($parameterFieldsToValidate as $value) { $formValue = $form_state['values'][$value]; if ($formValue !== '' && (!is_numeric($formValue) || intval($formValue) != $formValue || $formValue < 0)) { form_set_error($value, $this->t('%name must be a positive integer or zero.', [ '%name' => $form['throttle_options'][$value]['#title'], ])); } } }
/** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { $parameterFieldsToValidate = [ 'total_request_limit', 'concurrency_throttle_limit', 'viewport_delay', 'idle_wait_timeout', ]; foreach ($parameterFieldsToValidate as $value) { $formValue = $form_state->getValues()[$value]; if ($formValue !== '' && (!is_numeric($formValue) || intval($formValue) != $formValue || $formValue < 0 || $formValue < '')) { $form_state->setErrorByName($value, $this->t('%name must be a positive integer or zero.', [ '%name' => $form['throttle_options'][$value]['#title'], ])); } } parent::validateForm($form, $form_state); }
- last update
6 months ago 3 pass - Status changed to Needs review
6 months ago 7:33am 13 June 2024 - ๐ต๐ญPhilippines clarkssquared
Hi
I applied the updated MR !9 and I can confirm that it fixes PHPCS issues
โ quicklink git:(2.0.x) curl https://git.drupalcode.org/project/quicklink/-/merge_requests/9.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10100 0 10100 0 0 15314 0 --:--:-- --:--:-- --:--:-- 15467 patching file .gitlab-ci.yml patching file README.md patching file quicklink.install patching file quicklink.module patching file 'src/Form/QuicklinkConfigForm.php' patching file 'tests/quicklink_test/quicklink_test.info.yml' โ quicklink git:(2.0.x) โ .. โ contrib git:(master) โ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml quicklink โ contrib git:(master) โ
retaining the status to needs review for other's feedback