php-yubico
php-yubico copied to clipboard
Silence warnings
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);
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