Serialized::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace Tzsk\Payu\Models\Casts;
4
5
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
6
7
class Serialized implements CastsAttributes
8
{
9
    public function get($model, string $key, $value, array $attributes)
10
    {
11
        return unserialize($value);
12
    }
13
14
    public function set($model, string $key, $value, array $attributes)
15
    {
16
        return serialize($value);
17
    }
18
}
19