php-yubico icon indicating copy to clipboard operation
php-yubico copied to clipboard

Silence warnings

Open jbrnd opened this issue 11 years ago • 1 comments

The following changes should be made to Auth/Yubico.php to silence some warnings PHP gives with strict error reporting:

$ch[$handle] = $handle;

on line 331 should be

$ch[(int)$handle] = $handle;

and on line 431:

if ($replay) return PEAR::raiseError('REPLAYED_OTP');

should be

if ($replay) return (new PEAR)->raiseError('REPLAYED_OTP');

And finally, line 433:

return (PEAR::raiseError($status);

should be

return ((new PEAR)->raiseError($status);

jbrnd avatar May 09 '14 16:05 jbrnd

Specifically, the warnings are of the type

PHP Strict Standards: Resource ID#12 used as offset, casting to integer (12) in /usr/share/php/Auth/Yubico.php on line 331 PHP Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Auth/Yubico.php on line 431

jbrnd avatar May 09 '14 16:05 jbrnd