Photo   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
lcom 1
cbo 2
dl 0
loc 46
rs 10
c 1
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getName() 0 4 1
A getDescription() 0 4 1
A getFile() 0 4 1
A getSize() 0 4 1
A getAlbum() 0 4 1
A getMetadata() 0 4 1
A metadataContains() 0 4 1
1
<?php
2
3
namespace JeroenG\LaravelPhotoGallery\Entities;
4
5
use JeroenG\LaravelPhotoGallery\Contracts;
6
use JeroenG\LaravelPhotoGallery\Traits\Editable;
7
use JeroenG\LaravelPhotoGallery\Traits\Mappable;
8
9
class Photo implements Contracts\Photo
10
{
11
    use Mappable, Editable;
12
13
    private $metadata;
14
15
    public function getId()
16
    {
17
        return $this->metadata['id'];
18
    }
19
20
    public function getName()
21
    {
22
        return $this->metadata['name'];
23
    }
24
25
    public function getDescription()
26
    {
27
        return $this->metadata['description'];
28
    }
29
30
    public function getFile()
31
    {
32
        return $this->metadata['file'];
33
    }
34
35
    public function getSize()
36
    {
37
        return $this->metadata['size'];
38
    }
39
40
    public function getAlbum()
41
    {
42
        return $this->metadata['album_id'];
43
    }
44
45
    public function getMetadata($attribute)
46
    {
47
        return $this->metadata[$attribute];
48
    }
49
50
    public function metadataContains($attribute)
51
    {
52
        return isset($this->metadata[$attribute]);
53
    }
54
}