Skip to content

Commit

Permalink
Fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhemN committed Oct 20, 2015
1 parent bb512c1 commit 82a211d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions TOTP/TOTPValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ class TOTPValidator
* @param TOTPTimeManager|int|null $stampLength Stamp length in seconds
* @param int|null $window accepted stamps before and after the current stamp
*/
public function __construct($window = null, $stampLength = null)
public function __construct($stampLength = null, $window = null)
{
// Window definition
if ($window === null) {
$this->window = self::DEFAULT_STAMP_WINDOW;
} else {
$this->window = intval($window);
}

// stamp length definition
if (!($stampLength instanceof TOTPTimeManager)) {
$this->timeManager = new TOTPTimeManager(intval($stampLength));
} else {
$this->timeManager = $stampLength;
}

// Window definition
if ($window === null) {
$this->window = self::DEFAULT_STAMP_WINDOW;
} else {
$this->window = intval($window);
}
}

/**
Expand Down

0 comments on commit 82a211d

Please sign in to comment.