Right now the idiom for testing password strength is doing
try {
new Password($input);
} catch (...)
This is a bit confusing to read. Under the hood, the constructor of the class always calls its method validate() which will throw an Exception if the input is not a good password.
Creating an anonymous object like this isn't ideal. At the highest error levels phan will complain about it.
An easy fix is to change the signature of the method to be public static and update the calling code.
Right now the idiom for testing password strength is doing
This is a bit confusing to read. Under the hood, the constructor of the class always calls its method
validate()
which will throw an Exception if the input is not a good password.Creating an anonymous object like this isn't ideal. At the highest error levels
phan
will complain about it.An easy fix is to change the signature of the method to be
public static
and update the calling code.