Skip to content

[PEAR.Commenting.FunctionComment] Add option to disable the check for protected/private function#2815

Merged
gsherwood merged 2 commits intosquizlabs:masterfrom
VincentLanglet:functionComment
Oct 30, 2020
Merged

[PEAR.Commenting.FunctionComment] Add option to disable the check for protected/private function#2815
gsherwood merged 2 commits intosquizlabs:masterfrom
VincentLanglet:functionComment

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

@VincentLanglet VincentLanglet commented Jan 12, 2020

Close #2077

@VincentLanglet VincentLanglet changed the title Add option to disable the check for protected/private function [PEAR.Commenting.FunctionComment] Add option to disable the check for protected/private function Jan 12, 2020
$ignore = Tokens::$emptyTokens;
$ignore[] = T_STATIC;

$scopeModifier = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth using $phpcsFile->getMethodProperties($stackPtr) to gather the method visibility + just check the scope index of the return value, instead of looking for it yourself. Makes a bit more future-proof.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsherwood Done

@gsherwood gsherwood added this to the 3.5.6 milestone Mar 10, 2020
@gsherwood gsherwood modified the milestones: 3.5.6, 3.6.0 Jun 22, 2020
gsherwood added a commit that referenced this pull request Oct 30, 2020
gsherwood added a commit that referenced this pull request Oct 30, 2020
@gsherwood gsherwood merged commit 8a89dfa into squizlabs:master Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check doc comment only for public methods.

2 participants