Add support for sensitive parameters in stubs#8689
Conversation
0fba3f5 to
2e3e0bd
Compare
2e3e0bd to
cb0bfb7
Compare
TimWolla
left a comment
There was a problem hiding this comment.
Thanks for working on this! This LGTM as far as I am qualified to tell.
d03edf8 to
197faf4
Compare
|
Is there a particular reason why we went with a doc-comment instead of |
197faf4 to
79c4ead
Compare
No, not really. It's just that we have been using phpdoc and attributes don't offer too much value in this case as we have to process stubs via PHP-Parser anyway. |
79c4ead to
408c96b
Compare
iluuu1994
left a comment
There was a problem hiding this comment.
Sorry for the delay. They're just minor comments.
| } | ||
|
|
||
| spl_autoload_register(function(string $class) use($phpParserDir) { | ||
| spl_autoload_register(function(string $class) use ($phpParserDir) { |
There was a problem hiding this comment.
Since you made the one above static, this one can also be static.
| return implode('_', $this->name->parts); | ||
| } | ||
|
|
||
| public function getAttributeName(): string { |
There was a problem hiding this comment.
This name is a bit confusing. It's not the attribute name but the canonicalized (ie lowercased) function/method name to attach the given attribute to.
There was a problem hiding this comment.
Yes, you are right. However, I think it's better if the method name reflects the use-case (similarly togetMethodSynopsisFilename() and getArgInfoName()) instead of using "canonicalized". That's why I changed getAttributeName() for getNameForAttributes() in b2ed625. Hopefully, it addresses your comments and make intention more clear.
| case 'prefer-ref': | ||
| case 'sensitive-param': | ||
| $varName = $tag->getVariableName(); | ||
| if (!isset($paramMeta[$varName])) { |
There was a problem hiding this comment.
The isset block is redundant, $paramMeta[$varName][$tag->name] = true; will automatically create the outer array.
There was a problem hiding this comment.
Yeah, I also noticed this, but didn't want to touch it as this piece of code was originally written by Nikita
To make the implementation of #8352 easier.