Completed
Push — master ( 262514...7f6fe3 )
by Elf
08:38 queued 39s
created

SexAttribute   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSexAttribute() 0 4 1
A setSexAttribute() 0 4 1
1
<?php
2
3
namespace ElfSundae\Laravel\Support\Traits\Eloquent;
4
5
use ElfSundae\Laravel\Support\Constants\Sex;
6
7
trait SexAttribute
8
{
9
    /**
10
     * Get the 'sex' attribute.
11
     *
12
     * @param  int  $value
13
     * @return string|null
14
     */
15
    public function getSexAttribute($value)
16
    {
17
        return Sex::string($value);
18
    }
19
20
    /**
21
     * Set the 'sex' attribute.
22
     *
23
     * @param  mixed  $value
24
     */
25
    public function setSexAttribute($value)
26
    {
27
        $this->attributes['sex'] = Sex::type($value);
28
    }
29
}
30