Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove documentation for cURL support #112

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This documentation is for developers interested in using the GOV.UK Notify PHP c

## Set up the client

The Notify PHP Client is based on a [PSR-7 HTTP model](https://www.php-fig.org/psr/psr-7/) [external link]. To install it, you must select your preferred HTTP client. You can follow these instructions to use [Guzzle v6 and v5](http://docs.guzzlephp.org/en/stable/) and [cURL](http://php.net/manual/en/book.curl.php) [external links].
The Notify PHP Client is based on a [PSR-7 HTTP model](https://www.php-fig.org/psr/psr-7/) [external link]. To install it, you must select your preferred PSR-7 compatible HTTP client. You can follow these instructions to use [Guzzle v6 and v5](http://docs.guzzlephp.org/en/stable/)[external link].

### Guzzle v6

Expand Down Expand Up @@ -53,31 +53,6 @@ To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.

To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation.

### cURL

1. Use [Composer](https://getcomposer.org/) [external link] to install the GOV.UK Notify PHP client. Run the following in the command line:

```sh
composer require php-http/curl-client php-http/message alphagov/notifications-php-client
```

You can now use the [autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading) [external link] to download the GOV.UK Notify PHP client.

1. Add the following code to your application to create a new instance of the client:

```
$notifyClient = new \Alphagov\Notifications\Client([
'apiKey' => '{your api key}',
'httpClient' => new \Http\Client\Curl\Client(
new \Http\Message\MessageFactory\GuzzleMessageFactory,
new \Http\Message\StreamFactory\GuzzleStreamFactory
),
]);
```

1. Run `$notifyClient` to access the GOV.UK Notify API.

To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation.

## Send a message

Expand Down