GalleryService   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 41
rs 10
c 3
b 0
f 1

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A sayHello() 0 4 1
A album() 0 4 1
A photo() 0 4 1
A user() 0 4 1
A tag() 0 4 1
1
<?php
2
3
namespace JeroenG\LaravelPhotoGallery\Services;
4
5
use JeroenG\LaravelPhotoGallery\Contracts as Contracts;
6
7
class GalleryService
8
{
9
    private $adapters;
10
11
    public function __construct(
12
        Contracts\AlbumAdapter $albumAdapter,
13
        Contracts\PhotoAdapter $photoAdapter,
14
        Contracts\UserAdapter $userAdapter,
15
        Contracts\TagAdapter $tagAdapter
16
    ) {
17
        $this->adapters['album'] = $albumAdapter;
18
        $this->adapters['photo'] = $photoAdapter;
19
        $this->adapters['user'] = $userAdapter;
20
        $this->adapters['tag'] = $tagAdapter;
21
    }
22
23
    public function sayHello()
24
    {
25
        return 'hi';
26
    }
27
28
    public function album()
29
    {
30
        return $this->adapters['album'];
31
    }
32
33
     public function photo()
34
    {
35
        return $this->adapters['photo'];
36
    }
37
38
     public function user()
39
    {
40
        return $this->adapters['user'];
41
    }
42
43
     public function tag()
44
    {
45
        return $this->adapters['tag'];
46
    }
47
}