Skip to content
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
33 changes: 33 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 12 additions & 4 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Loading