I think this is a really useful addition. Personally I did not even know that base64_decode had a $strict-parameter, and given that the default behavior is not always desirable it makes sense to require an explicit 'opt-in' tot that.
I do think that this does not really fit into DisallowImplicitLooseComparisonSniff, as it is not actually about comparison of values. A separate sniff for this should only take a few lines though (see e.g. https://github.com/Moxio/php-codesniffer-sniffs/blob/master/Moxio/Sniffs/PHP/DisallowImplicitMicrotimeAsStringSniff.php), and will be even simpler than DisallowImplicitLooseComparisonSniff, which deals with variable numbers of parameters. What do you think about adding this as a separate DisallowImplicitLooseBase64DecodeSniff or something similar?
Thank you for your contribution!
I think this is a really useful addition. Personally I did not even know that
base64_decode
had a$strict
-parameter, and given that the default behavior is not always desirable it makes sense to require an explicit 'opt-in' tot that.I do think that this does not really fit into
DisallowImplicitLooseComparisonSniff
, as it is not actually about comparison of values. A separate sniff for this should only take a few lines though (see e.g. https://github.com/Moxio/php-codesniffer-sniffs/blob/master/Moxio/Sniffs/PHP/DisallowImplicitMicrotimeAsStringSniff.php), and will be even simpler thanDisallowImplicitLooseComparisonSniff
, which deals with variable numbers of parameters. What do you think about adding this as a separateDisallowImplicitLooseBase64DecodeSniff
or something similar?