SerializeEncrypter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Endeavors\Components\Encryption;
4
5
use Endeavors\Components\Encryption\Contracts\IEncrypter;
6
use Endeavors\Components\Encryption\Contracts\IOriginalEncrypter;
7
8
class SerializeEncrypter implements IOriginalEncrypter
9
{
10
    private $encrypter;
11
12
    public function __construct(IOriginalEncrypter $encrypter)
13
    {
14
        $this->encrypter = $encrypter;
15
    }
16
17
    public function encrypt($value, $serialize = true)
18
    {
19
        return $this->encrypter->encrypt($value, $serialize);
20
    }
21
22
    public function decrypt($value, $serialize = true)
23
    {
24
        return $this->encrypter->decrypt($value, $serialize);
25
    }
26
}