Completed
Push — master ( 115731...0072c1 )
by Rafal
01:41
created

SpotifyWebApi::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
4
namespace SpotifyApiConnect\Application\SpotifyWebApiPhp;
5
6
use SpotifyWebAPI\SpotifyWebAPI as BaseSpotifyWebAPI;
7
8
class SpotifyWebApi implements SpotifyWebApiInterface
9
{
10
    /**
11
     * @var BaseSpotifyWebAPI
12
     */
13
    private $baseSpotifyWebAPI;
14
15
    public function __construct()
16
    {
17
        $this->baseSpotifyWebAPI = new BaseSpotifyWebAPI();
18
    }
19
20
    /**
21
     * @param string $userId
22
     * @param string $playlistId
23
     * @param array $tracks
24
     * @param array $options
25
     * @return bool
26
     */
27
    public function addUserPlaylistTracks(string $userId, string $playlistId, array $tracks, array $options = [])
28
    {
29
        return $this->baseSpotifyWebAPI->addUserPlaylistTracks($userId, $playlistId, $tracks, $options);
30
    }
31
32
    /**
33
     * @param string $userId
34
     * @param string $playlistId
35
     * @param array $tracks
36
     * @param string $snapshotId
37
     * @return bool|string
38
     */
39
    public function deleteUserPlaylistTracks(string $userId, string $playlistId, array $tracks, string $snapshotId = '')
40
    {
41
        return $this->baseSpotifyWebAPI->deleteUserPlaylistTracks($userId, $playlistId, $tracks, $snapshotId);
42
    }
43
44
    /**
45
     * @param string $userId
46
     * @param string $playlistId
47
     * @param array $options
48
     * @return object
49
     */
50
    public function getUserPlaylist(string $userId, string $playlistId, array $options = [])
51
    {
52
        return $this->baseSpotifyWebAPI->getUserPlaylist($userId, $playlistId, $options);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->baseSpotif... $playlistId, $options) also could return the type array which is incompatible with the documented return type object.
Loading history...
53
    }
54
55
    /**
56
     * @param string $userId
57
     * @param array $options
58
     * @return object
59
     */
60
    public function getUserPlaylists(string $userId, array $options = [])
61
    {
62
        return $this->baseSpotifyWebAPI->getUserPlaylists($userId, $options);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->baseSpotif...ists($userId, $options) also could return the type array which is incompatible with the documented return type object.
Loading history...
63
    }
64
65
    /**
66
     * @param string $userId
67
     * @param $playlistId
68
     * @param array $options
69
     * @return object
70
     */
71
    public function getUserPlaylistTracks(string $userId, $playlistId, array $options = [])
72
    {
73
        return $this->baseSpotifyWebAPI->getUserPlaylistTracks($userId, $playlistId, $options);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->baseSpotif... $playlistId, $options) also could return the type array which is incompatible with the documented return type object.
Loading history...
74
    }
75
76
    /**
77
     * @param string $query
78
     * @param array $type
79
     * @param array $options
80
     * @return object
81
     */
82
    public function search(string $query, array $type, array $options = [])
83
    {
84
        return $this->baseSpotifyWebAPI->search($query, $type, $options);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->baseSpotif...query, $type, $options) also could return the type array which is incompatible with the documented return type object.
Loading history...
85
    }
86
87
    /**
88
     * @param string $accessToken
89
     */
90
    public function setAccessToken(string $accessToken)
91
    {
92
        $this->baseSpotifyWebAPI->setAccessToken($accessToken);
93
    }
94
95
}