From 6054960fcdf603f8c0ed3f24b6d15c3d9bffa75b Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 25 Sep 2026 21:11:12 +0300 Subject: [PATCH] Add CONTRIBUTING.md --- .github/CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ docs/internals.md | 16 ++++++++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..ed00b974 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing + +Thank you for considering contributing to the `phptg/bot-api` library! + +## Reporting issues + +Bug reports and feature requests are welcome via [GitHub Issues](https://github.com/phptg/bot-api/issues). +Please include the library version, the PHP version, and a minimal snippet that reproduces the problem. +For questions and discussion, use the author's [Telegram chat](https://t.me/predvoditelev_chat). + +## Development setup + +Requirements: 64-bit PHP 8.2–8.5 and [Composer](https://getcomposer.org/download/). + +Fork the repository, clone it and run `composer install`. + +See [Internals](../docs/internals.md) for running tests, static analysis, code style and the other tools. + +## Rules + +- The library has **zero runtime dependencies** — nothing may be added to the `require` section of + `composer.json`. +- Backward compatibility is preserved as much as possible. A new method parameter is always added **last**, + with a default value, regardless of its position in the Telegram Bot API documentation. +- Tests live under `tests/`, mirroring the structure of `src/`. +- Every user-visible change needs a `CHANGELOG.md` entry under the topmost `under development` heading, in the + form `- New #123: Add SendMessage method.`, where `#123` is the pull request number. Use `New` for new features, + `Enh` for improvements, `Chg` for changes affecting existing usage, `Bug` for fixes. +- Update the documentation (`README.md`, `docs/`) when behavior or the public API changes. + +## Pull requests + +Keep pull requests focused on a single change and make sure all CI checks pass. diff --git a/docs/internals.md b/docs/internals.md index 4578b13e..f93cbed8 100644 --- a/docs/internals.md +++ b/docs/internals.md @@ -49,18 +49,26 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static ## Code style -Package used [PHP CS Fixer](https://cs.symfony.com/) to maintain [PER CS 2.0](https://www.php-fig.org/per/coding-style/) +Package used [PHP CS Fixer](https://cs.symfony.com/) to maintain [PER CS 3.0](https://www.php-fig.org/per/coding-style/) code style. To check and fix code style: ```shell composer cs-fix ``` +## Refactoring + +The code is refactored with [Rector](https://getrector.com/). To apply it: + +```shell +composer rector +``` + ## Dependencies -Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive -[Composer](https://getcomposer.org) dependencies: +Use [Composer Dependency Analyser](https://github.com/shipmonk-rnd/composer-dependency-analyser) to detect unused, +shadow and misplaced [Composer](https://getcomposer.org) dependencies: ```shell -./vendor/bin/composer-require-checker +composer dependency-analyser ```