| Total Complexity | 8 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | class ModelEncrypter implements Encrypter |
||
| 11 | { |
||
| 12 | private ?Encrypter $encrypter; |
||
| 13 | |||
| 14 | public function __construct() |
||
| 15 | { |
||
| 16 | $this->encrypter = app('encrypted-data.encrypter'); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function encrypt($value, $serialize = true) |
||
| 20 | { |
||
| 21 | return $this->encrypter->encrypt($value, $serialize); |
||
|
|
|||
| 22 | } |
||
| 23 | |||
| 24 | public function decrypt($payload, $unserialize = true) |
||
| 25 | { |
||
| 26 | $decrypted = $this->encrypter->decrypt($payload, false); |
||
| 27 | |||
| 28 | $unserialized = @unserialize($decrypted); |
||
| 29 | if ($unserialized === false && $decrypted !== 'b:0;') { |
||
| 30 | return $decrypted; |
||
| 31 | } |
||
| 32 | |||
| 33 | return $unserialized; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getKey() |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getAllKeys() |
||
| 42 | { |
||
| 43 | return $this->encrypter->getAllKeys(); |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getPreviousKeys() |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.