TomasVotruba / class-leak

Find leaking classes that you never use... and get rid of them.
https://tomasvotruba.com/blog/how-to-avoid-maintaining-classes-you-dont-use
MIT License
88 stars 7 forks source link

Fix critical bug in hasApiTag #17

Closed szepeviktor closed 1 year ago

szepeviktor commented 1 year ago

preg_match signals a match in its return value. Without a match the matches array is empty, not null.

@TomasVotruba

TomasVotruba commented 1 year ago

Thanks :+1: We'll need a test case to cover this one

TomasVotruba commented 1 year ago

Also, str_contains might be better choice here :)

szepeviktor commented 1 year ago

I am not a developer. (meaning my test writing speed = 1 line/hour) This already took me 3 hours to locate. Please add that test case yourself.

TomasVotruba commented 1 year ago

Without reproducer in CI we can have a ping-pong case like many times before :)

szepeviktor commented 1 year ago

💣