| @@ 28-43 (lines=16) @@ | ||
| 25 | /** @var int|null */ |
|
| 26 | private $expiration; |
|
| 27 | ||
| 28 | public function __construct( |
|
| 29 | CacheItemInterface $decorated, |
|
| 30 | PasswordInterface $password, |
|
| 31 | $cipher |
|
| 32 | ) { |
|
| 33 | if (!class_exists(Iron::class)) { |
|
| 34 | // @codeCoverageIgnoreStart |
|
| 35 | throw new \RuntimeException('You must install' |
|
| 36 | . ' jsq/iron-php to use the Iron decorator.'); |
|
| 37 | // @codeCoverageIgnoreEnd |
|
| 38 | } |
|
| 39 | ||
| 40 | $this->decorated = $decorated; |
|
| 41 | $this->password = $password; |
|
| 42 | $this->iron = new Iron($cipher); |
|
| 43 | } |
|
| 44 | ||
| 45 | public function get() |
|
| 46 | { |
|
| @@ 20-36 (lines=17) @@ | ||
| 17 | /** @var string */ |
|
| 18 | private $cipher; |
|
| 19 | ||
| 20 | public function __construct( |
|
| 21 | CacheItemPoolInterface $decorated, |
|
| 22 | $password, |
|
| 23 | $cipher = Iron\Iron::DEFAULT_ENCRYPTION_METHOD |
|
| 24 | ) { |
|
| 25 | if (!class_exists(Iron\Iron::class)) { |
|
| 26 | // @codeCoverageIgnoreStart |
|
| 27 | throw new \RuntimeException('You must install' |
|
| 28 | . ' jsq/iron-php to use the Iron decorator.'); |
|
| 29 | // @codeCoverageIgnoreEnd |
|
| 30 | } |
|
| 31 | ||
| 32 | parent::__construct($decorated); |
|
| 33 | $this->decorated = $decorated; |
|
| 34 | $this->password = Iron\normalize_password($password); |
|
| 35 | $this->cipher = $cipher; |
|
| 36 | } |
|
| 37 | ||
| 38 | protected function decorate(CacheItemInterface $inner) |
|
| 39 | { |
|