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

Artist::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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
}