Skip to content

Conversation

@parsilver
Copy link
Collaborator

@parsilver parsilver commented Nov 26, 2025

Summary

  • Introduce GeonamesException class with factory methods for clear, actionable error messages:
    • fileOperationFailed() - descriptive errors for file read/write failures
    • zipOperationFailed() - specific errors when ZIP extraction fails
    • dataNotFound() - clear messages when expected data is missing
    • dependencyMissing() - helpful errors with installation instructions
  • Add ConverterInterface contract for consistent converter behavior
  • Add comprehensive test coverage for error scenarios and console commands

Test plan

  • Verify all existing tests pass
  • Run new unit tests for exception handling
  • Run new feature tests for console commands
  • Verify PHPStan passes

- Add ConverterInterface contract for converter implementations
- Add GeonamesException with factory methods for domain-specific errors
- Extract common logic into AbstractConverter and AbstractGazetteerConverter
- Extract common downloader logic into AbstractDownloader
- Simplify converter classes by inheriting from abstract base classes
- Add comprehensive test coverage for converters and console commands
- Update phpstan configuration for new classes
@parsilver parsilver changed the title Refactor architecture with interfaces, abstract classes, and tests Add structured error handling with GeonamesException Nov 26, 2025
The describe() function in Pest had stability issues in earlier 2.x
versions when used with prefer-lowest dependency resolution. Updating
the minimum version to ^2.34 ensures proper describe() support.
@parsilver parsilver merged commit 77bef5c into main Nov 26, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants