Skip to content

Commit ba2b92a

Browse files
docs(readme): document what the parser returns
The README showed which methods exist but never what they give back, so the only way to learn the shape of a placemark, a style or the GeoJSON output was to run the parser and print it. It also said nothing about which KML elements are supported, which matters more now that MultiGeometry, LineStyle, PolyStyle and SimpleData landed: users had no way to know those work, or that Folder and NetworkLink do not. Adds a supported elements table, the exact array shape of every getter, the accepted namespaces, the exception hierarchy, and notes on the parts that surprise people: MultiGeometry has geometries instead of coordinates, absent style keys are not defaults, colours stay in KML aabbggrr order, and the facade binding is scoped rather than a singleton. Also adds the missing CONTRIBUTING.md, which the README has linked to since the first release.
1 parent 48c1472 commit ba2b92a

2 files changed

Lines changed: 297 additions & 70 deletions

File tree

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing
2+
3+
Thanks for taking the time to contribute.
4+
5+
## Reporting a bug
6+
7+
Open an issue with the KML or KMZ that reproduces it, or the smallest fragment of it that still does. A namespace declaration and one Placemark is usually enough. Say which version of the package, PHP and Laravel you are on.
8+
9+
If the file is confidential, strip the coordinates and the names. The structure is what matters.
10+
11+
## Requesting support for a KML element
12+
13+
The README lists which elements are parsed and which are ignored. If you need one from the second list, open an issue with a sample document and what you expect to get back from `getPlacemarks()` or `toGeoJson()`.
14+
15+
## Pull requests
16+
17+
```bash
18+
composer install
19+
composer test
20+
composer analyse
21+
composer format
22+
```
23+
24+
All three have to pass. CI runs them on every pull request, across PHP 8.3 and 8.4, Laravel 11 and 12, on Linux and Windows.
25+
26+
A few things that make review quick:
27+
28+
- **Add a test that fails without your change.** For a bugfix, write it first and check that it fails on `main`. For a new element, assert the exact array shape you expect, not just that something came back.
29+
- **Run `composer format`.** The project uses Pint and CI will otherwise commit the formatting for you.
30+
- **Keep the change focused.** Unrelated cleanups in the same pull request make it harder to tell what actually changed.
31+
- **Say what breaks.** Changing the shape of a returned array is a breaking change even when no test notices. Call it out in the description so it reaches the changelog.
32+
33+
## Coordinate and namespace changes
34+
35+
Validation is deliberately strict: coordinates outside the valid ranges and unknown namespaces are rejected at load time rather than passed through. If you hit a real document that fails validation, that is a bug worth reporting, but the fix is usually to accept a specific new namespace or format rather than to loosen the check.
36+
37+
## Security
38+
39+
Do not open a public issue for a security problem. See the [security policy](../../security/policy).

0 commit comments

Comments
 (0)