Add documentation for the `Spoofchecker::setRestrictionLevel` method
Hi,
This PR try to document Spoofchecker::setRestrictionLevel
php-src commit is https://github.com/php/php-src/commit/f56ceb7f5b603768e6801a0f7471f430075015ac
It's my first contribution on this repository, tell me if something is wrong :smile:
@TimWolla Do you know where I can found an example of a warning/mention in phpdoc ? I don't know how to add it
@alamirault https://github.com/php/doc-en/blob/43f61d4507f516a611c05d41c4717df83ca860d8/reference/password/functions/password-hash.xml#L133-L140
https://github.com/php/doc-en/blob/43f61d4507f516a611c05d41c4717df83ca860d8/reference/password/functions/password-hash.xml#L71-L77
See: https://www.php.net/manual/en/function.password-hash.php
Looks like this PR got overlooked/forgotten, but on the bright side this method was documented via https://github.com/php/doc-en/pull/2274 -- but thank you for spending time working on this PR!
@TimWolla Regarding this:
Calling ->setChecks() after ->setRestrictionLevel() nullifies the restriction level.
(I hope to propose a cleaner API if / when PHP has tagged unions)
I was about to document this but am confused. Why does the API have such a restriction? Here's the proposed addition:
<caution>
<para>
Calling <methodname>SpoofChecker::setChecks</methodname> after <methodname>SpoofChecker::setRestrictionLevel</methodname>
overrides the restriction level. Therefore, call <methodname>SpoofChecker::setChecks</methodname> first.
</para>
</caution>