| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | final class CachedCredentials implements Credentials |
||
| 15 | { |
||
| 16 | private const PREFIX = 'DGS_tok_'; |
||
| 17 | |||
| 18 | /** @var Credentials */ |
||
| 19 | private $inner; |
||
| 20 | |||
| 21 | /** @var CacheInterface */ |
||
| 22 | private $cache; |
||
| 23 | |||
| 24 | public function __construct(Credentials $inner, CacheInterface $cache) |
||
| 25 | { |
||
| 26 | if ($inner instanceof self) { |
||
| 27 | throw new LogicException('Prevent double decoration'); |
||
| 28 | } |
||
| 29 | |||
| 30 | $this->inner = $inner; |
||
| 31 | $this->cache = $cache; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getHash(): string |
||
| 35 | { |
||
| 36 | return self::PREFIX . $this->inner->getHash(); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function provide(DigiSign $dgs): Token |
||
| 52 | } |
||
| 53 | |||
| 54 | public function getInner(): Credentials |
||
| 57 | } |
||
| 58 | } |
||
| 59 |