PHPCSStandards / PHPCSExtra

A collection of code standards for use with PHP_CodeSniffer
GNU Lesser General Public License v3.0
90 stars 8 forks source link

CodeAnalysis/ConstructorDestructorReturn: correctly ignore PHP-4-style constructors in namespaced classes #272

Closed jrfnl closed 12 months ago

jrfnl commented 12 months ago

Methods with the same name as a class are not recognized as PHP4-style constructors in namespaced classes.

This was so far not taken into account in this sniff, leading to false positives.

A better solution, with a lower performance impact is expected at a later point in time (namespace tracker), however, as my time is limited, it may still be a while before that solution is available.

In the mean time, let's just fix it.

Includes test.

Related to #207