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

Fixed several typos and grammar errors #1088

Merged
merged 1 commit into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions doc/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Returns an array of watched repos.

> *** Requires [authentication](security.md). ***

### Get repos that a authenticated user has starred
### Get repos that an authenticated user has starred

```php
$activity = $client->api('current_user')->starring()->all();
Expand All @@ -38,7 +38,7 @@ $activity = $client->api('user')->events('ornicar');
```
Returns an array of private and public events created for all repos related to the user.

### Get repos that a authenticated user has starred with creation date
### Get repos that an authenticated user has starred with creation date

Support for getting the star creation timestamp in the response, using the custom `Accept: application/vnd.github.v3.star+json` header.

Expand Down Expand Up @@ -75,7 +75,7 @@ $activity = $client->api('current_user')->starring()->unstar($owner, $repo);
Throws an Exception in case of failure or NULL in case of success.


### Get repos that a authenticated user is watching
### Get repos that an authenticated user is watching

```php
$activity = $client->api('current_user')->watchers()->all();
Expand Down
2 changes: 1 addition & 1 deletion doc/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ $client->removeCache();
```

Using cache, the client will get cached responses if resources haven't changed since last time,
**without** reaching the `X-Rate-Limit` [imposed by github](http://developer.github.com/v3/#rate-limiting).
**without** reaching the `X-Rate-Limit` [imposed by GitHub](http://developer.github.com/v3/#rate-limiting).

2 changes: 1 addition & 1 deletion doc/currentuser/publickeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $key = $client->me()->keys()->show(1234);
$key = $client->me()->keys()->create(array('title' => 'key title', 'key' => 12345));
```

Adds a key with title 'key title' to the authenticated user and returns a the created key for the user.
Adds a key with title 'key title' to the authenticated user and returns the created key for the user.

### Remove a public key from the authenticated user.

Expand Down
2 changes: 1 addition & 1 deletion doc/customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To use the symfony http client
composer require symfony/http-client nyholm/psr7
```

To set up the github client with this http client
To set up the GitHub client with this http client

```php
use Github\Client;
Expand Down
2 changes: 1 addition & 1 deletion doc/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $rateLimits = $client->api('graphql')->execute($query);

#### Authentication

To use [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/) requests must [authenticated](security.md).
To use [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/) requests must [authenticate](security.md).

```php
$client->authenticate($token, null, Github\AuthMethod::ACCESS_TOKEN);
Expand Down
4 changes: 2 additions & 2 deletions doc/project/projects.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Repo / Projects API
[Back to the "Repos API"](../) | [Back to the navigation](../README.md)

This api is currently only available to developers in Early Access. To access the API during the Early Access period,
This api is currently only available to developers in Early Access. To access the API during the Early Access period,
you must provide a custom media type in the Accept header.

Both repositories and organisations have projects. The api is only different for gettings all or a single project.
Both repositories and organisations have projects. The api is only different for getting all or a single project.
All the example use the repository projects api but this also works form the organization api (`$client->api('org_projects')`)

```php
Expand Down
2 changes: 1 addition & 1 deletion doc/pull_request/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $comment = $client->api('pull_request')->comments()->update('KnpLabs', 'php-gith

This returns the details of the updated comment.

### Remove a review comment from an pull request
### Remove a review comment from a pull request

> Requires [authentication](../security.md).

Expand Down
2 changes: 1 addition & 1 deletion doc/repo/hooks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Repo / Hooks API
[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md)

For extended info see the [Github documentation](https://docs.github.com/en/rest/reference/repos#webhooks)
For extended info see the [GitHub documentation](https://docs.github.com/en/rest/reference/repos#webhooks)

### List repository webhooks

Expand Down
6 changes: 3 additions & 3 deletions doc/repos.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ $activity = $client->api('repo')->activity('ornicar', 'php-github-api');
Returns an array of commit activity group by week.

### `Moved` repositories
Github repositories can be moved to another org/user, but it remains the `id`.
In case if you can't no more find repo, you can retrieve it by `id`:
GitHub repositories can be moved to another org/user, but it remains the `id`.
In case you can't find the repo anymore, you can retrieve it by `id`:

```php
use Github\HttpClient\Message\ResponseMediator;
Expand Down Expand Up @@ -365,7 +365,7 @@ $repo = $client->api('repo')->transfer('KnpLabs', 'php-github-api', 'github', [1

### Create a repository dispatch event

Example when you want to configure custom github action workflows.
Example when you want to configure custom GitHub action workflows.

```php
$client->api('repo')->dispatch('KnpLabs', 'php-github-api', 'acme-event', ['foo'=>'bar']);
Expand Down
2 changes: 1 addition & 1 deletion doc/request_response_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

### Get response headers

Get the repsonse header for the latest request
Get the response header for the latest request

```
$headers = $githubClient->getLastResponse()->getHeaders();
Expand Down
4 changes: 2 additions & 2 deletions doc/result_pager.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

### Usage examples

#### Get all repositories of a organization
#### Get all repositories of an organization

```php
$client = new Github\Client();
Expand All @@ -21,7 +21,7 @@ Parameters of the `fetchAll` method:
* The method of the API object you're using
* The parameters of the method

Parameters are passed to the API method via [call_user_func_array](https://www.php.net/manual/en/function.call-user-func-array.php).
Parameters are passed to the API method via [call_user_func_array](https://www.php.net/manual/en/function.call-user-func-array.php).

```php
$parameters = array('github', 'all', 1); // $organization, $type, $page
Expand Down
4 changes: 2 additions & 2 deletions doc/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ further requests are done as the given user.
### Authenticating as an Integration

To authenticate as an integration you need to supply a JSON Web Token with `Github\AuthMethod::JWT` to request
and installation access token which is then usable with `Github\AuthMethod::ACCESS_TOKEN`. [Github´s integration
and installation access token which is then usable with `Github\AuthMethod::ACCESS_TOKEN`. [GitHub´s integration
authentication docs](https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/#authenticating-as-a-github-app) describe the flow in detail.
It´s important for integration requests to use the custom Accept header `application/vnd.github.machine-man-preview`.

Expand Down Expand Up @@ -67,5 +67,5 @@ $jwt = $config->builder(ChainedFormatter::withUnixTimestampDates())
$github->authenticate($jwt->toString(), null, Github\AuthMethod::JWT);
```

The `$integrationId` you can find in the about section of your github app.
The `$integrationId` you can find in the about section of your GitHub app.
The `$installationId` you can find by installing the app and using the id in the url.
24 changes: 12 additions & 12 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Run Test Suite

The code is unit tested, there are also some functional tests. To run tests on
The code is unit tested, there are also some functional tests. To run tests on
your machine, from a CLI, run

```bash
Expand All @@ -14,12 +14,12 @@ $ phpunit

### Write tests

It is always great if someone wants to contribute and extend the functionality of
the API client. But all new features must be properly tested. To test a new API
function, one should test its communication with the HTTP client. The code should
never make an actual call to Github. Testing could easily be done with mocking.
It is always great if someone wants to contribute and extend the functionality of
the API client. But all new features must be properly tested. To test a new API
function, one should test its communication with the HTTP client. The code should
never make an actual call to GitHub. Testing could easily be done with mocking.

If you want to write test for the function that shows you comments to a gist.
If you want to write test for the function that shows you comments to a gist.

```php
class Comments extends AbstractApi
Expand All @@ -32,7 +32,7 @@ class Comments extends AbstractApi
}
```

The test will look like this:
The test will look like this:

```php
use Github\Tests\Api\TestCase;
Expand All @@ -51,22 +51,22 @@ class CommentsTest extends TestCase

// Get the API mock (see "getApiClass" below).
$api = $this->getApiMock();

$api->expects($this->once()) // Expect one call
->method('get') // A GET request
->with('/gists/123/comments/456') // URI should be "/gists/123/comments/456"
->will($this->returnValue($expectedValue)); // Should return the "Server response"

// Call Comments::show
$result = $api->show(123, 456);
// Verify that the result is the "Server response" as we expect.

// Verify that the result is the "Server response" as we expect.
$this->assertEquals($expectedValue, $result);
}

protected function getApiClass()
{
// Tell the "getAPIMock" what class to mock.
// Tell the "getAPIMock" what class to mock.
return \Github\Api\Gist\Comments::class;
}
}
Expand Down
2 changes: 1 addition & 1 deletion doc/two_factor_authentication.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Two factor authentication
## Two-factor authentication
[Back to the navigation](README.md)


Expand Down
2 changes: 1 addition & 1 deletion doc/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $user = $client->api('user')->show('KnpLabs');
Returns an array of information about the user.


You can also use the User ID, but it will use an undocumented Github API
You can also use the User ID, but it will use an undocumented GitHub API

```php
$user = $client->api('user')->showById(202732);
Expand Down