Passed
Push — master ( aab3fb...321227 )
by Rafal
01:33
created
src/Application/SpotifyApiAuth.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     public function getAccessByRefreshToken(string $refreshAccessToken) : string
55 55
     {
56
-        if( $this->session->refreshAccessToken($refreshAccessToken) !== true ) {
56
+        if ($this->session->refreshAccessToken($refreshAccessToken) !== true) {
57 57
             throw new \RuntimeException(Message::ERROR_GET_REFRESH_TOKEN_BY_CODE);
58 58
         }
59 59
         return $this->session->getAccessToken();
Please login to merge, or discard this patch.
src/Application/SpotifyWebApiPhp/Session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      * @param array $options
27 27
      * @return string
28 28
      */
29
-    public function getAuthorizeUrl(array $options = []) : string
29
+    public function getAuthorizeUrl(array $options = [ ]) : string
30 30
     {
31 31
         return $this->baseSession->getAuthorizeUrl($options);
32 32
     }
Please login to merge, or discard this patch.
src/Application/SpotifyWebApiPhp/SessionInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
      * @param array $options
10 10
      * @return string
11 11
      */
12
-    public function getAuthorizeUrl(array $options = []): string;
12
+    public function getAuthorizeUrl(array $options = [ ]): string;
13 13
 
14 14
     /**
15 15
      * @param string $authorizationCode
Please login to merge, or discard this patch.
config/config_default.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 use \Xervice\DataProvider\DataProviderConfig;
4 4
 
5
-$config[DataProviderConfig::DATA_PROVIDER_GENERATED_PATH] =  dirname(__DIR__) . '/src/Domain/DataTransferObject';
5
+$config[ DataProviderConfig::DATA_PROVIDER_GENERATED_PATH ] = dirname(__DIR__).'/src/Domain/DataTransferObject';
6 6
 
7
-$config[DataProviderConfig::DATA_PROVIDER_PATHS] = [
8
-    __DIR__ . '/xervice/schema'
7
+$config[ DataProviderConfig::DATA_PROVIDER_PATHS ] = [
8
+    __DIR__.'/xervice/schema'
9 9
 ];
10 10
 
11
-$config[DataProviderConfig::DATA_PROVIDER_NAMESPACE] = 'SpotifyApiConnect\\Domain\\DataTransferObject';
12 11
\ No newline at end of file
12
+$config[ DataProviderConfig::DATA_PROVIDER_NAMESPACE ] = 'SpotifyApiConnect\\Domain\\DataTransferObject';
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
test/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__ . '/../vendor/autoload.php';
3
+require __DIR__.'/../vendor/autoload.php';
Please login to merge, or discard this patch.
src/Application/SpotifyWebApiPhp/SpotifyWebApi.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @param array $options
51 51
      * @return bool
52 52
      */
53
-    public function addPlaylistTracks($playlistId, array $tracks, array $options = []): bool
53
+    public function addPlaylistTracks($playlistId, array $tracks, array $options = [ ]): bool
54 54
     {
55 55
         return $this->baseSpotifyWebAPI->addPlaylistTracks($playlistId, $tracks, $options);
56 56
     }
@@ -62,18 +62,18 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function deletePlaylistTracks(string $playlistId, array $tracksInfo): bool
64 64
     {
65
-        $tracksToDelete = [];
65
+        $tracksToDelete = [ ];
66 66
         foreach ($tracksInfo as $deleteTrackInfoDataProvider) {
67 67
             if (!$deleteTrackInfoDataProvider instanceof DeleteTrackInfoDataProvider) {
68 68
                 throw new RuntimeException(
69 69
                     sprintf(Message::ERROR_DELETE_PLAYLIST_TRACKS, DeleteTrackInfoDataProvider::class)
70 70
                 );
71 71
             }
72
-            $tracksToDelete[] = $deleteTrackInfoDataProvider->toArray();
72
+            $tracksToDelete[ ] = $deleteTrackInfoDataProvider->toArray();
73 73
         }
74 74
 
75 75
         $this->baseSpotifyWebAPI->setReturnType(Request::RETURN_OBJECT);
76
-        $delete = (bool)$this->baseSpotifyWebAPI->deletePlaylistTracks($playlistId, $tracksToDelete);
76
+        $delete = (bool) $this->baseSpotifyWebAPI->deletePlaylistTracks($playlistId, $tracksToDelete);
77 77
         $this->baseSpotifyWebAPI->setReturnType(Request::RETURN_ASSOC);
78 78
 
79 79
         return $delete;
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
      * @param array $options
85 85
      * @return PlaylistDataProvider
86 86
      */
87
-    public function getPlaylist(string $playlistId, array $options = []): PlaylistDataProvider
87
+    public function getPlaylist(string $playlistId, array $options = [ ]): PlaylistDataProvider
88 88
     {
89
-        $jsonObjectResult = (array)$this->baseSpotifyWebAPI->getPlaylist($playlistId, $options);
89
+        $jsonObjectResult = (array) $this->baseSpotifyWebAPI->getPlaylist($playlistId, $options);
90 90
 
91 91
         $playlistDataProvider = new PlaylistDataProvider();
92 92
         $playlistDataProvider->fromArray($jsonObjectResult);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @return PlaylistDataProvider
101 101
      * @throws PlaylistNotFound
102 102
      */
103
-    public function getUserPlaylistByName(string $playlistName, array $options = []): PlaylistDataProvider
103
+    public function getUserPlaylistByName(string $playlistName, array $options = [ ]): PlaylistDataProvider
104 104
     {
105 105
         $userPlaylistsDataProvider = $this->getUserPlaylists($options);
106 106
         $playlists = $userPlaylistsDataProvider->getItems();
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
      * @param array $options
119 119
      * @return PlaylistTracksDataProvider
120 120
      */
121
-    public function getPlaylistTracks(string $playlistId, array $options = []): PlaylistTracksDataProvider
121
+    public function getPlaylistTracks(string $playlistId, array $options = [ ]): PlaylistTracksDataProvider
122 122
     {
123
-        $jsonObjectResult = (array)$this->baseSpotifyWebAPI->getPlaylistTracks($playlistId, $options);
123
+        $jsonObjectResult = (array) $this->baseSpotifyWebAPI->getPlaylistTracks($playlistId, $options);
124 124
 
125 125
         $playlistTracksDataProvider = new PlaylistTracksDataProvider();
126 126
         $playlistTracksDataProvider->fromArray($jsonObjectResult);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      * @param array $options
134 134
      * @return TracksSearchDataProvider
135 135
      */
136
-    public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = []): TracksSearchDataProvider
136
+    public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = [ ]): TracksSearchDataProvider
137 137
     {
138 138
         $jsonObjectResult = $this->search(
139 139
             sprintf(
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         );
148 148
 
149 149
         $tracksSearchDataProvider = new TracksSearchDataProvider();
150
-        $tracksSearchDataProvider->fromArray($jsonObjectResult[$trackSearchRequest->getResultType()]);
150
+        $tracksSearchDataProvider->fromArray($jsonObjectResult[ $trackSearchRequest->getResultType() ]);
151 151
 
152 152
         return $tracksSearchDataProvider;
153 153
     }
@@ -158,18 +158,18 @@  discard block
 block discarded – undo
158 158
      * @param array $options
159 159
      * @return array
160 160
      */
161
-    private function search(string $query, array $type, array $options = []): array
161
+    private function search(string $query, array $type, array $options = [ ]): array
162 162
     {
163
-        return (array)$this->baseSpotifyWebAPI->search($query, $type, $options);
163
+        return (array) $this->baseSpotifyWebAPI->search($query, $type, $options);
164 164
     }
165 165
 
166 166
     /**
167 167
      * @param array $options
168 168
      * @return UserPlaylistsDataProvider
169 169
      */
170
-    private function getUserPlaylists(array $options = []): UserPlaylistsDataProvider
170
+    private function getUserPlaylists(array $options = [ ]): UserPlaylistsDataProvider
171 171
     {
172
-        $userPlaylistInfo = (array)$this->baseSpotifyWebAPI->getUserPlaylists($this->spotifyUsername, $options);
172
+        $userPlaylistInfo = (array) $this->baseSpotifyWebAPI->getUserPlaylists($this->spotifyUsername, $options);
173 173
 
174 174
         $userPlaylistsDataProvider = new UserPlaylistsDataProvider();
175 175
         $userPlaylistsDataProvider->fromArray($userPlaylistInfo);
Please login to merge, or discard this patch.
src/Application/SpotifyWebApiInterface.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      * @param array $options
16 16
      * @return bool
17 17
      */
18
-    public function addPlaylistTracks($playlistId, array $tracks, array $options = []): bool;
18
+    public function addPlaylistTracks($playlistId, array $tracks, array $options = [ ]): bool;
19 19
 
20 20
     /**
21 21
      * @param string $playlistId
@@ -29,26 +29,26 @@  discard block
 block discarded – undo
29 29
      * @param array $options
30 30
      * @return PlaylistDataProvider
31 31
      */
32
-    public function getPlaylist(string $playlistId, array $options = []): PlaylistDataProvider;
32
+    public function getPlaylist(string $playlistId, array $options = [ ]): PlaylistDataProvider;
33 33
 
34 34
     /**
35 35
      * @param $playlistId
36 36
      * @param array $options
37 37
      * @return PlaylistTracksDataProvider
38 38
      */
39
-    public function getPlaylistTracks(string $playlistId, array $options = []);
39
+    public function getPlaylistTracks(string $playlistId, array $options = [ ]);
40 40
 
41 41
     /**
42 42
      * @param string $playlistName
43 43
      * @param array $options
44 44
      * @return PlaylistDataProvider
45 45
      */
46
-    public function getUserPlaylistByName(string $playlistName, array $options = []): PlaylistDataProvider;
46
+    public function getUserPlaylistByName(string $playlistName, array $options = [ ]): PlaylistDataProvider;
47 47
 
48 48
     /**
49 49
      * @param TrackSearchRequestDataProvider $trackSearchRequest
50 50
      * @param array $options
51 51
      * @return TracksSearchDataProvider
52 52
      */
53
-    public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = []): TracksSearchDataProvider;
53
+    public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = [ ]): TracksSearchDataProvider;
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
src/Domain/Model/Config.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function getClientId(): string
14 14
     {
15
-        $clientId = (string)$this->get('CLIENT_ID');
15
+        $clientId = (string) $this->get('CLIENT_ID');
16 16
         if (empty($clientId)) {
17 17
             throw new RuntimeException(
18 18
                 sprintf(Message::ERROR_GET_ENV_VARIABLE, 'CLIENT_ID')
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function getClientSecret(): string
29 29
     {
30
-        $clientSecret = (string)$this->get('CLIENT_SECRET');
30
+        $clientSecret = (string) $this->get('CLIENT_SECRET');
31 31
         if (empty($clientSecret)) {
32 32
             throw new RuntimeException(
33 33
                 sprintf(Message::ERROR_GET_ENV_VARIABLE, 'CLIENT_SECRET')
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function getRedirectUri(): string
44 44
     {
45
-        $redirectUri = (string)$this->get('REDIRECT_URI');
45
+        $redirectUri = (string) $this->get('REDIRECT_URI');
46 46
         if (empty($redirectUri)) {
47 47
             throw new RuntimeException(
48 48
                 sprintf(Message::ERROR_GET_ENV_VARIABLE, 'REDIRECT_URI')
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function getSpotifyUsername(): string
59 59
     {
60
-        $spotifyUsername = (string)$this->get('SPOTIFY_USERNAME');
60
+        $spotifyUsername = (string) $this->get('SPOTIFY_USERNAME');
61 61
         if (empty($spotifyUsername)) {
62 62
             throw new RuntimeException(
63 63
                 sprintf(Message::ERROR_GET_ENV_VARIABLE, 'SPOTIFY_USERNAME')
@@ -73,6 +73,6 @@  discard block
 block discarded – undo
73 73
      */
74 74
     private function get(string $name)
75 75
     {        
76
-        return $_ENV[$name];
76
+        return $_ENV[ $name ];
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
test/Integration/Application/SpotifyWebApiPhp/SessionTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,22 +28,22 @@
 block discarded – undo
28 28
 
29 29
         $this->assertNotEmpty($redirectUrl, 'authorize url from spotify is empty');
30 30
         $parseRedirectUrl = parse_url($redirectUrl);
31
-        $this->assertSame('accounts.spotify.com', $parseRedirectUrl['host']);
32
-        $this->assertSame('/authorize', $parseRedirectUrl['path']);
31
+        $this->assertSame('accounts.spotify.com', $parseRedirectUrl[ 'host' ]);
32
+        $this->assertSame('/authorize', $parseRedirectUrl[ 'path' ]);
33 33
 
34
-        $this->assertNotEmpty($parseRedirectUrl['query']);
34
+        $this->assertNotEmpty($parseRedirectUrl[ 'query' ]);
35 35
 
36
-        $info = [];
37
-        parse_str($parseRedirectUrl['query'], $info);
36
+        $info = [ ];
37
+        parse_str($parseRedirectUrl[ 'query' ], $info);
38 38
 
39
-        $this->assertSame('code', $info['response_type']);
40
-        $this->assertSame('http://localhost/', $info['redirect_uri']);
41
-        $this->assertTrue(isset($info['client_id']));
39
+        $this->assertSame('code', $info[ 'response_type' ]);
40
+        $this->assertSame('http://localhost/', $info[ 'redirect_uri' ]);
41
+        $this->assertTrue(isset($info[ 'client_id' ]));
42 42
     }
43 43
 
44 44
     public function testRefreshAccessToken()
45 45
     {
46
-        $this->assertTrue($this->session->refreshAccessToken($_ENV['REFRESH_TOKEN']));
46
+        $this->assertTrue($this->session->refreshAccessToken($_ENV[ 'REFRESH_TOKEN' ]));
47 47
         $this->assertNotEmpty($this->session->getAccessToken());
48 48
     }
49 49
 
Please login to merge, or discard this patch.