Passed
Pull Request — master (#1)
by Rafal
03:32
created

SpotifyWebApi::getPlaylistTracks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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);
0 ignored issues
show
Deprecated Code introduced by
The function SpotifyWebAPI\SpotifyWeb...addUserPlaylistTracks() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

29
        return /** @scrutinizer ignore-deprecated */ $this->baseSpotifyWebAPI->addUserPlaylistTracks($userId, $playlistId, $tracks, $options);
Loading history...
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);
0 ignored issues
show
Deprecated Code introduced by
The function SpotifyWebAPI\SpotifyWeb...eteUserPlaylistTracks() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

41
        return /** @scrutinizer ignore-deprecated */ $this->baseSpotifyWebAPI->deleteUserPlaylistTracks($userId, $playlistId, $tracks, $snapshotId);
Loading history...
42
    }
43
44
    /**
45
     * @param string $userId
46
     * @param string $playlistId
47
     * @param array $options
48
     * @return array|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 return type mandated by SpotifyApiConnect\Applic...face::getUserPlaylist() of object.
Loading history...
Deprecated Code introduced by
The function SpotifyWebAPI\SpotifyWebAPI::getUserPlaylist() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

52
        return /** @scrutinizer ignore-deprecated */ $this->baseSpotifyWebAPI->getUserPlaylist($userId, $playlistId, $options);
Loading history...
53
    }
54
55
    /**
56
     * @param string $userId
57
     * @param array $options
58
     * @return array|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 return type mandated by SpotifyApiConnect\Applic...ace::getUserPlaylists() of object.
Loading history...
63
    }
64
65
    /**
66
     * @param $playlistId
67
     * @param array $options
68
     * @return array|object
69
     */
70
    public function getPlaylistTracks(string $playlistId, array $options = [])
71
    {
72
        return $this->baseSpotifyWebAPI->getPlaylistTracks($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 return type mandated by SpotifyApiConnect\Applic...ce::getPlaylistTracks() of object.
Loading history...
73
    }
74
75
    /**
76
     * @param string $query
77
     * @param array $type
78
     * @param array $options
79
     * @return array|object
80
     */
81
    public function search(string $query, array $type, array $options = [])
82
    {
83
        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 return type mandated by SpotifyApiConnect\Applic...bApiInterface::search() of object.
Loading history...
84
    }
85
86
    /**
87
     * @param string $accessToken
88
     */
89
    public function setAccessToken(string $accessToken)
90
    {
91
        $this->baseSpotifyWebAPI->setAccessToken($accessToken);
92
    }
93
94
}