Open
Description
PHPCS 4.0 makes a couple of changes to the File::getDeclarationName()
method, which have been applied to the BCFile::getDeclarationName()
method via PR #674 for PHPCSUtils 1.1.0, but should be considered a breaking change for the PHPCSUtils native ObjectDeclarations::getName()
method.
To be specific, the changes we're talking about are:
- The
[BC]File::getDeclarationName()
method(s) no longer acceptingT_CLOSURE
orT_ANON_CLASS
tokens.
If these tokens are passed, an exception should be thrown instead. - The
[BC]File::getDeclarationName()
method(s) will now always return astring
, which could potentially be an empty string if the name could not be determined.
I.e. the method will no longer returnnull
for anonymous structures and parse errors, but will throw an exception for the first (as per above) and return an empty string for the second.
These changes should still be made for the ObjectDeclarations::getName()
method, but need to be deferred to PHPCSUtils 2.0.0.