Thanks for taking the time to contribute. This document is short on purpose — follow the spirit, not the letter.
- Search existing issues first.
- For bugs, the issue template will ask for: PHP / CodeIgniter version, the config you're using, the command you ran, and the actual vs expected behaviour.
- For security issues please do not open a public issue — see SECURITY.md.
git clone https://github.com/daycry/maintenancemode.git
cd maintenancemode
composer installRun the full quality bar locally before opening a PR:
composer ci # cs + analyze + testOr run each step individually:
composer cs # PHP-CS-Fixer dry-run
composer cs-fix # auto-fix style
composer analyze # PHPStan
composer test # PHPUnit- Fork, branch (
feat/short-nameorfix/short-name), commit, push, PR. - Keep PRs focused: one feature or fix per PR.
- Add or update tests for any behavioural change. PRs that lower coverage on
src/Servicesorsrc/Storagewill be asked to add coverage. - Update
CHANGELOG.mdunder## [Unreleased]with a one-line summary. - Update
docs/if the change affects user-visible behaviour.
We follow Conventional Commits:
feat: add scheduled maintenance windowsfix: timing-safe cookie comparisondocs: clarify bypass priorityrefactor: extract MaintenanceServicetest: cover IpChecker IPv6 edge caseschore(deps): bump phpstan to ^1.11
Dependabot already uses these prefixes for its automated PRs.
- PHP-CS-Fixer config is
.php-cs-fixer.dist.php(CodeIgniter 4 ruleset). - PHPStan runs at level 6 (see
phpstan.neon.dist). - New code should be type-hinted; prefer
readonlyfor value objects. - No comments that describe what the code does — only why when non-obvious.
- New code lives under
src/; tests undertests/Maintenance/. - Use
Services::injectMock('request', $mock)to test bypass logic — setting$_GETdirectly does not propagate to the cached request singleton. - The shared
Tests\Support\TestCaseresets services and settings for you.
Maintainers cut releases by:
- Updating
CHANGELOG.md(rename[Unreleased]to the new version). - Tagging
vX.Y.Zonmaster. - Drafting GitHub release notes from the changelog entry.
Semantic versioning rules:
X(major) — breaking API change.Y(minor) — backwards-compatible feature.Z(patch) — backwards-compatible fix.