Completed
Pull Request — master (#574)
by Fosco
02:57
created
src/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function __construct()
41 41
     {
42 42
         if (!function_exists('openssl_random_pseudo_bytes')) {
43
-            throw new FacebookSDKException(static::ERROR_MESSAGE . 'The function openssl_random_pseudo_bytes() does not exist.');
43
+            throw new FacebookSDKException(static::ERROR_MESSAGE.'The function openssl_random_pseudo_bytes() does not exist.');
44 44
         }
45 45
     }
46 46
 
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
         $binaryString = openssl_random_pseudo_bytes($length, $wasCryptographicallyStrong);
56 56
 
57 57
         if ($binaryString === false) {
58
-            throw new FacebookSDKException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned an unknown error.');
58
+            throw new FacebookSDKException(static::ERROR_MESSAGE.'openssl_random_pseudo_bytes() returned an unknown error.');
59 59
         }
60 60
 
61 61
         if ($wasCryptographicallyStrong !== true) {
62
-            throw new FacebookSDKException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned a pseudo-random string but it was not cryptographically secure and cannot be used.');
62
+            throw new FacebookSDKException(static::ERROR_MESSAGE.'openssl_random_pseudo_bytes() returned a pseudo-random string but it was not cryptographically secure and cannot be used.');
63 63
         }
64 64
 
65 65
         return $this->binToHex($binaryString, $length);
Please login to merge, or discard this patch.
src/Facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         if (!function_exists('mcrypt_create_iv')) {
43 43
             throw new FacebookSDKException(
44
-                static::ERROR_MESSAGE .
44
+                static::ERROR_MESSAGE.
45 45
                 'The function mcrypt_create_iv() does not exist.'
46 46
             );
47 47
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         if ($binaryString === false) {
60 60
             throw new FacebookSDKException(
61
-                static::ERROR_MESSAGE .
61
+                static::ERROR_MESSAGE.
62 62
                 'mcrypt_create_iv() returned an error.'
63 63
             );
64 64
         }
Please login to merge, or discard this patch.
src/Facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
     {
43 43
         if (ini_get('open_basedir')) {
44 44
             throw new FacebookSDKException(
45
-                static::ERROR_MESSAGE .
45
+                static::ERROR_MESSAGE.
46 46
                 'There is an open_basedir constraint that prevents access to /dev/urandom.'
47 47
             );
48 48
         }
49 49
 
50 50
         if (!is_readable('/dev/urandom')) {
51 51
             throw new FacebookSDKException(
52
-                static::ERROR_MESSAGE .
52
+                static::ERROR_MESSAGE.
53 53
                 'Unable to read from /dev/urandom.'
54 54
             );
55 55
         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $stream = fopen('/dev/urandom', 'rb');
66 66
         if (!is_resource($stream)) {
67 67
             throw new FacebookSDKException(
68
-                static::ERROR_MESSAGE .
68
+                static::ERROR_MESSAGE.
69 69
                 'Unable to open stream to /dev/urandom.'
70 70
             );
71 71
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         if (!$binaryString) {
81 81
             throw new FacebookSDKException(
82
-                static::ERROR_MESSAGE .
82
+                static::ERROR_MESSAGE.
83 83
                 'Stream to /dev/urandom returned no data.'
84 84
             );
85 85
         }
Please login to merge, or discard this patch.
src/Facebook/GraphNodes/GraphNodeFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function makeGraphAchievement()
106 106
     {
107
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphAchievement');
107
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphAchievement');
108 108
     }
109 109
 
110 110
     /**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function makeGraphAlbum()
118 118
     {
119
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphAlbum');
119
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphAlbum');
120 120
     }
121 121
 
122 122
     /**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function makeGraphPage()
130 130
     {
131
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphPage');
131
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphPage');
132 132
     }
133 133
 
134 134
     /**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function makeGraphSessionInfo()
142 142
     {
143
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphSessionInfo');
143
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphSessionInfo');
144 144
     }
145 145
 
146 146
     /**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function makeGraphUser()
154 154
     {
155
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphUser');
155
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphUser');
156 156
     }
157 157
 
158 158
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function makeGraphEvent()
166 166
     {
167
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphEvent');
167
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphEvent');
168 168
     }
169 169
 
170 170
     /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function makeGraphGroup()
178 178
     {
179
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphGroup');
179
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphGroup');
180 180
     }
181 181
 
182 182
     /**
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         $this->validateResponseCastableAsGraphEdge();
196 196
 
197 197
         if ($subclassName && $auto_prefix) {
198
-            $subclassName = static::BASE_GRAPH_OBJECT_PREFIX . $subclassName;
198
+            $subclassName = static::BASE_GRAPH_OBJECT_PREFIX.$subclassName;
199 199
         }
200 200
 
201 201
         return $this->castAsGraphNodeOrGraphEdge($this->decodedBody, $subclassName);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         $metaData = $this->getMetaData($data);
338 338
 
339 339
         // We'll need to make an edge endpoint for this in case it's a GraphEdge (for cursor pagination)
340
-        $parentGraphEdgeEndpoint = $parentNodeId && $parentKey ? '/' . $parentNodeId . '/' . $parentKey : null;
340
+        $parentGraphEdgeEndpoint = $parentNodeId && $parentKey ? '/'.$parentNodeId.'/'.$parentKey : null;
341 341
         $className = static::BASE_GRAPH_EDGE_CLASS;
342 342
 
343 343
         return new $className($this->response->getRequest(), $dataList, $metaData, $parentGraphEdgeEndpoint, $subclassName);
@@ -387,6 +387,6 @@  discard block
 block discarded – undo
387 387
             return;
388 388
         }
389 389
 
390
-        throw new FacebookSDKException('The given subclass "' . $subclassName . '" is not valid. Cannot cast to an object that is not a GraphNode subclass.', 620);
390
+        throw new FacebookSDKException('The given subclass "'.$subclassName.'" is not valid. Cannot cast to an object that is not a GraphNode subclass.', 620);
391 391
     }
392 392
 }
Please login to merge, or discard this patch.
src/Facebook/GraphNodes/GraphObjectFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
      */
69 69
     public function makeGraphEvent()
70 70
     {
71
-        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphEvent');
71
+        return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX.'GraphEvent');
72 72
     }
73 73
 
74 74
     /**
Please login to merge, or discard this patch.
src/Facebook/FacebookClient.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -163,13 +163,13 @@
 block discarded – undo
163 163
     public function prepareRequestMessage(FacebookRequest $request)
164 164
     {
165 165
         $postToVideoUrl = $request->containsVideoUploads();
166
-        $url = $this->getBaseGraphUrl($postToVideoUrl) . $request->getUrl();
166
+        $url = $this->getBaseGraphUrl($postToVideoUrl).$request->getUrl();
167 167
 
168 168
         // If we're sending files they should be sent as multipart/form-data
169 169
         if ($request->containsFileUploads()) {
170 170
             $requestBody = $request->getMultipartBody();
171 171
             $request->setHeaders([
172
-                'Content-Type' => 'multipart/form-data; boundary=' . $requestBody->getBoundary(),
172
+                'Content-Type' => 'multipart/form-data; boundary='.$requestBody->getBoundary(),
173 173
             ]);
174 174
         } else {
175 175
             $requestBody = $request->getUrlEncodedBody();
Please login to merge, or discard this patch.
src/Facebook/Url/FacebookUrlDetectionHandler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getCurrentUrl()
37 37
     {
38
-        return $this->getHttpScheme() . '://' . $this->getHostName() . $this->getServerVar('REQUEST_URI');
38
+        return $this->getHttpScheme().'://'.$this->getHostName().$this->getServerVar('REQUEST_URI');
39 39
     }
40 40
 
41 41
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             return $this->protocolWithActiveSsl($protocol);
67 67
         }
68 68
 
69
-        return (string)$this->getServerVar('SERVER_PORT') === '443';
69
+        return (string) $this->getServerVar('SERVER_PORT') === '443';
70 70
     }
71 71
 
72 72
     /**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     protected function protocolWithActiveSsl($protocol)
80 80
     {
81
-        $protocol = strtolower((string)$protocol);
81
+        $protocol = strtolower((string) $protocol);
82 82
 
83 83
         return in_array($protocol, ['on', '1', 'https', 'ssl'], true);
84 84
     }
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
         // Port number
112 112
         $scheme = $this->getHttpScheme();
113 113
         $port = $this->getCurrentPort();
114
-        $appendPort = ':' . $port;
114
+        $appendPort = ':'.$port;
115 115
 
116 116
         // Don't append port number if a normal port.
117 117
         if (($scheme == 'http' && $port == '80') || ($scheme == 'https' && $port == '443')) {
118 118
             $appendPort = '';
119 119
         }
120 120
 
121
-        return $host . $appendPort;
121
+        return $host.$appendPort;
122 122
     }
123 123
 
124 124
     protected function getCurrentPort()
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
         // Check for proxy first
127 127
         $port = $this->getHeader('X_FORWARDED_PORT');
128 128
         if ($port) {
129
-            return (string)$port;
129
+            return (string) $port;
130 130
         }
131 131
 
132
-        $protocol = (string)$this->getHeader('X_FORWARDED_PROTO');
132
+        $protocol = (string) $this->getHeader('X_FORWARDED_PROTO');
133 133
         if ($protocol === 'https') {
134 134
             return '443';
135 135
         }
136 136
 
137
-        return (string)$this->getServerVar('SERVER_PORT');
137
+        return (string) $this->getServerVar('SERVER_PORT');
138 138
     }
139 139
 
140 140
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     protected function getHeader($key)
160 160
     {
161
-        return $this->getServerVar('HTTP_' . $key);
161
+        return $this->getServerVar('HTTP_'.$key);
162 162
     }
163 163
 
164 164
     /**
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         
178 178
         return return (preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $domain_name) //valid chars check
179 179
             && preg_match("/^.{1,253}$/", $domain_name) //overall length check
180
-            && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name) ); //length of each label
180
+            && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name)); //length of each label
181 181
     }
182 182
 
183 183
 }
Please login to merge, or discard this patch.