Skip to content

Latest commit

 

History

History
97 lines (66 loc) · 2.81 KB

CONTRIBUTING.md

File metadata and controls

97 lines (66 loc) · 2.81 KB

Contributing

Contributions are welcome. Please follow the workflow below before opening a pull request.

Scope

This package reads, writes, checks and deletes values in nested arrays using dot-notation paths and wildcards. Collection-style helpers (map, filter, pluck, sort, …) are out of scope; please open an issue before proposing a new public method.

Supported PHP versions

Each release line targets exactly one PHP version, and the branch name tells you which:

8.0.x → PHP 8.0
8.1.x → PHP 8.1
...

Code on a branch must not use syntax or functions introduced after that branch's PHP version.

Setup

Fork the repository, then clone your fork:

git clone https://github.com/YOUR_USERNAME/php-dot-array.git
cd php-dot-array
composer install

Add the original repository as upstream:

git remote add upstream https://github.com/Pharaonic/php-dot-array.git

Choose the target branch

Check out the branch that matches the PHP version you are targeting. For a bug fix, use the oldest line that has the bug:

git checkout 8.0.x
git pull upstream 8.0.x

Create a working branch

git checkout -b fix/wildcard-delete

Recommended prefixes:

feature/
fix/
refactor/
test/
docs/

Make your changes

  • Keep each change focused.
  • Add or update tests for behavior changes. Path behavior must stay the same across get(), set(), has() and delete().
  • Preserve backward compatibility whenever possible, including method signatures (subclasses depend on them). Document any change in results in UPGRADE.md.
  • Update /docs when the public API or usage changes.
  • Add an entry to CHANGELOG.md under the line's ## 8.N.p - Unreleased heading.
  • Do not introduce breaking changes without discussing them in an issue first.

Run checks

composer test           # Pest
composer analyse        # PHPStan (level max)
composer format:check   # Pint; `composer format` fixes the style
composer security       # Composer audit
composer check          # composer validate --strict and all of the above

The scripts run on the PHP that runs Composer, so use the branch's PHP version, for example php8.6 $(which composer) check on 8.6.x. All checks must pass. CI also runs the tests with the lowest allowed dependency versions, on Linux and Windows.

Push and open a pull request

git push origin fix/wildcard-delete

Open the pull request against the version branch you started from, and fill in the pull request template. Maintainers port fixes from the oldest affected line to the newer lines, so do not submit the same change to several branches.

Code of Conduct

This project follows the Code of Conduct.

Security

Do not report security vulnerabilities through public issues. See SECURITY.md.