Skip to content

Commit

Permalink
style fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
s3b4stian committed Aug 20, 2017
1 parent 0c3c986 commit ed3173e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/CsrfGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getToken() : array
* Return timed csrf token as array.
*
* @param int $ttl Time to live for the token.
*
*
* @return array
*/
public function getTimedToken(int $ttl) : array
Expand All @@ -115,7 +115,7 @@ public function getTimedToken(int $ttl) : array

/**
* Generate a random token.
*
*
* @return array
*/
private function generateToken() : array
Expand All @@ -130,7 +130,7 @@ private function generateToken() : array
* Return csrf token as hidden input form.
*
* @return string
*
*
* @deprecated since version 1.1.0
*/
public function getHiddenInput() : string
Expand Down Expand Up @@ -162,7 +162,7 @@ public function validate(array $requestData) : bool
*
* @param string $value
* @param string $key
*
*
* @return bool
*/
private function matchToken(string $value, string $key) : bool
Expand All @@ -177,13 +177,13 @@ private function matchToken(string $value, string $key) : bool
//check if token is valid
if (!hash_equals($tokens[$key]['value'], $value)) {
return false;
}
}

//check if token is expired if timed
if (isset($tokens[$key]['time']) && $tokens[$key]['time'] < time()) {
return false;
}

return true;
return true;
}
}

0 comments on commit ed3173e

Please sign in to comment.