Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PEAR\Commenting\FunctionComment] Improve check for special method and add an option #2925

Merged
merged 1 commit into from Apr 8, 2021
Merged

[PEAR\Commenting\FunctionComment] Improve check for special method and add an option #2925

merged 1 commit into from Apr 8, 2021

Conversation

VincentLanglet
Copy link
Contributor

This would close #2924

Report

class Bar {
    /**
     * The PHP5 constructor
     *
     * @return
     */
    public function __construct() {
    }
}

as an error.

And allow to override the list of specialMethod, in order to add others or to disallow this special behaviour by passing an empty array.

Copy link
Contributor

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

Please add some tests with different values for the new property.

@VincentLanglet
Copy link
Contributor Author

VincentLanglet commented Apr 1, 2020

@jrfnl Sure ! But do I override an array property ?

@jrfnl
Copy link
Contributor

jrfnl commented Apr 1, 2020

Sure ! But do I override an array property ?

@VincentLanglet See: #1999

@jrfnl
Copy link
Contributor

jrfnl commented Apr 1, 2020

Oh and I should probably also point you to this open issue: #2228 Not sure you are aware of it and it will affect the new property you are adding.

@VincentLanglet
Copy link
Contributor Author

Done @jrfnl ! And I added the same for the Squizz sniff.

I am aware of the issue #2228, that's not a problem for me since I'll disable the "special method" treatment.

@VincentLanglet
Copy link
Contributor Author

Hi @gsherwood ! Are you interested by this PR ? :)
Can it be in the 3.5.6 release ? Thanks

@gsherwood
Copy link
Member

I haven't had time to look at this at all. It's still on my list to review, but will not be added in 3.5.6.

@VincentLanglet
Copy link
Contributor Author

Hi ! I fixed the conflict @gsherwood

Can I expect to see this PR in 3.5.9 ? :)

@gsherwood gsherwood added this to Idea Bank in PHPCS v3 Development via automation Apr 8, 2021
@gsherwood gsherwood added this to the 3.6.0 milestone Apr 8, 2021
gsherwood added a commit that referenced this pull request Apr 8, 2021
@gsherwood gsherwood merged commit fe201de into squizlabs:master Apr 8, 2021
PHPCS v3 Development automation moved this from Idea Bank to Ready for Release Apr 8, 2021
@gsherwood
Copy link
Member

Sorry this took so long - the PHP8 work has been a big distraction.

Thanks a lot of this change. It's going to be in 3.6.0. The documentation is here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties#pearcommentingfunctioncomment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PHPCS v3 Development
Ready for Release
Development

Successfully merging this pull request may close these issues.

[PEAR\Commenting\FunctionComment] Add more check for special methods
3 participants