- Issue created by @papagrande
- 🇺🇸United States papagrande US West Coast
Some of the fixes could be done by a novice, but don't worry if you can't figure out fixes for all the doc comments.
- Assigned to vimal_nadar
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:24am 26 April 2023 - Status changed to Needs work
over 1 year ago 4:03pm 26 April 2023 - 🇺🇸United States papagrande US West Coast
Thanks, @vimal_nadar.
+++ b/socrata_catalog_search/src/Plugin/views/field/SocrataList.php @@ -44,7 +44,7 @@ class SocrataList extends PrerenderList { + public function renderItem($count, $item) {
The method name shouldn't be changed as it's actually implementing https://api.drupal.org/api/drupal/core%21modules%21views%21src%21Plugin%....
Instead, please add a phpcs ignore (https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignorin...) to make the code sniffer not fail the method name.Reviewers, please don't just test applying the patch. Review the code changes to ensure they make sense in the context of the module and confirm the functionality is still working.
- Assigned to vimal_nadar
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 4:50pm 26 April 2023 - Status changed to Needs work
over 1 year ago 5:26pm 26 April 2023 - 🇵🇭Philippines roberttabigue
Hi @vimal_nadar
The errors still exist after applying Patch #8 to the Socrata module against the 8.x-1.x-dev version and with Drupal core 9.5.6.
Please see the attached screenshots.
Thanks.
- Status changed to Needs review
over 1 year ago 6:01pm 26 April 2023 - 🇺🇸United States papagrande US West Coast
@roberttabigue, thanks for reviewing, but I think you're sniffing the 7.x-1.x version. This issue is for 8.x-1.x.
- Status changed to Needs work
over 1 year ago 7:05pm 26 April 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+ // phpcs:disable public function render_item($count, $item) { + // phpcs:enable
It is sufficient to use
phpcs:ignore
instead ofphpcs:disable
.
Also, the method should have a documentation comment, even if that would simply contain{@inheritDoc}
.+ /** + * The name of the field to use for domain filtering. + * + * @var string + * The name of the field to use for domain filtering. + */
There is no need to repeat the short description after
@var
. That is not what the Drupal coding standards say to do, anyway.+ /** + * Indicates whether this form element has an #aggregate callback set. + * + * @var bool + * TRUE if the data should be aggregated, FALSE otherwise.
There are no descriptions to add on the line after
@var
.- return Url::fromUri($this->getUrl(), ['query' => $params, 'absolute' => TRUE])->toString(); + return Url::fromUri($this->getUrl(), [ + 'query' => $params, + 'absolute' => TRUE, + ])->toString(); }
Lines are allowed to be longer than 80 characters, if they are more readable.
- Status changed to Needs review
over 1 year ago 4:28am 27 April 2023 - Status changed to Needs work
over 1 year ago 7:35am 27 April 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
/** - * {@inheritdoc} + * Renders an individual item. + * + * @param int $count + * The count of the item being rendered. + * @param array $item + * The item to be rendered. + * + * @return string + * The rendered item. + * + * @inheritdoc
The existing documentation comment is already correct. The change is not.
When a documentation comment contains just{@inheritdoc}
, it means it is a method inherited from the parent class or defined from an interface. There is no need to describe its parameters or the return value, since the purpose of{@inheritdoc}
is to avoid duplicate information already given.+ /** + * The name of the search field used for full-text search queries. + * + * @var string + * The name of the search field.
Same error already reported. (After the line containing
@var
, there are not descriptions to be added.)+ // phpcs:ignore return Url::fromUri($this->getUrl(), ['query' => $params, 'absolute' => TRUE])->toString();
I am not sure which error is being suppressed there.
- Assigned to vimal_nadar
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 5:53am 28 April 2023 - Status changed to Needs work
over 1 year ago 8:03am 28 April 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
/** * {@inheritdoc} + * + * This method returns the bare value of the item's #plain_text key + * to avoid double-escaping the string. */
The return value is already documented in the parent classes or an interface those classes implement; there is no need to repeat it. That's why
{@inheritdoc}
is used.
Since you are leaving{@inheritdoc}
, I take it is correct to use it. In this case, the change is not correct. - 🇮🇳India vimal_nadar
@apaderno do you want me to remove the description which I have written after the inheritdoc? or I need to add something else as i am still confused with comment 16 ?
- 🇮🇹Italy apaderno Brescia, 🇮🇹
{@inheritdoc}
is sufficient as documentation comment, when it is used. - Assigned to vimal_nadar
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 5:37pm 28 April 2023 - Status changed to Needs work
over 1 year ago 10:06am 2 May 2023 - 🇵🇭Philippines roberttabigue
Hi @vimal_nadar,
Failed to reflect the fixes due to errors when applying patch #20.
Kindly refer the screenshots attached, please.
Thank you.
- Assigned to nitin_lama
- Issue was unassigned.
- 🇮🇳India nitin_lama India
#20 patch applies cleanly. @roberttabigue
There were still some phpcs errors and warning left.
I've fixed some issues. Not sure how to fix remaining issue.
Remaining issues.
- First commit to issue fork.
- @skpal opened merge request.
- Assigned to skpal
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:04am 8 June 2023 - Status changed to RTBC
over 1 year ago 4:02pm 23 June 2023 - 🇵🇭Philippines roberttabigue
Hi @skpal,
I reviewed your changes and all good for me.
And after applying your latest MR, confirmed all PHPCS errors have been fixed.I reran this command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
Applied to Socrata module with 8.x-1.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:55pm 23 June 2023 - 🇮🇳India skpal Bhubaneswar
Hi @apaderno,
I have updated the commit with the requested changes. Please review.
Thanks in advance.
- Status changed to Needs review
over 1 year ago 5:23pm 23 June 2023 - Status changed to Needs work
over 1 year ago 3:19pm 24 June 2023 - Status changed to Needs review
over 1 year ago 3:48pm 24 June 2023 - Status changed to RTBC
over 1 year ago 10:17am 29 June 2023 - 🇵🇭Philippines roberttabigue
Hi @apaderno, @skpal
I reviewed the latest changes and I can verify that all works for me.
Applied the latest MR as well, reran the phpcs command, and confirmed no PHPCS errors were found.Attached screenshot for your reference.
Moving this now to RTBC.
I hope everything is in order.
Thank you.