Skip to content

Commit

Permalink
docs: update README and CONTRIBUTING and include helpful scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Dec 12, 2024
1 parent 0d9cfca commit 19bfb89
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 16 deletions.
34 changes: 28 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/oauth2-client).
We accept contributions via Pull Requests on [GitHub](https://github.com/thephpleague/oauth2-client).


## Developing

Before working on oauth2-client, install the dependencies by running the following from the root directory of your local git clone:

```bash
composer install
```


## Pull Requests

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
> [!TIP]
> Before opening a pull request, be sure to run our full test suite locally:
>
> ```bash
> composer test
> ```
- **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** - We follow a superset of PSR-12. The easiest way to apply the conventions is to run `composer cs-fix` before committing your work (be sure to visually inspect any changes the coding style fixer applies).
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
Expand All @@ -30,10 +46,16 @@ We accept contributions via Pull Requests on [Github](https://github.com/thephpl
The following tests must pass for a build to be considered successful. If contributing, please ensure these pass before submitting a pull request.
``` bash
$ ./vendor/bin/parallel-lint src test
$ ./vendor/bin/phpunit --coverage-text
$ ./vendor/bin/phpcs src --standard=psr2 -sp
```bash
./vendor/bin/parallel-lint src test
./vendor/bin/phpcs
./vendor/bin/phpunit
```
You can run them all at one time with:
```bash
composer test
```
**Happy coding**!
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This OAuth 2.0 client library will work with any OAuth 2.0 provider that conform

Many service providers provide additional functionality above and beyond the OAuth 2.0 specification. For this reason, you may extend and wrap this library to support additional behavior. There are already many [official](https://oauth2-client.thephpleague.com/providers/league/) and [third-party](https://oauth2-client.thephpleague.com/providers/thirdparty/) provider clients available (e.g., Facebook, GitHub, Google, Instagram, LinkedIn, etc.). If your provider isn't in the list, feel free to add it.

This package is compliant with [PSR-1][], [PSR-2][], [PSR-4][], and [PSR-7][]. If you notice compliance oversights, please send a patch via pull request. If you're interested in contributing to this library, please take a look at our [contributing guidelines](https://github.com/thephpleague/oauth2-client/blob/master/CONTRIBUTING.md).
This package is compliant with [PSR-4][], [PSR-7][], [PSR-12][], [PSR-17][], and [PSR-18][]. If you notice compliance oversights, please send a patch via pull request. If you're interested in contributing to this library, please take a look at our [contributing guidelines](https://github.com/thephpleague/oauth2-client/blob/master/CONTRIBUTING.md).

## Requirements

Expand All @@ -28,11 +28,6 @@ We support the following versions of PHP:
* PHP 8.3
* PHP 8.2
* PHP 8.1
* PHP 8.0
* PHP 7.4
* PHP 7.3
* PHP 7.2
* PHP 7.1

## Provider Clients

Expand All @@ -53,7 +48,8 @@ Please see [our contributing guidelines](https://github.com/thephpleague/oauth2-
The MIT License (MIT). Please see [LICENSE](https://github.com/thephpleague/oauth2-client/blob/master/LICENSE) for more information.


[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
[PSR-7]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md
[PSR-4]: https://www.php-fig.org/psr/psr-4/
[PSR-7]: https://www.php-fig.org/psr/psr-7/
[PSR-12]: https://www.php-fig.org/psr/psr-12/
[PSR-17]: https://www.php-fig.org/psr/psr-17/
[PSR-18]: https://www.php-fig.org/psr/psr-18/
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,21 @@
"psr-4": {
"League\\OAuth2\\Client\\Test\\": "test/src/"
}
},
"scripts": {
"cs": "phpcs",
"cs-fix": "phpcbf",
"lint": "parallel-lint src test",
"test": [
"@lint",
"@cs",
"phpunit --no-coverage"
]
},
"scripts-descriptions": {
"cs": "Check for coding style errors.",
"cs-fix": "Check and automatically fix any fixable coding style errors.",
"lint": "Check source code for syntax errors.",
"test": "Run the full test suite."
}
}

0 comments on commit 19bfb89

Please sign in to comment.