Skip to content

Commit 2d6f192

Browse files
committed
Removed "Facebook" prefix form all classes
1 parent 3fc95e5 commit 2d6f192

File tree

134 files changed

+1264
-1287
lines changed

Some content is hidden

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

134 files changed

+1264
-1287
lines changed

Diff for: .php_cs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
$config = PhpCsFixer\Config::create()
3+
->setRiskyAllowed(false)
4+
->setRules([
5+
'@Symfony' => false,
6+
'align_multiline_comment' => true,
7+
'combine_consecutive_unsets' => true,
8+
// one should use PHPUnit methods to set up expected exception instead of annotations
9+
'heredoc_to_nowdoc' => true,
10+
'no_null_property_initialization' => true,
11+
'no_useless_else' => true,
12+
'phpdoc_add_missing_param_annotation' => true,
13+
'phpdoc_order' => true,
14+
'phpdoc_types_order' => true,
15+
'phpdoc_align' => true,
16+
'phpdoc_indent' => true,
17+
'phpdoc_inline_tag' => true,
18+
'phpdoc_order' => true,
19+
'phpdoc_scalar' => true,
20+
'phpdoc_separation' => true,
21+
'phpdoc_summary' => true,
22+
'phpdoc_trim' => true,
23+
'phpdoc_types' => true,
24+
'phpdoc_var_without_name' => true,
25+
'phpdoc_annotation_without_dot' => true,
26+
'no_empty_comment' => true,
27+
'no_trailing_whitespace_in_comment' => true,
28+
])
29+
->setFinder(
30+
PhpCsFixer\Finder::create()
31+
->in(__DIR__.'/src')
32+
)
33+
;
34+
return $config;

Diff for: docs/examples/access_token_from_canvas.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ $helper = $fb->getCanvasHelper();
1717

