Skip to content

Commit cd120b3

Browse files
committed
Cleaning up before 2.0.0-beta.1 😜
1 parent ace167c commit cd120b3

12 files changed

Lines changed: 82 additions & 1668 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php-version: ['8.1', '8.2', '8.3', '8.4']
15+
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
deploy:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 0
2222

23-
- uses: actions/setup-python@v5
23+
- uses: actions/setup-python@v6
2424
with:
2525
python-version: '3.12'
2626

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ composer.lock
88
/.phpunit.result.cache
99
/.phpunit.cache
1010
coverage.xml
11-
/docs-output/
12-
/.phpdoc/
1311
/site/
14-
/.venv/
12+
/.venv/
13+
/.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
21
<?php
32

4-
$finder = PhpCsFixer\Finder::create()
5-
->in(__DIR__)
6-
->ignoreDotFiles(true)
7-
->ignoreVCS(true)
8-
->exclude(['docs', 'vendor'])
9-
->files()
10-
->name('*.php')
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__)
5+
->ignoreDotFiles(true)
6+
->ignoreVCS(true)
7+
->exclude(['docs', 'vendor'])
8+
->name('*.php')
119
;
1210

13-
return PhpCsFixer\Config::create()
14-
->setUsingCache(true)
15-
->setFinder($finder)
16-
->setRules([
17-
'@PSR2' => true,
18-
])
19-
->setIndent("\t")
20-
;
11+
return (new PhpCsFixer\Config())
12+
->setUsingCache(true)
13+
->setFinder($finder)
14+
->setRules([
15+
'@PSR12' => true,
16+
'array_syntax' => ['syntax' => 'short'],
17+
'no_unused_imports' => true,
18+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
19+
'single_quote' => true,
20+
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'arrays', 'parameters']],
21+
'no_whitespace_in_blank_line' => true,
22+
'no_trailing_whitespace' => true,
23+
])
24+
->setIndent("\t")
25+
;

CHANGELOG.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
# Changelog
22

3-
## 2.0.0 : TBD
4-
5-
- **Changed** Support for PHP 8.1+ only
6-
- **Fixed** Added proper return type declarations to parser classes to fix deprecated messages in PHP 8.4
7-
- **Fixed** Patched vendor files to fix deprecation warnings about implicitly marking parameters as nullable:
8-
- sebastian/cli-parser/src/Parser.php
9-
- phpunit/phpunit/src/Util/Exporter.php
10-
- sebastian/exporter/src/Exporter.php
11-
- **Fixed** Updated tests to be compatible with PHPUnit 12.x:
12-
- Added missing tests to BoundsTest class
13-
- Updated test annotations to use PHPUnit 12 attributes
14-
- Fixed data provider usage in SerializationHelperTest
15-
- Implemented missing GpxSerializable interface methods in Bounds class
16-
- Updated phpunit.xml configuration
3+
## 2.0.0-beta.1 : 2025-03-09
4+
5+
### Breaking Changes
6+
7+
- **Changed**: `phpGPX` is now instance-based — `phpGPX::load()` (static) replaced by `(new phpGPX())->load()`
8+
- **Removed**: All static configuration properties (`$CALCULATE_STATS`, `$SORT_BY_TIMESTAMP`, `$PRETTY_PRINT`, etc.) — replaced by `Config` value object and analyzer constructors
9+
- **Removed**: `Summarizable` interface and `toArray()` — replaced by `JsonSerializable` returning GeoJSON (RFC 7946)
10+
- **Removed**: `GpxSerializable` interface — parsers handle XML serialization via Data Mapper pattern
11+
- **Removed**: `StatsCalculator` interface — replaced by Engine
12+
- **Removed**: `AbstractExtension` base class — replaced by `ExtensionInterface`
13+
- **Changed**: Point type constants (`Point::TRACKPOINT`, etc.) replaced by `PointType` enum
14+
- **Changed**: Extension access `$extensions->trackPointExtension` replaced by `$extensions->get(TrackPointExtension::class)`
15+
16+
### Added
17+
18+
- **Added**: Single-pass stats `Engine` with pluggable analyzers (`DistanceAnalyzer`, `ElevationAnalyzer`, `AltitudeAnalyzer`, `TimestampAnalyzer`, `BoundsAnalyzer`, `MovementAnalyzer`, `TrackPointExtensionAnalyzer`)
19+
- **Added**: `Engine::default()` factory with named parameters for common configuration
20+
- **Added**: `ExtensionRegistry` for registering custom extension parsers by namespace URI
21+
- **Added**: `ExtensionInterface` and `ExtensionParserInterface` for custom extensions
22+
- **Added**: `Config` value object for output configuration
23+
- **Added**: `AbstractParser` base class centralizing attribute mapping and XML handling
24+
- **Added**: mkdocs-material documentation site with PlantUML support
25+
- **Added**: Consolidated CI workflow (PHP 8.1–8.4 matrix) with Codecov integration
26+
27+
### Changed
28+
29+
- **Changed**: PHP 8.1+ required
30+
- **Changed**: `Extensions` model is now a keyed collection
31+
- **Changed**: Default Garmin TrackPointExtension v1 + v2 auto-registered via `ExtensionRegistry::default()`
32+
- **Changed**: All parsers refactored to extend `AbstractParser`
33+
- **Changed**: Strict typing on all model properties
34+
- **Changed**: Test suite restructured into `unit` and `integration` suites
35+
- **Changed**: PHPUnit 10+ with attributes (annotations removed)
36+
- **Changed**: Test fixtures standardized under `tests/Fixtures/`
1737

1838
## 1.3.0 : 2023-07-19
1939

Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sibyx/phpgpx",
33
"type": "library",
4-
"version": "1.3.0",
4+
"version": "2.0.0-beta.1",
55
"description": "A simple PHP library for GPX manipulation",
66
"minimum-stability": "stable",
77
"keywords": [

docker-compose.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/development/contributing.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
- `tests/` - Test suite
1010
- `Unit/` - Unit tests for individual components
1111
- `Integration/` - Full file load/save round-trip tests
12-
- `fixtures/` - GPX test fixture files
13-
- `docs/` - Documentation (Daux.io)
12+
- `Fixtures/` - GPX and parser test fixture files
13+
- `docs/` - Documentation (mkdocs-material)
1414

1515
## Branches
1616

@@ -27,4 +27,20 @@ composer install
2727

2828
## Code style
2929

30-
The project uses PSR-2 with **tab indentation** (configured in `.php-cs-fixer.php`).
30+
The project follows **PSR-12** with **tab indentation**, enforced by [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) (configured in `.php-cs-fixer.php`).
31+
32+
```bash
33+
# Check for style violations (dry run)
34+
composer cs-fix -- --dry-run
35+
36+
# Auto-fix all files
37+
composer cs-fix
38+
```
39+
40+
Key rules beyond PSR-12:
41+
42+
- Short array syntax (`[]` not `array()`)
43+
- No unused imports
44+
- Alphabetically ordered imports
45+
- Single quotes for strings
46+
- Trailing commas in multiline arguments, arrays, and parameters

0 commit comments

Comments
 (0)