Contributing¶
Repository structure¶
src/phpGPX/- Library source codeModels/- Data models (GpxFile, Track, Segment, Point, Stats, etc.)Parsers/- XML parsing and serializationHelpers/- Utility classes (GeoHelper, DateTimeHelper, distance/elevation calculators)tests/- Test suiteUnit/- Unit tests for individual componentsIntegration/- Full file load/save round-trip testsFixtures/- GPX and parser test fixture filesdocs/- Documentation (mkdocs-material)
Branches¶
master- Latest stable releasedevelop- Work on the next major version (2.x)
Setting up¶
Code style¶
The project follows PSR-12 with tab indentation, enforced by PHP CS Fixer (configured in .php-cs-fixer.php).
Bash
# Check for style violations (dry run)
composer cs-fix -- --dry-run
# Auto-fix all files
composer cs-fix
Key rules beyond PSR-12:
- Short array syntax (
[]notarray()) - No unused imports
- Alphabetically ordered imports
- Single quotes for strings
- Trailing commas in multiline arguments, arrays, and parameters