Repository navigation
types: edit mutable polygons and triangles in place - #51
Merged
Merged
Conversation
Add mutable XY, XYZ, XYM and XYZM surfaces with shared ring ownership, atomic indexed editing and recursive context propagation. Document the contracts and cover representable invalid states and component rejection.
21 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
============================================
+ Coverage 99.40% 99.48% +0.07%
- Complexity 703 889 +186
============================================
Files 132 167 +35
Lines 1525 1926 +401
============================================
+ Hits 1516 1916 +400
- Misses 9 10 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Closes #43
Summary
Add mutable Polygon and Triangle classes for XY, XYZ, XYM and XYZM. Consumers can edit ordered rings and points in place, replace complete coordinates, and propagate declared context without recalculating ordinates.
Acceptance criteria
Validation
Commands run
The initial focused run passed 39 tests / 326 assertions. After additional edge cases, the complete suite passed 861 tests / 7,869 assertions, including 45 new tests. Coverage: 99.49% lines. Quality passed PHP CS Fixer, PHPStan level 9, PHPMD and PHP_CodeSniffer. PHPMD/PDepend dependencies emit PHP 8.5 deprecation messages; no quality violations remain. Local runtime: PHP 8.5.11.
Tests: MutablePolygonTest, MutablePolygonLayoutTest and MutablePolygonContextTest cover ownership, typed/nested rejection, ordering, ring and point failures, coordinate replacement isolation, every layout and recursive/local context changes.
Standards
Normative references
ISO/IEC CD 13249-3:201x(E), clauses 8.3.1 (ST_Polygon, printed p. 294) and 8.4.1 (ST_Triangle, printed p. 311), inspected from the locally available 2009-01-16 Committee Draft. These define the geometry models. Under the approved #38/#43 representation contract, geometric validity remains an explicit spatial-validator concern; mutation does not close rings or enforce triangle cardinality. No new normative interpretation or serialization behavior is introduced.
Architecture
Architecture decision
Apply #38/#39/#43: mutable concrete classes reside directly in their dimension namespaces, use a shared mutable ring-storage base, implement MutablePolygonInterface / MutableTriangleInterface, and expose no with-methods. Mutable objects do not extend immutable concrete classes.
Compatibility
The already provisioned MutablePolygonInterface now defines the operations approved in #43 and narrows ring reads to MutableLineStringInterface. Consumers implementing that provisional interface must implement the new members. Immutable classes, factories, dependencies and supported runtimes are unchanged.
Documentation
Constructor signatures, mutation operations, ownership, propagation, indexing, atomicity and validity boundaries are documented in instantiable-spatial-types.md, with hierarchy and related reference updates.
Developer handoff
Important implementation decisions
All rings are hydrated and checked before complete replacement is committed. Typed component mutations validate addressing and mutable descendants before editing membership. Supplied rings/points are retained without cloning, while tuple input creates mutable descendants against the surface's current context.
Remaining risks or questions
Independent review and remote CI must be assessed separately. No unresolved product, API, architecture or normative decision was encountered. The PR must not be merged or the Story marked Done by the Developer.