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/Auth/PinterestOAuth.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -54,6 +54,7 @@
 block discarded – undo
54 54
      *
55 55
      * @param  string   $client_id
56 56
      * @param  string   $client_secret
57
+     * @param Request $request
57 58
      */
58 59
     public function __construct( $client_id, $client_secret, $request )
59 60
     {
Please login to merge, or discard this patch.
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/Boards.php 4 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param string    $board_id
23 23
      * @param array     $data
24 24
      * @throws Exceptions/PinterestExceptions
25
-     * @return Models\Board
25
+     * @return Board
26 26
      */
27 27
     public function get( $board_id, array $data = [] )
28 28
     {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @access public
37 37
      * @param  array    $data
38 38
      * @throws Exceptions/PinterestExceptions
39
-     * @return Models\Board
39
+     * @return Board
40 40
      */
41 41
     public function create( array $data )
42 42
     {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @access public
51 51
      * @param  string    $board_id
52 52
      * @throws Exceptions/PinterestExceptions
53
-     * @return Models\Board
53
+     * @return boolean
54 54
      */
55 55
     public function delete( $board_id )
56 56
     {
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\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.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright 2015 Dirk Groenen
4
- *
5
- * (c) Dirk Groenen <[email protected]>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
3
+     * Copyright 2015 Dirk Groenen
4
+     *
5
+     * (c) Dirk Groenen <[email protected]>
6
+     *
7
+     * For the full copyright and license information, please view the LICENSE
8
+     * file that was distributed with this source code.
9
+     */
10 10
 
11 11
 namespace DirkGroenen\Pinterest\Endpoints;
12 12
 
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/Endpoints/Pins.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param  string   $pin_id
23 23
      * @param array     $data
24 24
      * @throws Exceptions/PinterestExceptions
25
-     * @return Models\Pin
25
+     * @return Pin
26 26
      */
27 27
     public function get( $pin_id, array $data = [] )
28 28
     {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @param  string   $board_id
38 38
      * @param array     $data
39 39
      * @throws Exceptions/PinterestExceptions
40
-     * @return Models\Collection
40
+     * @return Collection
41 41
      */
42 42
     public function fromBoard( $board_id, array $data = [] )
43 43
     {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @access public
52 52
      * @param  array    $data
53 53
      * @throws Exceptions/PinterestExceptions
54
-     * @return Models\Pin
54
+     * @return Pin
55 55
      */
56 56
     public function create( array $data )
57 57
     {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param  string   $pin_id
76 76
      * @param  array    $data
77 77
      * @throws Exceptions/PinterestExceptions
78
-     * @return Models\Pin
78
+     * @return Pin
79 79
      */
80 80
     public function update( $pin_id, array $data )
81 81
     {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
         if( array_key_exists("image", $data) ){
59 59
             if(class_exists("\CURLFile")){
60 60
                 $data["image"] = new \CURLFile($data['image']);
61
-            }
62
-            else{
61
+            } else{
63 62
                 $data["image"] = '@' . $data['image'];  
64 63
             }
65 64
         }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 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\Pin
26 26
      */
27
-    public function get( $pin_id, array $data = [] )
27
+    public function get($pin_id, array $data = [])
28 28
     {
29
-        $response = $this->request->get( sprintf("pins/%s", $pin_id), $data );
30
-        return new Pin( $this->master, $response );
29
+        $response = $this->request->get(sprintf("pins/%s", $pin_id), $data);
30
+        return new Pin($this->master, $response);
31 31
     }
32 32
 
33 33
     /**
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
      * @throws Exceptions/PinterestExceptions
40 40
      * @return Models\Collection
41 41
      */
42
-    public function fromBoard( $board_id, array $data = [] )
42
+    public function fromBoard($board_id, array $data = [])
43 43
     {
44
-        $response = $this->request->get( sprintf("boards/%s/pins", $board_id), $data );
45
-        return new Collection( $this->master, $response, "Pin" );
44
+        $response = $this->request->get(sprintf("boards/%s/pins", $board_id), $data);
45
+        return new Collection($this->master, $response, "Pin");
46 46
     }
47 47
 
48 48
     /**
@@ -53,19 +53,19 @@  discard block
 block discarded – undo
53 53
      * @throws Exceptions/PinterestExceptions
54 54
      * @return Models\Pin
55 55
      */
56
-    public function create( array $data )
56
+    public function create(array $data)
57 57
     {
58
-        if( array_key_exists("image", $data) ){
59
-            if(class_exists("\CURLFile")){
58
+        if (array_key_exists("image", $data)) {
59
+            if (class_exists("\CURLFile")) {
60 60
                 $data["image"] = new \CURLFile($data['image']);
61 61
             }
62
-            else{
62
+            else {
63 63
                 $data["image"] = '@' . $data['image'];
64 64
             }
65 65
         }
66 66
 
67
-        $response = $this->request->post( "pins", $data );
68
-        return new Pin( $this->master, $response );
67
+        $response = $this->request->post("pins", $data);
68
+        return new Pin($this->master, $response);
69 69
     }
70 70
 
71 71
     /**
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
      * @throws Exceptions/PinterestExceptions
78 78
      * @return Models\Pin
79 79
      */
80
-    public function update( $pin_id, array $data )
80
+    public function update($pin_id, array $data)
81 81
     {
82
-        $response = $this->request->update( sprintf("pins/%s", $pin_id), $data );
83
-        return new Pin( $this->master, $response );
82
+        $response = $this->request->update(sprintf("pins/%s", $pin_id), $data);
83
+        return new Pin($this->master, $response);
84 84
     }
85 85
 
86 86
     /**
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
      * @throws Exceptions/PinterestExceptions
92 92
      * @return boolean
93 93
      */
94
-    public function delete( $pin_id )
94
+    public function delete($pin_id)
95 95
     {
96
-        $this->request->delete( sprintf("pins/%s", $pin_id) );
96
+        $this->request->delete(sprintf("pins/%s", $pin_id));
97 97
         return true;
98 98
     }
99 99
 }
100 100
\ No newline at end of file
Please login to merge, or discard this patch.
src/Pinterest/Transport/Response.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * Constructor
34 34
      *
35
-     * @param  array        $response
35
+     * @param  string        $response
36 36
      * @param  CurlBuilder  $curl
37 37
      * @param  curl    $curl
38 38
      */
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      *
76 76
      * @access public
77 77
      * @param  string   $key
78
-     * @return array
78
+     * @return boolean
79 79
      */
80 80
     public function __isset($key)
81 81
     {
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.
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.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 use DirkGroenen\Pinterest\Utils\CurlBuilder;
14 14
 use DirkGroenen\Pinterest\Exceptions\PinterestException;
15 15
 
16
- /**
17
-  * @property array $page
18
-  * @property array $data
19
-  * @property string $message
20
-  */
16
+    /**
17
+     * @property array $page
18
+     * @property array $data
19
+     * @property string $message
20
+     */
21 21
 class Response {
22 22
 
23 23
     /**
Please login to merge, or discard this patch.
src/Pinterest/Utils/CurlBuilder.php 5 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.
Braces   +9 added lines, -12 removed lines patch added patch discarded remove patch
@@ -165,10 +165,11 @@  discard block
 block discarded – undo
165 165
         $result = array();
166 166
         foreach(explode("\n", $headers) as $row){
167 167
             $header = explode(':', $row, 2);
168
-            if (count($header) == 2)
169
-                $result[$header[0]] = trim($header[1]);
170
-            else
171
-                $result[] = $header[0];
168
+            if (count($header) == 2) {
169
+                            $result[$header[0]] = trim($header[1]);
170
+            } else {
171
+                            $result[] = $header[0];
172
+            }
172 173
         }
173 174
         return $result;
174 175
     }
@@ -189,8 +190,7 @@  discard block
 block discarded – undo
189 190
         if(ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")){
190 191
             curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $mr > 0);
191 192
             curl_setopt($this->curl, CURLOPT_MAXREDIRS, $mr);
192
-        }
193
-        else{
193
+        } else{
194 194
             $this->setOption(CURLOPT_FOLLOWLOCATION, false);
195 195
 
196 196
             if($mr > 0){
@@ -213,15 +213,13 @@  discard block
 block discarded – undo
213 213
 
214 214
                     if(curl_errno($rch)){
215 215
                         $code = 0;
216
-                    }
217
-                    else{
216
+                    } else{
218 217
                         $code = curl_getinfo($rch, CURLINFO_HTTP_CODE);
219 218
 
220 219
                         if ($code == 301 || $code == 302) {
221 220
                             preg_match('/Location:(.*?)\n/i', $header, $matches);
222 221
                             $newurl = trim(array_pop($matches));
223
-                        }
224
-                        else{
222
+                        } else{
225 223
                             $code = 0;
226 224
                         }
227 225
                     }
@@ -232,8 +230,7 @@  discard block
 block discarded – undo
232 230
                 if(!$mr){
233 231
                     if ($maxredirect === null){
234 232
                         trigger_error('Too many redirects.', E_USER_WARNING);
235
-                    }
236
-                    else{
233
+                    } else{
237 234
                         $maxredirect = 0;
238 235
                     }
239 236
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright 2015 Dirk Groenen
4
- *
5
- * (c) Dirk Groenen <[email protected]>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
3
+     * Copyright 2015 Dirk Groenen
4
+     *
5
+     * (c) Dirk Groenen <[email protected]>
6
+     *
7
+     * For the full copyright and license information, please view the LICENSE
8
+     * file that was distributed with this source code.
9
+     */
10 10
 
11 11
 namespace DirkGroenen\Pinterest\Endpoints;
12 12
 
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @access public
54 54
      * @param  string   $option
55
-     * @param  mixed    $value
55
+     * @param  false|string    $value
56 56
      * @return $this
57 57
      */
58 58
     public function setOption( $option, $value )
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * Execute the curl request
81 81
      *
82 82
      * @access public
83
-     * @return mixed
83
+     * @return false|string
84 84
      */
85 85
     public function execute()
86 86
     {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      * Check if the curl request ended up with errors
92 92
      *
93 93
      * @access public
94
-     * @return boolean
94
+     * @return integer
95 95
      */
96 96
     public function hasErrors()
97 97
     {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      * Parse string headers into array
159 159
      *
160 160
      * @access private
161
-     * @param array $headers
161
+     * @param string $headers
162 162
      * @return array
163 163
      */
164 164
     private function parseHeaders($headers) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      *
181 181
      * @see http://slopjong.de/2012/03/31/curl-follow-locations-with-safe_mode-enabled-or-open_basedir-set/
182 182
      * @access private
183
-     * @return mixed
183
+     * @return false|string
184 184
      */
185 185
     private function execFollow() {
186 186
         $mr = 5;
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 2 patches
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.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,9 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function __construct($client_id, $client_secret, $curlbuilder = null)
57 57
     {
58
-        if($curlbuilder == null)
59
-            $curlbuilder = new CurlBuilder();
58
+        if($curlbuilder == null) {
59
+                    $curlbuilder = new CurlBuilder();
60
+        }
60 61
 
61 62
         // Create new instance of Transport\Request
62 63
         $this->request = new Request( $curlbuilder );
@@ -81,8 +82,9 @@  discard block
 block discarded – undo
81 82
         // Check if an instance has already been initiated
82 83
         if(!isset($this->cachedEndpoints[$endpoint])){
83 84
             // Check endpoint existence
84
-            if(!class_exists($class))
85
-                throw new InvalidEndpointException;
85
+            if(!class_exists($class)) {
86
+                            throw new InvalidEndpointException;
87
+            }
86 88
 
87 89
             // Create a reflection of the called class and initialize it
88 90
             // with a reference to the request class
Please login to merge, or discard this patch.
src/Pinterest/Endpoints/Users.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright 2015 Dirk Groenen
4
- *
5
- * (c) Dirk Groenen <[email protected]>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
3
+     * Copyright 2015 Dirk Groenen
4
+     *
5
+     * (c) Dirk Groenen <[email protected]>
6
+     *
7
+     * For the full copyright and license information, please view the LICENSE
8
+     * file that was distributed with this source code.
9
+     */
10 10
 
11 11
 namespace DirkGroenen\Pinterest\Endpoints;
12 12
 
Please login to merge, or discard this 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.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @access public
22 22
      * @param array     $data
23 23
      * @throws Exceptions/PinterestExceptions
24
-     * @return Models\User
24
+     * @return User
25 25
      */
26 26
     public function me( array $data = [] )
27 27
     {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @param string    $username
37 37
      * @param array     $data
38 38
      * @throws Exceptions/PinterestExceptions
39
-     * @return Models\User
39
+     * @return User
40 40
      */
41 41
     public function find( $username, array $data = [] )
42 42
     {
Please login to merge, or discard this patch.
src/Pinterest/Endpoints/Endpoint.php 2 patches
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.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright 2015 Dirk Groenen
4
- *
5
- * (c) Dirk Groenen <[email protected]>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
3
+     * Copyright 2015 Dirk Groenen
4
+     *
5
+     * (c) Dirk Groenen <[email protected]>
6
+     *
7
+     * For the full copyright and license information, please view the LICENSE
8
+     * file that was distributed with this source code.
9
+     */
10 10
 
11 11
 namespace DirkGroenen\Pinterest\Endpoints;
12 12
 
Please login to merge, or discard this patch.
src/Pinterest/Models/Collection.php 3 patches
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.
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,19 +67,18 @@  discard block
 block discarded – undo
67 67
         // Create class path
68 68
         $this->model = ucfirst( strtolower($model) );
69 69
 
70
-        if(!class_exists("\\DirkGroenen\\Pinterest\\Models\\" . $this->model))
71
-            throw new InvalidModelException;
70
+        if(!class_exists("\\DirkGroenen\\Pinterest\\Models\\" . $this->model)) {
71
+                    throw new InvalidModelException;
72
+        }
72 73
 
73 74
         // Get items and response instance
74 75
         if( is_array($items) ){
75 76
             $this->response = null;
76 77
             $this->items = $items;
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
-        }
82
-        else{
81
+        } else{
83 82
            throw new PinterestException("$items needs to be an instance of Transport\Response or an array.");
84 83
         }
85 84
 
@@ -89,8 +88,7 @@  discard block
 block discarded – undo
89 88
         // Add pagination object
90 89
         if( isset($this->response->page) && !empty($this->response->page['next']) ){
91 90
             $this->pagination = $this->response->page;
92
-        }
93
-        else{
91
+        } else{
94 92
             $this->pagination = false;
95 93
         }
96 94
     }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
             $this->items = $items->data;
81 81
         }
82 82
         else{
83
-           throw new PinterestException("$items needs to be an instance of Transport\Response or an array.");
83
+            throw new PinterestException("$items needs to be an instance of Transport\Response or an array.");
84 84
         }
85 85
 
86 86
         // Transform the raw collection data to models
Please login to merge, or discard this patch.