Contributions are welcome. This project accepts pull requests on GitHub.
This project adheres to a code of conduct. By participating in this project and its community, you are expected to uphold this code.
You can find help and discussion in the following places:
- GitHub Issues: https://github.com/php-ecma-intl/ext/issues
Report bugs using the project's issue tracker.
When submitting a bug report, please include enough information to reproduce the bug. A good bug report includes the following sections:
-
Description
Provide a short and clear description of the bug.
-
Steps to reproduce
Provide steps to reproduce the behavior you are experiencing. Please try to keep this as short as possible. If able, create a reproducible script outside of any framework you are using. This will help us to quickly debug the issue.
-
Expected behavior
Provide a short and clear description of what you expect to happen.
-
Screenshots or output
If applicable, add screenshots or program output to help explain your problem.
-
Environment details
Provide details about the system where you're using this package, such as PHP version and operating system.
-
Additional context
Provide any additional context that may help us debug the problem.
This project welcomes pull requests to fix bugs!
If you see a bug report that you'd like to fix, please feel free to do so. Following the directions and guidelines described in the "Adding New Features" section below, you may create bugfix branches and send pull requests.
If you have an idea for a new feature, it's a good idea to check out the issues or active pull requests first to see if anyone is already working on the feature. If not, feel free to submit an issue first, asking whether the feature is beneficial to the project. This will save you from doing a lot of development work only to have your feature rejected. We don't enjoy rejecting your hard work, but some features don't fit with the goals of the project.
When you do begin working on your feature, here are some guidelines to consider:
- Your pull request description should clearly detail the changes you have made. We will use this description to update the CHANGELOG. If there is no description, or it does not adequately describe your feature, we may ask you to update the description.
- pecl/ecma_intl uses
.clang-format
and.clang-tidy
rules to keep the code style consistent. Your IDE might be able to detect these and use them. Be sure to exclude files matching the pattern^.*arginfo\\.h$
. These are auto-generated. - Please write tests for any new features you add.
- Please ensure that tests pass before submitting your pull request.
pecl/ecma_intl automatically runs tests for pull requests. However,
running the tests locally will help save time. Hint: run
composer test
. - Use topic/feature branches. Please do not ask to pull from your main branch.
- For more information, see "Understanding the GitHub flow."
- Submit one feature per pull request. If you have multiple features you wish to submit, please break them into separate pull requests.
- Write good commit messages. This project follows the
Conventional Commits specification and uses Git hooks to ensure all
commits follow this standard. Running
composer install
will set up the Git hooks, so when you rungit commit
, you'll be prompted to create a commit using the Conventional Commits rules.
To develop this project, you will need PHP 8.2 or greater, Composer, and many of the build tools listed in resources/docker/Dockerfile. Optionally, you may use this Dockerfile to build and run a container locally for development.
After cloning this repository locally, execute the following commands:
cd /path/to/repository
composer install
To use Docker for development, you may run:
composer dev:docker:run
This will build and run a Docker container and place you in a shell for that container.
Run the following to build pecl/ecma_intl:
composer build
Note
Behind the scenes, this runs:
make clean phpize ./configure --enable-ecma_intl --enable-criterion make -j$(nproc) dev
If libicu is not in a standard location on your system, you will need to set
PKG_CONFIG_PATH=/path/to/icu4c/lib/pkgconfig
before running the configure command.
To run the full suite of tests (unit tests, PHPT tests, and ECMA-402 conformance tests):
composer test
Note
Behind the scenes, this runs:
php run-tests.php -q --show-diff --color -n -d extension="$PWD/modules/ecma_intl.so" make -j$(nproc) criterion php -d extension="$PWD/modules/ecma_intl.so" vendor/bin/pest
This project uses CaptainHook to validate all staged changes prior to commit.
To see all the commands available for contributing to this project:
composer list dev