| 1 | <?php |
||
| 9 | class DefaultEncrypter implements Encrypter |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Laravel's Encrypter |
||
| 13 | * |
||
| 14 | * @var IlluminateEncrypter |
||
| 15 | */ |
||
| 16 | protected $encrypter; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Create a new instance of LaravelEncrypter |
||
| 20 | * |
||
| 21 | * @param string $key |
||
| 22 | * @param IlluminateEncrypter $encrypter |
||
| 23 | */ |
||
| 24 | 2 | public function __construct($key, IlluminateEncrypter $encrypter = null) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Encrypt a string |
||
| 31 | * |
||
| 32 | * @param string $string |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | 1 | public function encrypt($string) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Decrypt an encrypted string |
||
| 43 | * |
||
| 44 | * @param string $payload |
||
| 45 | * |
||
| 46 | * @return string |
||
| 47 | * @throws DecryptException |
||
| 48 | */ |
||
| 49 | 2 | public function decrypt($payload) |
|
| 59 | } |
||
| 60 |