for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Guarded Authentication package.
*
* (c) Jafar Jabr <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Jafar\Bundle\GuardedAuthenticationBundle\Api\JWSCreator;
/**
* Class JWSCreator.
* @author Jafar Jabr <[email protected]>
class JWSCreator implements JWSCreatorInterface
{
const SIGNED = 'signed';
* The JSON Web Token.
* @var string
private $token;
private $state;
* JWSCreator constructor.
* @param string $token
* @param bool $isSigned
public function __construct(string $token, bool $isSigned)
$this->token = $token;
if (true === $isSigned) {
$this->state = self::SIGNED;
}
* @return bool
public function isSigned()
return self::SIGNED === $this->state;
* @return string
public function getToken()
return $this->token;