1818
try {
1919
$accessToken = $helper->getAccessToken();
20-
} catch(Facebook\Exception\FacebookResponseException $e) {
20+
} catch(Facebook\Exception\ResponseException $e) {
2121
// When Graph returns an error
2222
echo 'Graph returned an error: ' . $e->getMessage();
2323
exit;
24-
} catch(Facebook\Exception\FacebookSDKException $e) {
24+
} catch(Facebook\Exception\SDKException $e) {
2525
// When validation fails or other local issues
2626
echo 'Facebook SDK returned an error: ' . $e->getMessage();
2727
exit;

Diff for: docs/examples/access_token_from_javascript.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ $helper = $fb->getJavaScriptHelper();
5959

6060
try {
6161
$accessToken = $helper->getAccessToken();
62-
} catch(Facebook\Exception\FacebookResponseException $e) {
62+
} catch(Facebook\Exception\ResponseException $e) {
6363
// When Graph returns an error
6464
echo 'Graph returned an error: ' . $e->getMessage();
6565
exit;
66-
} catch(Facebook\Exception\FacebookSDKException $e) {
66+
} catch(Facebook\Exception\SDKException $e) {
6767
// When validation fails or other local issues
6868
echo 'Facebook SDK returned an error: ' . $e->getMessage();
6969
exit;

Diff for: docs/examples/access_token_from_page_tab.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ $helper = $fb->getPageTabHelper();
1717

1818
try {
1919
$accessToken = $helper->getAccessToken();
20-
} catch(Facebook\Exception\FacebookResponseException $e) {
20+
} catch(Facebook\Exception\ResponseException $e) {
2121
// When Graph returns an error
2222
echo 'Graph returned an error: ' . $e->getMessage();
2323
exit;
24-
} catch(Facebook\Exception\FacebookSDKException $e) {
24+
} catch(Facebook\Exception\SDKException $e) {
2525
// When validation fails or other local issues
2626
echo 'Facebook SDK returned an error: ' . $e->getMessage();
2727
exit;

Diff for: docs/examples/batch_request.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ echo '<h1>Make a batch request</h1>' . "\n\n";
5252

5353
try {
5454
$responses = $fb->sendBatchRequest($batch);
55-
} catch(Facebook\Exception\FacebookResponseException $e) {
55+
} catch(Facebook\Exception\ResponseException $e) {
5656
// When Graph returns an error
5757
echo 'Graph returned an error: ' . $e->getMessage();
5858
exit;
59-
} catch(Facebook\Exception\FacebookSDKException $e) {
59+
} catch(Facebook\Exception\SDKException $e) {
6060
// When validation fails or other local issues
6161
echo 'Facebook SDK returned an error: ' . $e->getMessage();
6262
exit;
@@ -118,11 +118,11 @@ $batch = [
118118

119119
try {
120120
$responses = $fb->sendBatchRequest($batch);
121-
} catch(Facebook\Exception\FacebookResponseException $e) {
121+
} catch(Facebook\Exception\ResponseException $e) {
122122
// When Graph returns an error
123123
echo 'Graph returned an error: ' . $e->getMessage();
124124
exit;
125-
} catch(Facebook\Exception\FacebookSDKException $e) {
125+
} catch(Facebook\Exception\SDKException $e) {
126126
// When validation fails or other local issues
127127
echo 'Facebook SDK returned an error: ' . $e->getMessage();
128128
exit;

Diff for: docs/examples/batch_upload.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ $batch = [
3737

3838
try {
3939
$responses = $fb->sendBatchRequest($batch);
40-
} catch(Facebook\Exception\FacebookResponseException $e) {
40+
} catch(Facebook\Exception\ResponseException $e) {
4141
// When Graph returns an error
4242
echo 'Graph returned an error: ' . $e->getMessage();
4343
exit;
44-
} catch(Facebook\Exception\FacebookSDKException $e) {
44+
} catch(Facebook\Exception\SDKException $e) {
4545
// When validation fails or other local issues
4646
echo 'Facebook SDK returned an error: ' . $e->getMessage();
4747
exit;

Diff for: docs/examples/facebook_login.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ $helper = $fb->getRedirectLoginHelper();
3838

3939
try {
4040
$accessToken = $helper->getAccessToken();
41-
} catch(Facebook\Exception\FacebookResponseException $e) {
41+
} catch(Facebook\Exception\ResponseException $e) {
4242
// When Graph returns an error
4343
echo 'Graph returned an error: ' . $e->getMessage();
4444
exit;
45-
} catch(Facebook\Exception\FacebookSDKException $e) {
45+
} catch(Facebook\Exception\SDKException $e) {
4646
// When validation fails or other local issues
4747
echo 'Facebook SDK returned an error: ' . $e->getMessage();
4848
exit;
@@ -84,7 +84,7 @@ if (! $accessToken->isLongLived()) {
8484
// Exchanges a short-lived access token for a long-lived one
8585
try {
8686
$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
87-
} catch (Facebook\Exception\FacebookSDKException $e) {
87+
} catch (Facebook\Exception\SDKException $e) {
8888
echo "<p>Error getting long-lived access token: " . $e->getMessage() . "</p>\n\n";
8989
exit;
9090
}

Diff for: docs/examples/pagination_basic.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ $fb = new Facebook\Facebook([
1818
try {
1919
// Requires the "read_stream" permission
2020
$response = $fb->get('/me/feed?fields=id,message&limit=5');
21-
} catch(Facebook\Exception\FacebookResponseException $e) {
21+
} catch(Facebook\Exception\ResponseException $e) {
2222
// When Graph returns an error
2323
echo 'Graph returned an error: ' . $e->getMessage();
2424
exit;
25-
} catch(Facebook\Exception\FacebookSDKException $e) {
25+
} catch(Facebook\Exception\SDKException $e) {
2626
// When validation fails or other local issues
2727
echo 'Facebook SDK returned an error: ' . $e->getMessage();
2828
exit;

Diff for: docs/examples/post_links.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example covers posting a link to the current user's timeline using the Grap
44

55
It assumes that you've already obtained an access token from one of the helpers found [here](../reference.md). The access token must have the `publish_actions` permission for this to work.
66

7-
For more information, see the documentation for [`Facebook\Facebook`](../reference/Facebook.md), [`Facebook\FacebookResponse`](../reference/FacebookResponse.md), [`Facebook\GraphNode\GraphNode`](../reference/GraphNode.md), [`Facebook\Exception\FacebookSDKException`](../reference/FacebookSDKException.md) and [`Facebook\Exception\FacebookResponseException`](../reference/FacebookResponseException.md).
7+
For more information, see the documentation for [`Facebook\Facebook`](../reference/Facebook.md), [`Facebook\Response`](../reference/Response.md), [`Facebook\GraphNode\GraphNode`](../reference/GraphNode.md), [`Facebook\Exception\SDKException`](../reference/SDKException.md) and [`Facebook\Exception\ResponseException`](../reference/ResponseException.md).
88

99
## Example
1010

@@ -21,12 +21,12 @@ $linkData = [
2121
];
2222

2323
try {
24-
// Returns a `Facebook\FacebookResponse` object
24+
// Returns a `Facebook\Response` object
2525
$response = $fb->post('/me/feed', $linkData, '{access-token}');
26-
} catch(Facebook\Exception\FacebookResponseException $e) {
26+
} catch(Facebook\Exception\ResponseException $e) {
2727
echo 'Graph returned an error: ' . $e->getMessage();
2828
exit;
29-
} catch(Facebook\Exception\FacebookSDKException $e) {
29+
} catch(Facebook\Exception\SDKException $e) {
3030
echo 'Facebook SDK returned an error: ' . $e->getMessage();
3131
exit;
3232
}

Diff for: docs/examples/retrieve_user_profile.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example covers getting profile information for the current user and printin
44

55
It assumes that you've already obtained an access token from one of the helpers found [here](../reference.md).
66

7-
For more information, see the documentation for [`Facebook\Facebook`](../reference/Facebook.md), [`Facebook\FacebookResponse`](../reference/FacebookResponse.md), [`Facebook\GraphNode\GraphUser`](../reference/GraphNode.md#graphuser-instance-methods), [`Facebook\Exception\FacebookSDKException`](../reference/FacebookSDKException.md) and [`Facebook\Exception\FacebookResponseException`](../reference/FacebookResponseException.md).
7+
For more information, see the documentation for [`Facebook\Facebook`](../reference/Facebook.md), [`Facebook\Response`](../reference/Response.md), [`Facebook\GraphNode\GraphUser`](../reference/GraphNode.md#graphuser-instance-methods), [`Facebook\Exception\SDKException`](../reference/SDKException.md) and [`Facebook\Exception\ResponseException`](../reference/ResponseException.md).
88

99
## Example
1010

@@ -16,12 +16,12 @@ $fb = new Facebook\Facebook([
1616
]);
1717

1818
try {
19-
// Returns a `Facebook\FacebookResponse` object
19+
// Returns a `Facebook\Response` object
2020
$response = $fb->get('/me?fields=id,name', '{access-token}');
21-
} catch(Facebook\Exception\FacebookResponseException $e) {
21+
} catch(Facebook\Exception\ResponseException $e) {
2222
echo 'Graph returned an error: ' . $e->getMessage();
2323
exit;
24-
} catch(Facebook\Exception\FacebookSDKException $e) {
24+
} catch(Facebook\Exception\SDKException $e) {
2525
echo 'Facebook SDK returned an error: ' . $e->getMessage();
2626
exit;
2727
}

Diff for: docs/examples/upload_photo.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example covers uploading a photo to the current User's profile using the Gr
44

55
It assumes that you've already acquired an access token using one of the helper classes found [here](../reference.md). The access token must have the `publish_actions` permission for this to work.
66

7-
For more information, see the documentation for [`Facebook\Facebook`](../reference/Facebook.md), [`Facebook\FileUpload\FacebookFile`](../reference/FacebookFile.md), [`Facebook\FacebookResponse`](../reference/FacebookResponse.md), [`Facebook\GraphNode\GraphNode`](../reference/GraphNode.md), [`Facebook\Exception\FacebookSDKException`](../reference/FacebookSDKException.md) and [`Facebook\Exception\FacebookResponseException`](../reference/FacebookResponseException.md).
7+
For more information, see the documentation for [`Facebook\Facebook`](../reference/Facebook.md), [`Facebook\FileUpload\File`](../reference/File.md), [`Facebook\Response`](../reference/Response.md), [`Facebook\GraphNode\GraphNode`](../reference/GraphNode.md), [`Facebook\Exception\SDKException`](../reference/SDKException.md) and [`Facebook\Exception\ResponseException`](../reference/ResponseException.md).
88

99
## Example
1010

@@ -21,12 +21,12 @@ $data = [
2121
];
2222

2323
try {
24-
// Returns a `Facebook\FacebookResponse` object
24+
// Returns a `Facebook\Response` object
2525
$response = $fb->post('/me/photos', $data, '{access-token}');
26-
} catch(Facebook\Exception\FacebookResponseException $e) {
26+
} catch(Facebook\Exception\ResponseException $e) {
2727
echo 'Graph returned an error: ' . $e->getMessage();
2828
exit;
29-
} catch(Facebook\Exception\FacebookSDKException $e) {
29+
} catch(Facebook\Exception\SDKException $e) {
3030
echo 'Facebook SDK returned an error: ' . $e->getMessage();
3131
exit;
3232
}

Diff for: docs/examples/upload_video.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ $data = [
2222

2323
try {
2424
$response = $fb->uploadVideo('me', '/path/to/foo_bar.mp4', $data, '{user-access-token}');
25-
} catch(Facebook\Exception\FacebookResponseException $e) {
25+
} catch(Facebook\Exception\ResponseException $e) {
2626
// When Graph returns an error
2727
echo 'Graph returned an error: ' . $e->getMessage();
2828
exit;
29-
} catch(Facebook\Exception\FacebookSDKException $e) {
29+
} catch(Facebook\Exception\SDKException $e) {
3030
// When validation fails or other local issues
3131
echo 'Facebook SDK returned an error: ' . $e->getMessage();
3232
exit;
@@ -50,11 +50,11 @@ $data = [
5050

5151
try {
5252
$response = $fb->post('/me/videos', $data, 'user-access-token');
53-
} catch(Facebook\Exception\FacebookResponseException $e) {
53+
} catch(Facebook\Exception\ResponseException $e) {
5454
// When Graph returns an error
5555
echo 'Graph returned an error: ' . $e->getMessage();
5656
exit;
57-
} catch(Facebook\Exception\FacebookSDKException $e) {
57+
} catch(Facebook\Exception\SDKException $e) {
5858
// When validation fails or other local issues
5959
echo 'Facebook SDK returned an error: ' . $e->getMessage();
6060
exit;

Diff for: docs/reference.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ These classes are at the core of the Facebook SDK for PHP.
99
| Class name | Description |
1010
| ------------- | ------------- |
1111
| [`Facebook\Facebook`](reference/Facebook.md) | The main service object that helps tie all the SDK components together. |
12-
| [`Facebook\FacebookApp`](reference/FacebookApp.md) | An entity that represents a Facebook app and is required to send requests to Graph. |
12+
| [`Facebook\Application`](reference/Application.md) | An entity that represents a Facebook app and is required to send requests to Graph. |
1313

1414
# Authentication
1515

1616
These classes facilitate authenticating a Facebook user with OAuth 2.0.
1717

1818
| Class name | Description |
1919
| ------------- | ------------- |
20-
| [`Facebook\Helper\FacebookRedirectLoginHelper`](reference/FacebookRedirectLoginHelper.md) | An OAuth 2.0 service to obtain a user access token from a redirect using a "Log in with Facebook" link. |
20+
| [`Facebook\Helper\RedirectLoginHelper`](reference/RedirectLoginHelper.md) | An OAuth 2.0 service to obtain a user access token from a redirect using a "Log in with Facebook" link. |
2121
| [`Facebook\Authentication\AccessToken`](reference/AccessToken.md) | An entity that represents an access token. |
2222
| `Facebook\Authentication\AccessTokenMetadata` | An entity that represents metadata from an access token. |
2323
| `Facebook\Authentication\OAuth2Client` | An OAuth 2.0 client that sends and receives HTTP requests related to user authentication. |
@@ -28,11 +28,11 @@ These classes are used in a Graph API request/response cycle.
2828

2929
| Class name | Description |
3030
| ------------- | ------------- |
31-
| [`Facebook\FacebookRequest`](reference/FacebookRequest.md) | An entity that represents an HTTP request to be sent to Graph. |
32-
| [`Facebook\FacebookResponse`](reference/FacebookResponse.md) | An entity that represents an HTTP response from Graph. |
33-
| [`Facebook\FacebookBatchRequest`](reference/FacebookBatchRequest.md) | An entity that represents an HTTP batch request to be sent to Graph. |
34-
| [`Facebook\FacebookBatchResponse`](reference/FacebookBatchResponse.md) | An entity that represents an HTTP response from Graph after sending a batch request. |
35-
| [`Facebook\FacebookClient`](reference/FacebookClient.md) | A service object that sends HTTP requests and receives HTTP responses to and from the Graph API. |
31+
| [`Facebook\Request`](reference/Request.md) | An entity that represents an HTTP request to be sent to Graph. |
32+
| [`Facebook\Response`](reference/Response.md) | An entity that represents an HTTP response from Graph. |
33+
| [`Facebook\BatchRequest`](reference/BatchRequest.md) | An entity that represents an HTTP batch request to be sent to Graph. |
34+
| [`Facebook\BatchResponse`](reference/BatchResponse.md) | An entity that represents an HTTP response from Graph after sending a batch request. |
35+
| [`Facebook\Client`](reference/Client.md) | A service object that sends HTTP requests and receives HTTP responses to and from the Graph API. |
3636

3737

3838
# Signed Requests
@@ -41,9 +41,9 @@ Classes to help obtain and manage signed requests.
4141

4242
| Class name | Description |
4343
| ------------- | ------------- |
44-
| [`Facebook\Helper\FacebookJavaScriptHelper`](reference/FacebookJavaScriptHelper.md) | Used to obtain an access token or signed request from the cookie set by the JavaScript SDK. |
45-
| [`Facebook\Helper\FacebookCanvasHelper`](reference/FacebookCanvasHelper.md) | Used to obtain an access token or signed request from within the context of an app canvas. |
46-
| [`Facebook\Helper\FacebookPageTabHelper`](reference/FacebookPageTabHelper.md) | Used to obtain an access token or signed request from within the context of a page tab. |
44+
| [`Facebook\Helper\JavaScriptHelper`](reference/JavaScriptHelper.md) | Used to obtain an access token or signed request from the cookie set by the JavaScript SDK. |
45+
| [`Facebook\Helper\CanvasHelper`](reference/CanvasHelper.md) | Used to obtain an access token or signed request from within the context of an app canvas. |
46+
| [`Facebook\Helper\PageTabHelper`](reference/PageTabHelper.md) | Used to obtain an access token or signed request from within the context of a page tab. |
4747
| [`Facebook\SignedRequest`](reference/SignedRequest.md) | An entity that represents a signed request. |
4848

4949
# Core Exceptions
@@ -52,8 +52,8 @@ These are the core exceptions that the SDK will throw when an error occurs.
5252

5353
| Class name | Description |
5454
| ------------- | ------------- |
55-
| [`Facebook\Exception\FacebookSDKException`](reference/FacebookSDKException.md) | The base exception to all exceptions thrown by the SDK. Thrown when there is a non-Graph-response-related error. |
56-
| [`Facebook\Exception\FacebookResponseException`](reference/FacebookResponseException.md) | The base exception to all Graph error responses. This exception is never thrown directly. |
55+
| [`Facebook\Exception\SDKException`](reference/SDKException.md) | The base exception to all exceptions thrown by the SDK. Thrown when there is a non-Graph-response-related error. |
56+
| [`Facebook\Exception\ResponseException`](reference/ResponseException.md) | The base exception to all Graph error responses. This exception is never thrown directly. |
5757

5858

5959
# Graph Nodes and Edges
@@ -78,8 +78,8 @@ These are entities that represent files to be uploaded with a Graph request.
7878

7979
| Class name | Description |
8080
| ------------- | ------------- |
81-
| [`Facebook\FileUpload\FacebookFile`](reference/FacebookFile.md) | Represents a generic file to be uploaded to the Graph API. |
82-
| [`Facebook\FileUpload\FacebookVideo`](reference/FacebookVideo.md) | Represents a video file to be uploaded to the Graph API. |
81+
| [`Facebook\FileUpload\File`](reference/File.md) | Represents a generic file to be uploaded to the Graph API. |
82+
| [`Facebook\FileUpload\Video`](reference/Video.md) | Represents a video file to be uploaded to the Graph API. |
8383

8484
# Extensibility
8585

0 commit comments

Comments
 (0)