Completed
Push — master ( 8a4d0b...126fd8 )
by Stéphane
12:10
created

Field   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 4 1
A revision() 0 4 1
1
<?php namespace Rocket\Entities;
2
3
use Illuminate\Database\Eloquent\Model;
4
5
/**
6
 * Field
7
 *
8
 * @property int $id The field id
9
 * @property string $name The name of the field
10
 * @property int $weight The order of this field
11
 * @property int $revision_id The field's revision id
12
 * @property-read \DateTime $created_at
13
 * @property-read \DateTime $updated_at
14
 */
15
class Field extends Model
16
{
17
    //TODO :: validate values
18
19
    /**
20
     * {@inheritdoc}
21
     */
22 43
    public function toArray()
23
    {
24 43
        return $this->getAttribute('value');
25
    }
26
27
    /**
28
     * Get the revisions for this class
29
     *
30
     * @codeCoverageIgnore
31
     */
32
    public function revision()
33
    {
34
        return $this->belongsTo(Revision::class);
35
    }
36
}
37