webimpress / coding-standard

Webimpress Coding Standard for PHP_CodeSniffer
BSD 2-Clause "Simplified" License
13 stars 7 forks source link

Fixes importing class constant with global constant names #121

Closed rieschl closed 4 years ago

rieschl commented 4 years ago

If the previous token is const it's a constant declaration and not a usage of a PHP constant.

I'm not 100% sure if thats the right way to do it because it's first time I've looked into sniffs. Also, no idea how to write a test for that 🙂

fixes #120

Edit: If it's not correct, just close the PR Edit2: If you're fine with it, I'd be very thankful if you add the hacktoberfest label to it 🙃

michalbundyra commented 4 years ago

Thanks, @rieschl!

Unfortunately this library is not taking apart in hacktoberfest so I cannot mark this ticket. Thanks for your contribution.

rieschl commented 4 years ago

Thanks, @rieschl!

Thanks for merging! It was my first try at a phpcs sniff 🙂

Unfortunately this library is not taking apart in hacktoberfest so I cannot mark this ticket. Thanks for your contribution.

You could just add the label hacktoberfest-accepted to this PR be counted. But no problem, I'd have made the PR even if it wasn't October 😉