1 | <?php |
||
18 | class Service extends BaseService |
||
19 | { |
||
20 | /** |
||
21 | * Is the client authorized via OAuth2.0 |
||
22 | * |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $authorized = false; |
||
26 | |||
27 | /** |
||
28 | * @var Session |
||
29 | */ |
||
30 | protected $spotifySession; |
||
31 | |||
32 | /** |
||
33 | * @var Artist |
||
34 | */ |
||
35 | protected $artist; |
||
36 | |||
37 | /** |
||
38 | * @var Track |
||
39 | */ |
||
40 | protected $track; |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 11 | public function init($config = []) |
|
62 | |||
63 | /** |
||
64 | * @param $scopes |
||
65 | * |
||
66 | * @return mixed |
||
67 | */ |
||
68 | 11 | public function requestCredentialsToken($scopes) |
|
74 | |||
75 | /** |
||
76 | * @param Request $request |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function requestAccessToken(Request $request) |
||
87 | |||
88 | /** |
||
89 | * @return bool |
||
90 | */ |
||
91 | public function refreshTokens() |
||
95 | |||
96 | /** |
||
97 | * @return mixed |
||
98 | */ |
||
99 | 11 | protected function setAccessTokenFromSession() |
|
103 | |||
104 | /** |
||
105 | * @return Artist |
||
106 | */ |
||
107 | 1 | public function getArtist() |
|
111 | |||
112 | /** |
||
113 | * @return Track |
||
114 | */ |
||
115 | 1 | public function getTrack() |
|
119 | |||
120 | public function testArtistSearchWithServiceAsString() |
||
128 | 5 | ||
129 | /** |
||
130 | 5 | * @return Session |
|
131 | */ |
||
132 | public function getSpotifySession() |
||
136 | |||
137 | /** |
||
138 | * @return boolean |
||
139 | */ |
||
140 | public function isAuthorized() |
||
144 | |||
145 | public function artist() |
||
149 | |||
150 | public function track() |
||
154 | |||
155 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: