EncryptedBoolean   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A set() 0 4 1
1
<?php
2
3
4
namespace RichardStyles\EloquentEncryption\Casts;
5
6
7
class EncryptedBoolean extends Encrypted
8
{
9
    /**
10
     * Cast the given value and decrypt
11
     *
12
     * @param  \Illuminate\Database\Eloquent\Model  $model
13
     * @param  string  $key
14
     * @param  mixed  $value
15
     * @param  array  $attributes
16
     * @return bool
17
     */
18
    public function get($model, $key, $value, $attributes)
19
    {
20
        return (bool) parent::get($model, $key, $value, $attributes);
21
    }
22
23
    /**
24
     * Prepare the given value for storage.
25
     *
26
     * @param  \Illuminate\Database\Eloquent\Model  $model
27
     * @param  string  $key
28
     * @param  array  $value
29
     * @param  array  $attributes
30
     * @return string
31
     */
32
    public function set($model, $key, $value, $attributes)
33
    {
34
        return parent::set($model, $key, $value, $attributes);
35
    }
36
}
37