mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-10-05 03:16:55 +00:00
crank phpstan to level 6
This commit is contained in:
@@ -7,6 +7,9 @@ use function preg_match;
|
||||
|
||||
trait HandlesDataUri
|
||||
{
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
private function DecodeDataUri(string $datauri): ?array
|
||||
{
|
||||
if (preg_match('/data:(?P<mimetype>[\w\.\-\+\/]+);(?P<encoding>\w+),(?P<data>.*)/', $datauri, $m) === 1) {
|
||||
|
||||
@@ -10,22 +10,17 @@ use Exception;
|
||||
*/
|
||||
class HttpTimeProvider implements ITimeProvider
|
||||
{
|
||||
/** @var string */
|
||||
public $url;
|
||||
|
||||
/** @var string */
|
||||
public $expectedtimeformat;
|
||||
|
||||
/** @var array */
|
||||
public $options;
|
||||
/** @var array<string, mixed> */
|
||||
public array $options;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param string $expectedtimeformat
|
||||
* @param array $options
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function __construct($url = 'https://google.com', $expectedtimeformat = 'D, d M Y H:i:s O+', array $options = null)
|
||||
{
|
||||
public function __construct(
|
||||
public string $url = 'https://google.com',
|
||||
public string $expectedtimeformat = 'D, d M Y H:i:s O+',
|
||||
array $options = null,
|
||||
) {
|
||||
$this->url = $url;
|
||||
$this->expectedtimeformat = $expectedtimeformat;
|
||||
if ($options === null) {
|
||||
|
||||
@@ -19,8 +19,10 @@ class TwoFactorAuth
|
||||
{
|
||||
private static string $_base32dict = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=';
|
||||
|
||||
/** @var array<string> */
|
||||
private static array $_base32;
|
||||
|
||||
/** @var array<string, int> */
|
||||
private static array $_base32lookup = array();
|
||||
|
||||
public function __construct(
|
||||
@@ -118,6 +120,7 @@ class TwoFactorAuth
|
||||
|
||||
/**
|
||||
* Compare default timeprovider with specified timeproviders and ensure the time is within the specified number of seconds (leniency)
|
||||
* @param array<ITimeProvider> $timeproviders
|
||||
*/
|
||||
public function ensureCorrectTime(?array $timeproviders = null, int $leniency = 5): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user