Skip to content

Commit

Permalink
Removed "Facebook" prefix form all classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Dec 5, 2017
1 parent 3fc95e5 commit 2d6f192
Show file tree
Hide file tree
Showing 134 changed files with 1,264 additions and 1,287 deletions.
34 changes: 34 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
$config = PhpCsFixer\Config::create()
->setRiskyAllowed(false)
->setRules([
'@Symfony' => false,
'align_multiline_comment' => true,
'combine_consecutive_unsets' => true,
// one should use PHPUnit methods to set up expected exception instead of annotations
'heredoc_to_nowdoc' => true,
'no_null_property_initialization' => true,
'no_useless_else' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_types_order' => true,
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_summary' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'phpdoc_annotation_without_dot' => true,
'no_empty_comment' => true,
'no_trailing_whitespace_in_comment' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
)
;
return $config;
4 changes: 2 additions & 2 deletions docs/examples/access_token_from_canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ $helper = $fb->getCanvasHelper();

try {
$accessToken = $helper->getAccessToken();
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/access_token_from_javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ $helper = $fb->getJavaScriptHelper();

try {
$accessToken = $helper->getAccessToken();
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/access_token_from_page_tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ $helper = $fb->getPageTabHelper();

try {
$accessToken = $helper->getAccessToken();
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/batch_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ echo '<h1>Make a batch request</h1>' . "\n\n";

try {
$responses = $fb->sendBatchRequest($batch);
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down Expand Up @@ -118,11 +118,11 @@ $batch = [

try {
$responses = $fb->sendBatchRequest($batch);
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/batch_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ $batch = [

try {
$responses = $fb->sendBatchRequest($batch);
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/facebook_login.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ $helper = $fb->getRedirectLoginHelper();

try {
$accessToken = $helper->getAccessToken();
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down Expand Up @@ -84,7 +84,7 @@ if (! $accessToken->isLongLived()) {
// Exchanges a short-lived access token for a long-lived one
try {
$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
} catch (Facebook\Exception\FacebookSDKException $e) {
} catch (Facebook\Exception\SDKException $e) {
echo "<p>Error getting long-lived access token: " . $e->getMessage() . "</p>\n\n";
exit;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/pagination_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ $fb = new Facebook\Facebook([
try {
// Requires the "read_stream" permission
$response = $fb->get('/me/feed?fields=id,message&limit=5');
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/post_links.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example covers posting a link to the current user's timeline using the Grap

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.

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).
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).

## Example

Expand All @@ -21,12 +21,12 @@ $linkData = [
];

try {
// Returns a `Facebook\FacebookResponse` object
// Returns a `Facebook\Response` object
$response = $fb->post('/me/feed', $linkData, '{access-token}');
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/retrieve_user_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example covers getting profile information for the current user and printin

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

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).
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).

## Example

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

try {
// Returns a `Facebook\FacebookResponse` object
// Returns a `Facebook\Response` object
$response = $fb->get('/me?fields=id,name', '{access-token}');
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/upload_photo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example covers uploading a photo to the current User's profile using the Gr

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.

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).
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).

## Example

Expand All @@ -21,12 +21,12 @@ $data = [
];

try {
// Returns a `Facebook\FacebookResponse` object
// Returns a `Facebook\Response` object
$response = $fb->post('/me/photos', $data, '{access-token}');
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/upload_video.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ $data = [

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

try {
$response = $fb->post('/me/videos', $data, 'user-access-token');
} catch(Facebook\Exception\FacebookResponseException $e) {
} catch(Facebook\Exception\ResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exception\FacebookSDKException $e) {
} catch(Facebook\Exception\SDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
Expand Down
28 changes: 14 additions & 14 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ These classes are at the core of the Facebook SDK for PHP.
| Class name | Description |
| ------------- | ------------- |
| [`Facebook\Facebook`](reference/Facebook.md) | The main service object that helps tie all the SDK components together. |
| [`Facebook\FacebookApp`](reference/FacebookApp.md) | An entity that represents a Facebook app and is required to send requests to Graph. |
| [`Facebook\Application`](reference/Application.md) | An entity that represents a Facebook app and is required to send requests to Graph. |

# Authentication

These classes facilitate authenticating a Facebook user with OAuth 2.0.

| Class name | Description |
| ------------- | ------------- |
| [`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. |
| [`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. |
| [`Facebook\Authentication\AccessToken`](reference/AccessToken.md) | An entity that represents an access token. |
| `Facebook\Authentication\AccessTokenMetadata` | An entity that represents metadata from an access token. |
| `Facebook\Authentication\OAuth2Client` | An OAuth 2.0 client that sends and receives HTTP requests related to user authentication. |
Expand All @@ -28,11 +28,11 @@ These classes are used in a Graph API request/response cycle.

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


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

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

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

| Class name | Description |
| ------------- | ------------- |
| [`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. |
| [`Facebook\Exception\FacebookResponseException`](reference/FacebookResponseException.md) | The base exception to all Graph error responses. This exception is never thrown directly. |
| [`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. |
| [`Facebook\Exception\ResponseException`](reference/ResponseException.md) | The base exception to all Graph error responses. This exception is never thrown directly. |


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

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

# Extensibility

Expand Down
Loading

0 comments on commit 2d6f192

Please sign in to comment.