Skip to content

Commit 8f9348e

Browse files
authored
[master] Apply fixes from StyleCI
2 parents aed1fa0 + f89359b commit 8f9348e

File tree

105 files changed

+1495
-1558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1495
-1558
lines changed

src/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook;
2425

2526
use Facebook\Authentication\AccessToken;
@@ -82,7 +83,7 @@ public function getSecret()
8283
*/
8384
public function getAccessToken()
8485
{
85-
return new AccessToken($this->id . '|' . $this->secret);
86+
return new AccessToken($this->id.'|'.$this->secret);
8687
}
8788

8889
/**

src/Authentication/AccessToken.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook\Authentication;
2425

25-
/**
26-
* @package Facebook
27-
*/
2826
class AccessToken
2927
{
3028
/**

src/Authentication/AccessTokenMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook\Authentication;
2425

2526
use Facebook\Exception\SDKException;
2627

2728
/**
2829
* Represents metadata from an access token.
2930
*
30-
* @package Facebook
3131
*
3232
* @see https://developers.facebook.com/docs/graph-api/reference/debug_token
3333
*/

src/Authentication/OAuth2Client.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook\Authentication;
2425

25-
use Facebook\Facebook;
2626
use Facebook\Application;
27-
use Facebook\Request;
28-
use Facebook\Response;
2927
use Facebook\Client;
3028
use Facebook\Exception\ResponseException;
3129
use Facebook\Exception\SDKException;
30+
use Facebook\Facebook;
31+
use Facebook\Request;
32+
use Facebook\Response;
3233

33-
/**
34-
* @package Facebook
35-
*/
3634
class OAuth2Client
3735
{
3836
/**
@@ -132,15 +130,15 @@ public function debugToken($accessToken)
132130
public function getAuthorizationUrl($redirectUrl, $state, array $scope = [], array $params = [], $separator = '&')
133131
{
134132
$params += [
135-
'client_id' => $this->app->getId(),
136-
'state' => $state,
133+
'client_id' => $this->app->getId(),
134+
'state' => $state,
137135
'response_type' => 'code',
138-
'sdk' => 'php-sdk-' . Facebook::VERSION,
139-
'redirect_uri' => $redirectUrl,
140-
'scope' => implode(',', $scope)
136+
'sdk' => 'php-sdk-'.Facebook::VERSION,
137+
'redirect_uri' => $redirectUrl,
138+
'scope' => implode(',', $scope),
141139
];
142140

143-
return static::BASE_AUTHORIZATION_URL . '/' . $this->graphVersion . '/dialog/oauth?' . http_build_query($params, null, $separator);
141+
return static::BASE_AUTHORIZATION_URL.'/'.$this->graphVersion.'/dialog/oauth?'.http_build_query($params, null, $separator);
144142
}
145143

146144
/**
@@ -156,7 +154,7 @@ public function getAuthorizationUrl($redirectUrl, $state, array $scope = [], arr
156154
public function getAccessTokenFromCode($code, $redirectUri = '')
157155
{
158156
$params = [
159-
'code' => $code,
157+
'code' => $code,
160158
'redirect_uri' => $redirectUri,
161159
];
162160

@@ -176,7 +174,7 @@ public function getLongLivedAccessToken($accessToken)
176174
{
177175
$accessToken = $accessToken instanceof AccessToken ? $accessToken->getValue() : $accessToken;
178176
$params = [
179-
'grant_type' => 'fb_exchange_token',
177+
'grant_type' => 'fb_exchange_token',
180178
'fb_exchange_token' => $accessToken,
181179
];
182180

@@ -282,7 +280,7 @@ protected function sendRequestWithClientParams($endpoint, array $params, $access
282280
protected function getClientParams()
283281
{
284282
return [
285-
'client_id' => $this->app->getId(),
283+
'client_id' => $this->app->getId(),
286284
'client_secret' => $this->app->getSecret(),
287285
];
288286
}

src/BatchRequest.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook;
2425

25-
use ArrayIterator;
26-
use IteratorAggregate;
2726
use ArrayAccess;
27+
use ArrayIterator;
2828
use Facebook\Authentication\AccessToken;
2929
use Facebook\Exception\SDKException;
30+
use IteratorAggregate;
3031

31-
/**
32-
* @package Facebook
33-
*/
3432
class BatchRequest extends Request implements IteratorAggregate, ArrayAccess
3533
{
3634
/**
@@ -100,9 +98,9 @@ public function add($request, $options = null)
10098
unset($options['name']);
10199

102100
$requestToAdd = [
103-
'name' => $name,
104-
'request' => $request,
105-
'options' => $options,
101+
'name' => $name,
102+
'request' => $request,
103+
'options' => $options,
106104
'attached_files' => $attachedFiles,
107105
];
108106

@@ -184,7 +182,7 @@ public function prepareRequestsForBatch()
184182
$this->validateBatchRequestCount();
185183

186184
$params = [
187-
'batch' => $this->convertRequestsToJson(),
185+
'batch' => $this->convertRequestsToJson(),
188186
'include_headers' => true,
189187
];
190188
$this->setParams($params);
@@ -241,7 +239,6 @@ public function validateBatchRequestCount()
241239
*/
242240
public function requestEntityToBatchArray(Request $request, $options = null, $attachedFiles = null)
243241
{
244-
245242
if (null === $options) {
246243
$options = [];
247244
} elseif (!is_array($options)) {
@@ -251,12 +248,12 @@ public function requestEntityToBatchArray(Request $request, $options = null, $at
251248
$compiledHeaders = [];
252249
$headers = $request->getHeaders();
253250
foreach ($headers as $name => $value) {
254-
$compiledHeaders[] = $name . ': ' . $value;
251+
$compiledHeaders[] = $name.': '.$value;
255252
}
256253

257254
$batch = [
258-
'headers' => $compiledHeaders,
259-
'method' => $request->getMethod(),
255+
'headers' => $compiledHeaders,
256+
'method' => $request->getMethod(),
260257
'relative_url' => $request->getUrl(),
261258
];
262259

src/BatchResponse.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook;
2425

26+
use ArrayAccess;
2527
use ArrayIterator;
2628
use IteratorAggregate;
27-
use ArrayAccess;
2829

29-
/**
30-
* @package Facebook
31-
*/
3230
class BatchResponse extends Response implements IteratorAggregate, ArrayAccess
3331
{
3432
/**

src/Client.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook;
2425

2526
use Facebook\Exception\SDKException;
2627
use Http\Client\HttpClient;
2728
use Http\Discovery\HttpClientDiscovery;
2829
use Http\Discovery\MessageFactoryDiscovery;
2930

30-
/**
31-
* @package Facebook
32-
*/
3331
class Client
3432
{
3533
/**
@@ -150,13 +148,13 @@ public function getBaseGraphUrl($postToVideoUrl = false)
150148
public function prepareRequestMessage(Request $request)
151149
{
152150
$postToVideoUrl = $request->containsVideoUploads();
153-
$url = $this->getBaseGraphUrl($postToVideoUrl) . $request->getUrl();
151+
$url = $this->getBaseGraphUrl($postToVideoUrl).$request->getUrl();
154152

155153
// If we're sending files they should be sent as multipart/form-data
156154
if ($request->containsFileUploads()) {
157155
$requestBody = $request->getMultipartBody();
158156
$request->setHeaders([
159-
'Content-Type' => 'multipart/form-data; boundary=' . $requestBody->getBoundary(),
157+
'Content-Type' => 'multipart/form-data; boundary='.$requestBody->getBoundary(),
160158
]);
161159
} else {
162160
$requestBody = $request->getUrlEncodedBody();
@@ -199,7 +197,7 @@ public function sendRequest(Request $request)
199197
// Prepare headers from associative array to a single string for each header.
200198
$responseHeaders = [];
201199
foreach ($psr7Response->getHeaders() as $name => $values) {
202-
$responseHeaders[] = sprintf('%s: %s', $name, implode(", ", $values));
200+
$responseHeaders[] = sprintf('%s: %s', $name, implode(', ', $values));
203201
}
204202

205203
$Response = new Response(

src/Exception/AuthenticationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook\Exception;
2425

25-
/**
26-
* @package Facebook
27-
*/
2826
class AuthenticationException extends SDKException
2927
{
3028
}

src/Exception/AuthorizationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook\Exception;
2425

25-
/**
26-
* @package Facebook
27-
*/
2826
class AuthorizationException extends SDKException
2927
{
3028
}

src/Exception/ClientException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
2222
*/
23+
2324
namespace Facebook\Exception;
2425

25-
/**
26-
* @package Facebook
27-
*/
2826
class ClientException extends SDKException
2927
{
3028
}

0 commit comments

Comments
 (0)