Completed
Push — master ( 3596b1...186b3d )
by Oscar
03:58
created

AbstractEntity   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getLabel() 0 4 1
1
<?php
2
3
namespace Folk\Entities;
4
5
use Folk\Admin;
6
7
/**
8
 * Base class extended by all entities.
9
 */
10
abstract class AbstractEntity implements EntityInterface
11
{
12
    protected $name;
13
    protected $admin;
14
15
    public $icon;
16
    public $title;
17
    public $description;
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function __construct($name, Admin $admin)
23
    {
24
        $this->name = $name;
25
        $this->admin = $admin;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getName()
32
    {
33
        return $this->name;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getLabel($id, array $data)
40
    {
41
        return current($data);
42
    }
43
}
44