Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit d1211de

Browse files
committed
Update docs to reflect default_graph_version as required option
1 parent 038a8e0 commit d1211de

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

docs/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ $fb = new Facebook\Facebook([
9393

9494
You'll need to replace the `{app-id}` and `{app-secret}` with your Facebook app's ID and secret which can be obtained from the [app settings tab](https://developers.facebook.com/apps).
9595

96-
> **Warning:** It's important that you specify a `default_graph_version` value as this will give you more control over which version of Graph you want to use. If you don't specify a `default_graph_version`, the SDK for PHP will choose one for you and it might not be one that is compatible with your app.
96+
> **Warning:** It's important that you specify a `default_graph_version` value as this will give you more control over which version of Graph you want to use. If you don't specify a `default_graph_version`, the SDK will throw an [`InvalidArgumentException`](http://php.net/invalidargumentexception). See more about [Graph API versions](https://developers.facebook.com/docs/apps/versions).
9797
9898
The `Facebook\Facebook` service ties all the components of the SDK for PHP together. [See the full reference for the `Facebook\Facebook` service](reference/Facebook.md).
9999

docs/reference/Facebook.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ $fb = new Facebook\Facebook([
5757
```
5858

5959
### `app_id`
60-
The ID of your Facebook app (required).
60+
**(Required)** The ID of your Facebook app. If not set, defaults to [the environment variables fallback](#environment-variables-fallback) if available.
6161

6262
### `app_secret`
63-
The secret of your Facebook app (required).
63+
**(Required)** The secret of your Facebook app. If not set, defaults to [the environment variables fallback](#environment-variables-fallback) if available.
64+
65+
### `default_graph_version`
66+
**(Required)** Allows you to set the default Graph version number. Set this as a string as it would appear in the Graph url, e.g. `v2.8`. See the [latest version of Graph](https://developers.facebook.com/docs/apps/changelog) for more info on Graph versions.
6467

6568
### `default_access_token`
6669
The default fallback access token to use if one is not explicitly provided. The value can be of type `string` or `Facebook\AccessToken`. If any other value is provided an `InvalidArgumentException` will be thrown. Defaults to `null`.
6770

6871
### `enable_beta_mode`
6972
Enable [beta mode](https://developers.facebook.com/docs/apps/beta-tier) so that request are made to the [https://graph.beta.facebook.com](https://graph.beta.facebook.com/) endpoint. Set to boolean `true` to enable or `false` to disable. Defaults to `false`.
7073

71-
### `default_graph_version`
72-
Allows you to overwrite the default Graph version number set in `Facebook\Facebook::DEFAULT_GRAPH_VERSION`. Set this as a string as it would appear in the Graph url, e.g. `v2.8`. Defaults to the [latest version of Graph](https://developers.facebook.com/docs/apps/changelog).
73-
7474
### `http_client_handler`
7575
Allows you to overwrite the default HTTP client.
7676

@@ -143,10 +143,12 @@ If any other value is provided an `InvalidArgumentException` will be thrown.
143143

144144
The only required configuration options are `app_id` and `app_secret`. However, the SDK will look to environment variables for the app ID and app secret.
145145

146-
To take advantage of this feature, simply set an environment variable named `FACEBOOK_APP_ID` with your Facebook app ID and set an environment variable named `FACEBOOK_APP_SECRET` with your Facebook app secret and you will be able to instantiate the `Facebook\Facebook` service without setting any configuration in the constructor.
146+
To take advantage of this feature, simply set an environment variable named `FACEBOOK_APP_ID` with your Facebook app ID and set an environment variable named `FACEBOOK_APP_SECRET` with your Facebook app secret and you will be able to instantiate the `Facebook\Facebook` service with only needing to specify the `default_graph_version` option.
147147

148148
```php
149-
$fb = new Facebook\Facebook();
149+
$fb = new Facebook\Facebook([
150+
'default_graph_version' => 'v2.8',
151+
]);
150152
```
151153

152154
# Instance Methods
@@ -208,7 +210,7 @@ This setting will overwrite the value from `default_access_token` option if it w
208210
```php
209211
public string getDefaultGraphVersion()
210212
```
211-
Returns the default version of Graph. If the `default_graph_version` configuration option was not set, this will default to `Facebook\Facebook::DEFAULT_GRAPH_VERSION`.
213+
Returns the default version of Graph set with the `default_graph_version` configuration option.
212214

213215
## get()
214216
```php

0 commit comments

Comments
 (0)