Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 2.25 KB

CONTRIBUTING.md

File metadata and controls

60 lines (41 loc) · 2.25 KB

Contributing

First of all, thank you for contributing, you are awesome!

Here are a few rules to follow in order to ease code reviews, and discussions before maintainers accept and merge your work.

You MUST run the quality & test suites.

You SHOULD write (or update) unit tests.

You SHOULD write documentation.

Please, write commit messages that make sense, and rebase your branch before submitting your Pull Request.

One may ask you to squash your commits too. This is used to "clean" your Pull Request before merging it (we don't want commits such as fix tests, fix 2, fix 3, etc.).

Thank you!

Running the quality & test suites

Tests suite uses Docker environments in order to be idempotent to OS's. More than this PHP version is written inside the Dockerfile; this assures to test the bundle with the same resources. No need to have PHP installed.

You only need Docker set it up.

To allow testing environments more smooth we implemented Makefile. You have two commands available:

make quality
make tests

PHP version

The bundle supports PHP 8.2 and later: do not use a syntax introduced by a later version (typed class constants, property hooks, pipe operator...). The functions of PHP 8.3 to 8.5 (json_validate(), array_find(), array_any(), mb_trim(), array_first()...) can be used: they are provided by the required symfony/polyfill-php83, symfony/polyfill-php84 and symfony/polyfill-php85 packages on the older versions. Rector (make quality) is configured accordingly.

Deprecations notices

When a feature should be deprecated, or when you have a breaking change for a future version, please :

  • Fill an issue
  • Add TODO comments with the following format: @TODO deprecated v2.0
  • Trigger a deprecation error: @trigger_error('This feature will be deprecated in v2.0', E_USER_DEPRECATED);

You can check which deprecation notice is triggered in tests

  • make bash
  • SYMFONY_DEPRECATIONS_HELPER=0 ./vendor/bin/phpunit