| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait HasAttributes |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Determine whether a value is JSON castable for inbound manipulation. |
||
| 11 | * |
||
| 12 | * @param string $key |
||
| 13 | * @return bool |
||
| 14 | */ |
||
| 15 | 38 | protected function isJsonCastable($key) |
|
| 16 | { |
||
| 17 | 38 | return $this->hasCast($key, ['encrypted:array', 'encrypted:collection', 'encrypted:json', 'encrypted:object']); |
|
|
|
|||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Decode the given JSON back into an array or object. |
||
| 22 | * |
||
| 23 | * @param string $value |
||
| 24 | * @param bool $asObject |
||
| 25 | * @return mixed |
||
| 26 | * |
||
| 27 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
| 28 | */ |
||
| 29 | 5 | public function fromJson($value, $asObject = false) |
|
| 37 | } |
||
| 38 | } |
||
| 39 |