Skip to content

Redesign internals with proper collaborators, add Timezone support, and make Country extensible.#21

Merged
gustavofreze merged 1 commit into
mainfrom
feature/develop
Feb 14, 2026
Merged

Redesign internals with proper collaborators, add Timezone support, and make Country extensible.#21
gustavofreze merged 1 commit into
mainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 14, 2026 13:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a major redesign of the Country library internals, adding comprehensive timezone support and making the Country class extensible. The changes align with the PR title's goals: redesigning internals with proper collaborators (TimezoneCatalog, CountryNameNormalizer), adding Timezone support (Timezone and Timezones classes), and making Country extensible (removing final keyword, using static return types).

Changes:

  • Added complete IANA timezone support with Timezone and Timezones value objects that integrate with PHP's ICU database
  • Made Country class extensible by removing final keyword and using static return types
  • Refactored internal architecture with dedicated collaborators (CountryNameNormalizer, TimezoneCatalog)
  • Updated test namespace from TinyBlocks\Country to Test\TinyBlocks\Country
  • Removed internal traits (AlphaCodeMapper) in favor of inline implementations using PHP 8.4's array_find
  • Enhanced documentation with comprehensive timezone usage examples

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Country.php Made class extensible (removed final), added timezone support, refactored with static return types
src/Timezone.php New value object representing single IANA timezone identifier with validation
src/Timezones.php New immutable collection for country timezones with search/filter capabilities
src/Alpha2Code.php Removed trait, removed public CODE_LENGTH constant, inline conversion using array_find
src/Alpha3Code.php Removed trait, removed public CODE_LENGTH constant, inline conversion using array_find
src/AlphaCode.php Updated documentation to clarify getName() returns enum case name
src/Internal/TimezoneCatalog.php New internal collaborator for timezone data retrieval with caching
src/Internal/CountryNameNormalizer.php New internal collaborator replacing Name class for normalization logic
src/Internal/Exceptions/InvalidTimezone.php New exception for invalid timezone identifiers
tests/CountryTest.php Comprehensive test coverage for new timezone features and updated namespace
composer.json Updated test namespace, added timezone-related keywords
README.md Extensive documentation for timezone features with practical examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Alpha2Code.php
Comment thread src/Alpha3Code.php
Comment thread src/Alpha2Code.php
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35bb1f8b36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Internal/TimezoneCatalog.php
@gustavofreze gustavofreze merged commit 3de17ae into main Feb 14, 2026
12 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch February 14, 2026 13:26
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