Repository navigation
feat: reject non-instantiable geometry types explicitly - #41
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #41 +/- ##
=========================================
Coverage 99.13% 99.14%
- Complexity 220 222 +2
=========================================
Files 26 27 +1
Lines 465 469 +4
=========================================
+ Hits 461 465 +4
Misses 4 4 ☔ 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 #36
Summary
WKT and EWKT now report recognized non-instantiable geometry types through
NonInstantiableGeometryTypeException, implementingDecoderExceptionInterface. The shared lexer continues to useGeometryTypeEnum::isInstantiable()before checking implementation availability or constructing spatial objects. The exception retains the recognized enum and explains why it cannot be instantiated.Acceptance criteria
Validation
Commands run
PHPMD/PDepend emit existing dependency deprecation notices under PHP 8.4; all quality tools pass.
Standards
Normative references
Classification remains delegated to
GeometryTypeEnum::isInstantiable()as explicitly required by #36. No geometry hierarchy, grammar, dimensionality or normative interpretation changes.Architecture
Architecture decision
Both strategies reuse the existing common lexer.
Compatibility
Issue #36 explicitly requires the dedicated public exception. It extends PHP's
InvalidArgumentExceptionand implements the decoder exception interface. Callers catching only the decoder's finalInvalidArgumentExceptionfor abstract types must now catch the dedicated exception orDecoderExceptionInterface. Valid decoding and the unknown/unimplemented error contracts remain unchanged.Documentation
README describes the exception, enum accessor, classification timing, and catch migration.
Developer handoff
Important implementation decisions
Keep classification in the shared lexer and use the enum as the single source of truth. The dedicated exception follows the existing enum-carrying exception convention.
Compatibility considerations
See above: the exact exception for recognized non-instantiable types intentionally changes per #36.
Remaining risks or questions
Independent review and successful CI are required before Alexandre's merge decision. This PR does not mark the Story Done.