for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yokai\SecurityTokenBundle\Exception;
/**
* Exception thrown when token is fetched, but already consumed.
*
* @author Yann Eugoné <[email protected]>
*/
class TokenConsumedException extends TokenUsedException
{
* Create an instance of this class.
* @param string $value Token value
* @param string $purpose Token purpose
* @param int $usages Count usages
* @return TokenConsumedException
public static function create($value, $purpose, $usages)
return new self(
sprintf(
'The "%s" token with value "%s" was used times "%s".',
$purpose,
$value,
$usages
)
);
}