From 92e683afc9d9e9305e4058f09dcca06a22e65a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Dartigues?= Date: Tue, 25 Oct 2022 11:37:11 +0545 Subject: [PATCH 1/2] Create authorization removed Create authorization deprecated and removed in V3. https://github.com/KnpLabs/php-github-api/commit/2fe12b82a7fe5896ae4f067d4c62326c4041602f --- doc/authorizations.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/doc/authorizations.md b/doc/authorizations.md index 2865fd63e19..b037e402c27 100644 --- a/doc/authorizations.md +++ b/doc/authorizations.md @@ -15,18 +15,6 @@ $authorizations = $github->api('authorizations')->all(); $authorization = $github->api('authorizations')->show(1); ``` -#### Create an authorization - -```php -$data = array( - 'note' => 'This is an optional description' -); - -$authorization = $github->api('authorizations')->create($data); -``` - -Creates and returns an authorization. - #### Update an authorization You can update ``note``. From cbac8bf36f2e2b0c56774d3daae3c2b68bdedf98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Dartigues?= Date: Tue, 25 Oct 2022 11:39:01 +0545 Subject: [PATCH 2/2] Delete two_factor_authentication.md Create authorization deprecated and removed in V3. https://github.com/KnpLabs/php-github-api/commit/2fe12b82a7fe5896ae4f067d4c62326c4041602f --- doc/two_factor_authentication.md | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 doc/two_factor_authentication.md diff --git a/doc/two_factor_authentication.md b/doc/two_factor_authentication.md deleted file mode 100644 index 3b58de49abc..00000000000 --- a/doc/two_factor_authentication.md +++ /dev/null @@ -1,19 +0,0 @@ -## Two-factor authentication -[Back to the navigation](README.md) - - -### Raising the exception - -```php -try { - $authorization = $github->api('authorizations')->create(); -} catch (Github\Exception\TwoFactorAuthenticationRequiredException $e) { - echo sprintf("Two factor authentication of type %s is required.", $e->getType()); -} -``` - -Once the code has been retrieved (by sms for example), you can create an authorization: - -``` -$authorization = $github->api('authorizations')->create(array('note' => 'Optional'), $code); -```