Passed
Branch feature/spotify (bc53f9)
by Oguzhan
10:14
created

Artist   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 16.66%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 8
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 79
ccs 3
cts 18
cp 0.1666
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setParent() 0 4 1
A getParent() 0 4 1
A get() 0 4 1
A getComplete() 0 4 1
A getById() 0 4 1
A getByName() 0 4 1
A getByGuid() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: PBX_g33k
5
 * Date: 30-May-16
6
 * Time: 16:30
7
 */
8
9
namespace Pbxg33k\MusicInfo\Service\Spotify\Endpoint;
10
11
use Pbxg33k\MusicInfo\Model\IMusicServiceEndpoint;
12
use Pbxg33k\MusicInfo\Service\Spotify\Service as SpotifyService;
13
14
class Artist implements IMusicServiceEndpoint
15
{
16
    /**
17
     * @var SpotifyService
18
     */
19
    protected $parent;
20
21 1
    public function __construct(SpotifyService $apiService)
22
    {
23 1
        $this->parent = $apiService;
24 1
    }
25
26
    /**
27
     * @return mixed
28
     */
29
    function setParent($parent)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
30
    {
31
        $this->parent = $parent;
32
    }
33
    
34
    /**
35
     * @return SpotifyService
36
     */
37
    function getParent()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
38
    {
39
        return $this->parent;
40
    }
41
42
    /**
43
     * @param $arguments
44
     *
45
     * @return mixed
46
     */
47
    public function get($arguments)
48
    {
49
        // TODO: Implement get() method.
50
    }
51
52
    /**
53
     * @param $arguments
54
     *
55
     * @return mixed
56
     */
57
    public function getComplete($arguments)
58
    {
59
        // TODO: Implement getComplete() method.
60
    }
61
62
    /**
63
     * @param $id
64
     *
65
     * @return mixed
66
     */
67
    public function getById($id)
68
    {
69
        return $this->getById($id);
70
    }
71
72
    /**
73
     * @param $name
74
     *
75
     * @return mixed
76
     */
77
    public function getByName($name)
78
    {
79
        return $this->getParent()->getApiClient()->search($name, 'artist');
80
    }
81
82
    /**
83
     * @param $guid
84
     *
85
     * @return mixed
86
     */
87
    public function getByGuid($guid)
88
    {
89
        return $this->getParent()->getApiClient()->getArtist($guid);
90
    }
91
92
}