Skip to content

Commit ad20f47

Browse files
nayafiaSammyK
nayafia
authored andcommitted
add syntax highlighting
1 parent fc9cfa1 commit ad20f47

33 files changed

+290
-290
lines changed

Diff for: docs/examples/access_token_from_canvas.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This example covers obtaining an access token and signed request from within the
66

77
A signed request will be sent to your app via the HTTP POST method within the context of app canvas. The PHP SDK provides a helper to easily obtain, validate & decode the signed request. If the proper OAuth data exists in the signed request payload data, an attempt can be made to obtain an access token from the Graph API.
88

9-
```
9+
```php
1010
$fb = new Facebook\Facebook([
1111
'app_id' => '{app-id}',
1212
'app_secret' => '{app-secret}',

Diff for: docs/examples/access_token_from_javascript.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This example covers obtaining an access token and signed request from the Facebo
66

77
In order to have the JavaScript SDK set a cookie containing a signed request (which contains information about the logged in user), you must first initialize the JavaScript SDK with the `{cookie: true}` option.
88

9-
```
9+
```php
1010
<html>
1111
<body>
1212

@@ -47,7 +47,7 @@ In order to have the JavaScript SDK set a cookie containing a signed request (wh
4747

4848
After the user successfully logs in, redirect the user (or make an AJAX request) to a PHP script that obtains an access token from the signed request that exists in the cookie.
4949

50-
```
50+
```php
5151
# /js-login.php
5252
$fb = new Facebook\Facebook([
5353
'app_id' => '{app-id}',

Diff for: docs/examples/access_token_from_page_tab.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This example covers obtaining an access token and signed request from within the
66

77
Page tabs behave much like the app canvas. The PHP SDK provides a helper for page tabs that delivers specific methods unique to page tabs.
88

9-
```
9+
```php
1010
$fb = new Facebook\Facebook([
1111
'app_id' => '{app-id}',
1212
'app_secret' => '{app-secret}',

Diff for: docs/examples/batch_request.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This example covers sending a batch request with the Facebook SDK for PHP.
66

77
The following example assumes we have the following permissions granted from the user: `user_likes`, `user_events`, `user_photos`, `publish_actions`. The example makes use of [JSONPath to reference specific batch operations](https://developers.facebook.com/docs/graph-api/making-multiple-requests/#operations).
88

9-
```
9+
```php
1010
$fb = new Facebook\Facebook([
1111
'app_id' => '{app-id}',
1212
'app_secret' => '{app-secret}',
@@ -86,7 +86,7 @@ There five requests being made in this batch requests.
8686

8787
If the request was successful, the user should have a new status update similar to this:
8888

89-
```
89+
```php
9090
My name is Foo User.
9191

9292
I like this page: Facebook Developers.
@@ -103,7 +103,7 @@ It should also contain a response containing two photos from the user.
103103

104104
Since the requests sent in a batch are unrelated by default, we can make requests on behalf of multiple users and pages in the same batch request.
105105

106-
```
106+
```php
107107
$fb = new Facebook\Facebook([
108108
'app_id' => '{app-id}',
109109
'app_secret' => '{app-secret}',

Diff for: docs/examples/batch_upload.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Graph API supports [file uploads in batch requests](https://developers.faceb
88

99
The following example will upload two photos and one video.
1010

11-
```
11+
```php
1212
$fb = new Facebook\Facebook([
1313
'app_id' => '{app-id}',
1414
'app_secret' => '{app-secret}',

Diff for: docs/examples/facebook_login.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In this example, the PHP script that generates the login link is called `/login.
1010

1111
## /login.php
1212

13-
```
13+
```php
1414
$fb = new Facebook\Facebook([
1515
'app_id' => '{app-id}',
1616
'app_secret' => '{app-secret}',
@@ -27,7 +27,7 @@ echo '<a href="' . $loginUrl . '">Log in with Facebook!</a>';
2727

2828
## /fb-callback.php
2929

30-
```
30+
```php
3131
$fb = new Facebook\Facebook([
3232
'app_id' => '{app-id}',
3333
'app_secret' => '{app-secret}',

Diff for: docs/examples/pagination_basic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Graph API supports [several methods to paginate over response data](https://
88

99
In this example we'll pull five entries from a user's feed (assuming the user approved the `read_stream` permission for your app). Then we'll use the `next()` method to grab the next page of results. Naturally you'd provide some sort of pagination navigation in your app, but this is just an example to get you started.
1010

11-
```
11+
```php
1212
$fb = new Facebook\Facebook([
1313
'app_id' => '{app-id}',
1414
'app_secret' => '{app-secret}',

Diff for: docs/examples/post_links.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For more information, see the documentation for [`Facebook\Facebook`](../referen
88

99
## Example
1010

11-
```
11+
```php
1212
$fb = new Facebook\Facebook([
1313
'app_id' => '{app-id}',
1414
'app_secret' => '{app-secret}',

Diff for: docs/examples/retrieve_user_profile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For more information, see the documentation for [`Facebook\Facebook`](../referen
88

99
## Example
1010

11-
```
11+
```php
1212
$fb = new Facebook\Facebook([
1313
'app_id' => '{app-id}',
1414
'app_secret' => '{app-secret}',

Diff for: docs/examples/upload_photo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For more information, see the documentation for [`Facebook\Facebook`](../referen
88

99
## Example
1010

11-
```
11+
```php
1212
$fb = new Facebook\Facebook([
1313
'app_id' => '{app-id}',
1414
'app_secret' => '{app-secret}',

Diff for: docs/examples/upload_video.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This example covers uploading & posting a video to a user's timeline with the Fa
99
1010
The following example will upload a video in chunks using the [resumable upload](https://developers.facebook.com/docs/graph-api/video-uploads#resumable) feature added in Graph v2.3.
1111

12-
```
12+
```php
1313
$fb = new Facebook\Facebook([
1414
'app_id' => '{app-id}',
1515
'app_secret' => '{app-secret}',
@@ -40,7 +40,7 @@ See more about the [`uploadVideo()` method](..reference/Facebook.md#uploadvideo)
4040

4141
For versions of Graph before v2.3, videos had to be uploaded in one request.
4242

43-
```
43+
```php
4444
$fb = new Facebook\Facebook([/* . . . */]);
4545

4646
$data = [

Diff for: docs/reference/AccessToken.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@ Requests to the Graph API need to have an access token sent with them to identif
77
Whenever you use the PHP SDK to obtain an access token, the access token will be returned as an instance of `AccessToken`. The `AccessToken` entity contains a number of methods that make it easier to handle access tokens.
88

99
### getValue()
10-
```
10+
```php
1111
public string getValue()
1212
```
1313
Returns the access token as a string. The `AccessToken` entity also makes use of the [magic method `__toString()`](http://php.net/manual/en/language.oop5.magic.php#object.tostring) so you can cast an `AccessToken` entity to a string with: `$token = (string) $accessTokenEntity;`
1414

1515
### getExpiresAt()
16-
```
16+
```php
1717
public \DateTime|null getExpiresAt()
1818
```
1919
If the expiration date was provided when the `AccessToken` entity was instantiated, the `getExpiresAt()` method will return the access token expiration date as a [`DateTime` entity](http://php.net/manual/en/class.datetime.php). If the expiration date was not originally provided, the method will return `null`.
2020

2121
### isExpired()
22-
```
22+
```php
2323
public boolean|null isExpired()
2424
```
2525
If the expiration date was provided when the `AccessToken` entity was instantiated, the `isExpired()` method will return `true` if the access token has expired. If the access token is still active, the method will return `false`. If the expiration date was not
2626
originally provided, the method will return `null`.
2727

2828
### isLongLived()
29-
```
29+
```php
3030
public boolean|null isLongLived()
3131
```
3232
If the expiration date was provided when the `AccessToken` entity was instantiated, the `isLongLived()` method will return `true` if the access token is long-lived. If the token is short-lived, the method will return `false`. If the expiration date was not
3333
originally provided, the method will return `false`. [See more about long-lived and short-lived access tokens](https://developers.facebook.com/docs/facebook-login/access-tokens#extending).
3434

3535
### isAppAccessToken()
36-
```
36+
```php
3737
public boolean isAppAccessToken()
3838
```
3939
Since app access tokens contain the app secret in plain-text, it's very important that app access tokens aren't used in client-side contexts where someone might be able to grab the app secret. For this reason you should do a check on the access token to ensure it is not an app access token before using it on the client-side. The `isAppAccessToken()` will return `true` if the access token is an app access token and `false` if it is not.
4040

4141
### getAppSecretProof()
42-
```
42+
```php
4343
public string getAppSecretProof(string $appSecret)
4444
```
4545
For better security, all requests to the Graph API should be [signed with an app secret proof](https://developers.facebook.com/docs/graph-api/securing-requests#appsecret_proof) and your app settings should enable the app secret proof requirement for all requests. The PHP SDK will generate the app secret proof for each request automatically, but if you need to generate one, pass your app secret to the `getAppSecretProof()` method and it will return the HMAC hash that is the app secret proof.
@@ -50,7 +50,7 @@ If you already have an access token in the form of a string (from a session or d
5050

5151
You can optionally pass an expiration date in the form of timestamp as the second argument.
5252

53-
```
53+
```php
5454
$expires = time() + 60 * 60 * 2;
5555
$accessToken = new Facebook\Authentication\AccessToken('{example-access-token}', $expires);
5656
```

Diff for: docs/reference/Birthday.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `Facebook\GraphNodes\Birthday` entity extends `DateTime` so `format` may be
1616

1717
Usage:
1818

19-
```
19+
```php
2020
$fb = new Facebook\Facebook(\* *\);
2121
// Returns a `Facebook\FacebookResponse` object
2222
$response = $fb->get('/me');
@@ -43,13 +43,13 @@ var_dump($birthday->format('m/d'));
4343
## Instance Methods
4444

4545
### hasDate()
46-
```
46+
```php
4747
public boolean hasDate()
4848
```
4949
Returns whether or not the birthday object contains the day and month of birth.
5050

5151
### hasYear()
52-
```
52+
```php
5353
public boolean hasYear()
5454
```
5555
Returns whether or not the birthday object contains the year of birth.

0 commit comments

Comments
 (0)