Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Dec 4, 2018
1 parent 293a0c1 commit a1e3b50
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/Exception/CsrfException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ public function __construct(
int $code = 403,
Exception $previous = null
) {
parent::__construct($message, $code, $previous);
parent::__construct(
$message,
$code,
$previous
);
}
}
4 changes: 3 additions & 1 deletion src/Exception/CsrfTokenInvalidException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

class CsrfTokenInvalidException extends CsrfException {
public function __construct(string $tokenReceived) {
parent::__construct("CSRF Token '$tokenReceived' does not exist");
parent::__construct(
"CSRF Token '$tokenReceived' does not exist"
);
}
}
9 changes: 7 additions & 2 deletions src/TokenStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public function __construct(int $maxTokens = null) {
}

// TODO: Remove error_reporting when issue #45 is addressed.
$oldReportingLevel = error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
$oldReportingLevel = error_reporting(
E_ALL & ~E_NOTICE & ~E_DEPRECATED
);

$factory = new RandomLibFactory();
$this->tokenGenerator = $factory->getGenerator(
new Strength($this->strength)
Expand Down Expand Up @@ -61,7 +64,9 @@ public function setTokenLength(int $newTokenLength):void {
* @see TokenStore::saveToken() for storing a generated token.
*/
public function generateNewToken():string {
return $this->tokenGenerator->generateString($this->tokenLength);
return $this->tokenGenerator->generateString(
$this->tokenLength
);
}

/**
Expand Down

0 comments on commit a1e3b50

Please sign in to comment.