Skip to content

Feat/update 1 2#6

Merged
lhcze merged 11 commits intomainfrom
feat/update_1_2
Jul 13, 2025
Merged

Feat/update 1 2#6
lhcze merged 11 commits intomainfrom
feat/update_1_2

Conversation

@lhcze
Copy link
Owner

@lhcze lhcze commented Jul 13, 2025

Seed docs/worklog.md & readme.md

lhcze added 11 commits July 13, 2025 23:50
- Introduced `parseLocale` in `IanaSubtagRegistry` to parse locales into `ParsedTag`.
- Added `getParsedTag` in `BCP47Tag` for accessing parsed tag components.
- Marked `BCP47Parser` and `BCP47Normalizer` as `readonly` for immutability.
- Extended test suite with cases for `ParsedTag` functionality.
- Added `parseTagInternal` to centralize `ParsedTag` creation.
- Updated `parseLocale` and `isValidLocale` to reuse `parseTagInternal`, ensuring consistency.
- Improved type handling and null checks in `isValidLocale`.
- Updated README with examples and method documentation.
- Added `array<string>` type hints to `IanaSubtagRegistry` constructor for improved type safety.
- Removed redundant condition in `BCP47Parser::parseTag` for better clarity and reduced false positives.
- Updated documentation and passed all tests and PHPStan checks.
…timize lazy loading

- Replaced JSON IANA registry with static PHP snapshot for zero parsing overhead
- Removed symfony/intl and validator dependency (not needed after refactor)
- Implemented singleton lazy loader for registry (OPcache-friendly)
- Updated composer with bcp47:refresh script for manual IANA updates
- Cleaned up normalizer logic (pure ABNF-based, no external fallback)
- Updated README to reflect new structure and performance design
- All tests green, code lighter, faster, and fully self-contained
- cleanups
- test provider updates
- composer lock update
@lhcze lhcze self-assigned this Jul 13, 2025
@lhcze lhcze merged commit 13d5228 into main Jul 13, 2025
1 check 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.

1 participant