GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch development (f7e59c)
by Dirk
03:17
created
src/Pinterest/Endpoints/Boards.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 namespace DirkGroenen\Pinterest\Endpoints;
12 12
 
13 13
 use DirkGroenen\Pinterest\Models\Board;
14
-use DirkGroenen\Pinterest\Models\Collection;
15 14
 
16 15
 class Boards extends Endpoint {
17 16
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
      * @throws Exceptions/PinterestExceptions
25 25
      * @return Models\Board
26 26
      */
27
-    public function get( $board_id, array $data = [] )
27
+    public function get($board_id, array $data = [])
28 28
     {
29
-        $response = $this->request->get( sprintf("boards/%s", $board_id), $data );
30
-        return new Board( $this->master, $response );
29
+        $response = $this->request->get(sprintf("boards/%s", $board_id), $data);
30
+        return new Board($this->master, $response);
31 31
     }
32 32
 
33 33
     /**
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
      * @throws Exceptions/PinterestExceptions
39 39
      * @return Models\Board
40 40
      */
41
-    public function create( array $data )
41
+    public function create(array $data)
42 42
     {
43
-        $response = $this->request->post( "boards", $data );
44
-        return new Board( $this->master, $response );
43
+        $response = $this->request->post("boards", $data);
44
+        return new Board($this->master, $response);
45 45
     }
46 46
 
47 47
     /**
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      * @throws Exceptions/PinterestExceptions
53 53
      * @return Models\Board
54 54
      */
55
-    public function delete( $board_id )
55
+    public function delete($board_id)
56 56
     {
57
-        $this->request->delete( sprintf("boards/%s", $board_id) );
57
+        $this->request->delete(sprintf("boards/%s", $board_id));
58 58
         return true;
59 59
     }
60 60
 }
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
src/Pinterest/Transport/Response.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 namespace DirkGroenen\Pinterest\Transport;
12 12
 
13 13
 use DirkGroenen\Pinterest\Utils\CurlBuilder;
14
-use DirkGroenen\Pinterest\Exceptions\PinterestException;
15 14
 
16 15
 class Response {
17 16
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
      * @param  CurlBuilder  $curl
37 37
      * @param  curl    $curl
38 38
      */
39
-    public function __construct( $response, CurlBuilder $curl )
39
+    public function __construct($response, CurlBuilder $curl)
40 40
     {
41 41
         $this->response = $response;
42 42
         $this->curl = $curl;
43 43
 
44
-        if( is_string($response) ){
44
+        if (is_string($response)) {
45 45
             $this->response = $this->decodeString($response);
46 46
         }
47 47
     }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param  string $response
54 54
      * @return array
55 55
      */
56
-    private function decodeString( $response )
56
+    private function decodeString($response)
57 57
     {
58 58
         return json_decode($response, true);
59 59
     }
Please login to merge, or discard this patch.
src/Pinterest/Utils/CurlBuilder.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,6 @@
 block discarded – undo
10 10
 
11 11
 namespace DirkGroenen\Pinterest\Utils;
12 12
 
13
-use DirkGroenen\Pinterest\Exceptions\PinterestException;
14
-
15 13
 class CurlBuilder {
16 14
 
17 15
     /**
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
      * @param  mixed    $value
56 56
      * @return $this
57 57
      */
58
-    public function setOption( $option, $value )
58
+    public function setOption($option, $value)
59 59
     {
60
-        curl_setopt($this->curl, $option, $value );
60
+        curl_setopt($this->curl, $option, $value);
61 61
 
62 62
         return $this;
63 63
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param  array   $options
70 70
      * @return $this
71 71
      */
72
-    public function setOptions( array $options = [] )
72
+    public function setOptions(array $options = [])
73 73
     {
74 74
         curl_setopt_array($this->curl, $options);
75 75
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     private function parseHeaders($headers) {
165 165
         $result = array();
166
-        foreach(explode("\n", $headers) as $row){
166
+        foreach (explode("\n", $headers) as $row) {
167 167
             $header = explode(':', $row, 2);
168 168
             if (count($header) == 2)
169 169
                 $result[$header[0]] = trim($header[1]);
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
         $mr = 5;
187 187
         $body = null;
188 188
 
189
-        if(ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")){
189
+        if (ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")) {
190 190
             curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $mr > 0);
191 191
             curl_setopt($this->curl, CURLOPT_MAXREDIRS, $mr);
192 192
         }
193
-        else{
193
+        else {
194 194
             $this->setOption(CURLOPT_FOLLOWLOCATION, false);
195 195
 
196
-            if($mr > 0){
196
+            if ($mr > 0) {
197 197
                 $original_url = $this->getInfo(CURLINFO_EFFECTIVE_URL);
198 198
                 $newurl = $original_url;
199 199
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 curl_setopt($rch, CURLOPT_HEADER, true);
203 203
                 curl_setopt($rch, CURLOPT_FORBID_REUSE, false);
204 204
 
205
-                do{
205
+                do {
206 206
                     curl_setopt($rch, CURLOPT_URL, $newurl);
207 207
                     $response = curl_exec($rch);
208 208
 
@@ -210,29 +210,29 @@  discard block
 block discarded – undo
210 210
                     $header = substr($response, 0, $header_size);
211 211
                     $body = substr($response, $header_size);
212 212
 
213
-                    if(curl_errno($rch)){
213
+                    if (curl_errno($rch)) {
214 214
                         $code = 0;
215 215
                     }
216
-                    else{
216
+                    else {
217 217
                         $code = curl_getinfo($rch, CURLINFO_HTTP_CODE);
218 218
 
219 219
                         if ($code == 301 || $code == 302) {
220 220
                             preg_match('/Location:(.*?)\n/i', $header, $matches);
221 221
                             $newurl = trim(array_pop($matches));
222 222
                         }
223
-                        else{
223
+                        else {
224 224
                             $code = 0;
225 225
                         }
226 226
                     }
227
-                } while($code && --$mr);
227
+                } while ($code && --$mr);
228 228
 
229 229
                 curl_close($rch);
230 230
 
231
-                if(!$mr){
232
-                    if ($mr === null){
231
+                if (!$mr) {
232
+                    if ($mr === null) {
233 233
                         trigger_error('Too many redirects.', E_USER_WARNING);
234 234
                     }
235
-                    else{
235
+                    else {
236 236
                         $mr = 0;
237 237
                     }
238 238
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
             }
245 245
         }
246 246
 
247
-        if (!$body){
247
+        if (!$body) {
248 248
             curl_setopt($this->curl, CURLOPT_HEADER, true);
249 249
             $response = curl_exec($this->curl);
250 250
 
Please login to merge, or discard this patch.
src/Pinterest/Pinterest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function __construct($client_id, $client_secret, $curlbuilder = null)
57 57
     {
58
-        if($curlbuilder == null)
58
+        if ($curlbuilder == null)
59 59
             $curlbuilder = new CurlBuilder();
60 60
 
61 61
         // Create new instance of Transport\Request
62
-        $this->request = new Request( $curlbuilder );
62
+        $this->request = new Request($curlbuilder);
63 63
 
64 64
         // Create and set new instance of the OAuth class
65 65
         $this->auth = new PinterestOAuth($client_id, $client_secret, $this->request);
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
         $class = "\\DirkGroenen\\Pinterest\\Endpoints\\" . ucfirst($endpoint);
80 80
 
81 81
         // Check if an instance has already been initiated
82
-        if(!isset($this->cachedEndpoints[$endpoint])){
82
+        if (!isset($this->cachedEndpoints[$endpoint])) {
83 83
             // Check endpoint existence
84
-            if(!class_exists($class))
84
+            if (!class_exists($class))
85 85
                 throw new InvalidEndpointException;
86 86
 
87 87
             // Create a reflection of the called class and initialize it
88 88
             // with a reference to the request class
89 89
             $ref = new \ReflectionClass($class);
90
-            $obj = $ref->newInstanceArgs([ $this->request, $this ]);
90
+            $obj = $ref->newInstanceArgs([$this->request, $this]);
91 91
 
92 92
             $this->cachedEndpoints[$endpoint] = $obj;
93 93
         }
Please login to merge, or discard this patch.
src/Pinterest/Auth/PinterestOAuth.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param  string   $client_id
56 56
      * @param  string   $client_secret
57 57
      */
58
-    public function __construct( $client_id, $client_secret, $request )
58
+    public function __construct($client_id, $client_secret, $request)
59 59
     {
60 60
         $this->client_id = $client_id;
61 61
         $this->client_secret = $client_secret;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param  string   $redirect_uri
76 76
      * @return string
77 77
      */
78
-    public function getLoginUrl( $redirect_uri, $scopes = array("read_public"), $response_type = "code" )
78
+    public function getLoginUrl($redirect_uri, $scopes = array("read_public"), $response_type = "code")
79 79
     {
80 80
         $queryparams = array(
81 81
             "response_type"     => $response_type,
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         );
88 88
 
89 89
         // Build url and return it
90
-        return sprintf( "%s?%s", self::AUTH_HOST, http_build_query($queryparams) );
90
+        return sprintf("%s?%s", self::AUTH_HOST, http_build_query($queryparams));
91 91
     }
92 92
 
93 93
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     private function generateState()
100 100
     {
101
-        return substr( md5( rand() ), 0, 7 );
101
+        return substr(md5(rand()), 0, 7);
102 102
     }
103 103
 
104 104
     /**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @param  string   $code
129 129
      * @return array
130 130
      */
131
-    public function getOAuthToken( $code )
131
+    public function getOAuthToken($code)
132 132
     {
133 133
         // Build data array
134 134
         $data = array(
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      * @param  string   $access_token
152 152
      * @return void
153 153
      */
154
-    public function setOAuthToken( $access_token )
154
+    public function setOAuthToken($access_token)
155 155
     {
156 156
         $this->request->setAccessToken($access_token);
157 157
     }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 namespace DirkGroenen\Pinterest\Transport;
12 12
 
13 13
 use DirkGroenen\Pinterest\Utils\CurlBuilder;
14
-use DirkGroenen\Pinterest\Exceptions\PinterestException;
15 14
 
16 15
 class Response {
17 16
 
Please login to merge, or discard this patch.
src/Pinterest/Endpoints/Users.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
      * @throws Exceptions/PinterestExceptions
24 24
      * @return Models\User
25 25
      */
26
-    public function me( array $data = [] )
26
+    public function me(array $data = [])
27 27
     {
28
-        $response = $this->request->get("me", $data );
29
-        return new User( $this->master, $response );
28
+        $response = $this->request->get("me", $data);
29
+        return new User($this->master, $response);
30 30
     }
31 31
 
32 32
     /**
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
      * @throws Exceptions/PinterestExceptions
39 39
      * @return Models\User
40 40
      */
41
-    public function find( $username, array $data = [] )
41
+    public function find($username, array $data = [])
42 42
     {
43
-        $response = $this->request->get( sprintf("users/%s", $username), $data );
44
-        return new User( $this->master, $response );
43
+        $response = $this->request->get(sprintf("users/%s", $username), $data);
44
+        return new User($this->master, $response);
45 45
     }
46 46
 
47 47
     /**
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
      * @throws Exceptions/PinterestExceptions
53 53
      * @return Collection
54 54
      */
55
-    public function getMePins( array $data = [] )
55
+    public function getMePins(array $data = [])
56 56
     {
57
-        $response = $this->request->get( "me/pins", $data );
58
-        return new Collection( $this->master, $response, "Pin" );
57
+        $response = $this->request->get("me/pins", $data);
58
+        return new Collection($this->master, $response, "Pin");
59 59
     }
60 60
 
61 61
     /**
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
      * @throws Exceptions/PinterestExceptions
67 67
      * @return Collection
68 68
      */
69
-    public function searchMePins( $query, array $data = [] )
69
+    public function searchMePins($query, array $data = [])
70 70
     {
71 71
         $data["query"] = $query;
72
-        $response = $this->request->get( "me/search/pins", $data );
73
-        return new Collection( $this->master, $response, "Pin" );
72
+        $response = $this->request->get("me/search/pins", $data);
73
+        return new Collection($this->master, $response, "Pin");
74 74
     }
75 75
 
76 76
     /**
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
      * @throws Exceptions/PinterestExceptions
82 82
      * @return Collection
83 83
      */
84
-    public function searchMeBoards( $query, array $data = [] )
84
+    public function searchMeBoards($query, array $data = [])
85 85
     {
86 86
         $data["query"] = $query;
87 87
 
88
-        $response = $this->request->get( "me/search/boards", $data );
89
-        return new Collection( $this->master, $response, "Board" );
88
+        $response = $this->request->get("me/search/boards", $data);
89
+        return new Collection($this->master, $response, "Board");
90 90
     }
91 91
 
92 92
     /**
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
      * @throws Exceptions/PinterestExceptions
98 98
      * @return Collection
99 99
      */
100
-    public function getMeBoards( array $data = [] )
100
+    public function getMeBoards(array $data = [])
101 101
     {
102
-        $response = $this->request->get( "me/boards", $data );
103
-        return new Collection( $this->master, $response, "Board" );
102
+        $response = $this->request->get("me/boards", $data);
103
+        return new Collection($this->master, $response, "Board");
104 104
     }
105 105
 
106 106
     /**
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
      * @throws Exceptions/PinterestExceptions
112 112
      * @return Collection
113 113
      */
114
-    public function getMeLikes( array $data = [] )
114
+    public function getMeLikes(array $data = [])
115 115
     {
116
-        $response = $this->request->get( "me/likes", $data );
117
-        return new Collection( $this->master, $response, "Pin" );
116
+        $response = $this->request->get("me/likes", $data);
117
+        return new Collection($this->master, $response, "Pin");
118 118
     }
119 119
 
120 120
     /**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function getMeFollowers(array $data = [])
129 129
     {
130
-        $response = $this->request->get( "me/followers", $data );
131
-        return new Collection( $this->master, $response, "User" );
130
+        $response = $this->request->get("me/followers", $data);
131
+        return new Collection($this->master, $response, "User");
132 132
     }
133 133
 
134 134
 }
Please login to merge, or discard this patch.
src/Pinterest/Endpoints/Endpoint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      * @param  Pinterest            $master
38 38
      * @return void
39 39
      */
40
-    public function __construct( Request $request, Pinterest $master )
40
+    public function __construct(Request $request, Pinterest $master)
41 41
     {
42 42
         $this->request = $request;
43 43
         $this->master = $master;
Please login to merge, or discard this patch.
src/Pinterest/Models/Collection.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,25 +61,25 @@  discard block
 block discarded – undo
61 61
      * @param  string               $model
62 62
      * @throws InvalidModelException
63 63
      */
64
-    public function __construct( Pinterest $master, $items, $model ){
64
+    public function __construct(Pinterest $master, $items, $model) {
65 65
         $this->master = $master;
66 66
 
67 67
         // Create class path
68
-        $this->model = ucfirst( strtolower($model) );
68
+        $this->model = ucfirst(strtolower($model));
69 69
 
70
-        if(!class_exists("\\DirkGroenen\\Pinterest\\Models\\" . $this->model))
70
+        if (!class_exists("\\DirkGroenen\\Pinterest\\Models\\" . $this->model))
71 71
             throw new InvalidModelException;
72 72
 
73 73
         // Get items and response instance
74
-        if( is_array($items) ){
74
+        if (is_array($items)) {
75 75
             $this->response = null;
76 76
             $this->items = $items;
77 77
         }
78
-        else if( $items instanceof \DirkGroenen\Pinterest\Transport\Response ){
78
+        else if ($items instanceof \DirkGroenen\Pinterest\Transport\Response) {
79 79
             $this->response = $items;
80 80
             $this->items = $items->data;
81 81
         }
82
-        else{
82
+        else {
83 83
            throw new PinterestException("$items needs to be an instance of Transport\Response or an array.");
84 84
         }
85 85
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
         $this->items = $this->buildCollectionModels($this->items);
88 88
 
89 89
         // Add pagination object
90
-        if( isset($this->response->page) && !empty($this->response->page['next']) ){
90
+        if (isset($this->response->page) && !empty($this->response->page['next'])) {
91 91
             $this->pagination = $this->response->page;
92 92
         }
93
-        else{
93
+        else {
94 94
             $this->pagination = false;
95 95
         }
96 96
     }
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
     {
118 118
         $modelcollection = [];
119 119
 
120
-        foreach($items as $item){
120
+        foreach ($items as $item) {
121 121
             $class = new \ReflectionClass("\\DirkGroenen\\Pinterest\\Models\\" . $this->model);
122
-            $modelcollection[] = $class->newInstanceArgs( [$this->master, $item] );
122
+            $modelcollection[] = $class->newInstanceArgs([$this->master, $item]);
123 123
         }
124 124
 
125 125
         return $modelcollection;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function hasNextPage()
135 135
     {
136
-        return ($this->response != null && isset($this->response->page['next']) );
136
+        return ($this->response != null && isset($this->response->page['next']));
137 137
     }
138 138
 
139 139
     /**
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      * @param  int $index
144 144
      * @return Model
145 145
      */
146
-    public function get( $index )
146
+    public function get($index)
147 147
     {
148 148
         return $this->items[$index];
149 149
     }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     {
159 159
         $items = [];
160 160
 
161
-        foreach($this->items as $item){
161
+        foreach ($this->items as $item) {
162 162
             $items[] = $item->toArray();
163 163
         }
164 164
 
Please login to merge, or discard this patch.
src/Pinterest/Models/Model.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
      * @param  array|Transport\Response     $modeldata
45 45
      * @return void
46 46
      */
47
-    public function __construct( Pinterest $master, $modeldata = null )
47
+    public function __construct(Pinterest $master, $modeldata = null)
48 48
     {   
49 49
         $this->master = $master;
50 50
 
51 51
         // Fill the model
52
-        if( is_array($modeldata) ){
52
+        if (is_array($modeldata)) {
53 53
             $this->fill($modeldata);
54 54
         }
55
-        else if( $modeldata instanceof \DirkGroenen\Pinterest\Transport\Response ){
55
+        else if ($modeldata instanceof \DirkGroenen\Pinterest\Transport\Response) {
56 56
             $this->fill($modeldata->data);    
57 57
         }
58 58
     }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function __set($key, $value)
82 82
     {
83
-        if($this->isFillable($key)){
83
+        if ($this->isFillable($key)) {
84 84
             $this->attributes[$key] = $value;
85 85
         }
86
-        else{
87
-            throw new PinterestException( sprintf("%s is not a fillable attribute.", $key) );
86
+        else {
87
+            throw new PinterestException(sprintf("%s is not a fillable attribute.", $key));
88 88
         }
89 89
     }
90 90
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
      */
109 109
     private function fill(array $attributes)
110 110
     {
111
-        foreach($attributes as $key => $value){
112
-            if($this->isFillable($key)){
111
+        foreach ($attributes as $key => $value) {
112
+            if ($this->isFillable($key)) {
113 113
                 $this->attributes[$key] = $value;
114 114
             }
115 115
         }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     {
138 138
         $array = array();
139 139
         
140
-        foreach($this->fillable as $key){
140
+        foreach ($this->fillable as $key) {
141 141
             $array[$key] = $this->{$key};
142 142
         }
143 143
 
Please login to merge, or discard this patch.