-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance email normalization providers by adding custom behavior for h… #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…yphen-based subaddress removal and updating documentation. Refactor tests to reflect changes in handling plus addressing and dot preservation across various providers, ensuring comprehensive coverage for Fastmail, Generic, Gmail, Icloud, Outlook, Protonmail, and Yahoo.
WalkthroughThis PR adds a protected Provider::removeHyphenSubaddress method and introduces a new Yandex provider. Multiple provider implementations were changed: Fastmail, Generic, ProtonMail now preserve all characters in the local part; Gmail reorders normalization and adds a non-empty validation; iCloud and Outlook now remove plus-addressing and validate non-empty locals; Yahoo applies hyphen-subaddress removal and expands supported domains; Outlook's supported domains were also expanded. Tests were significantly expanded or enabled for many providers (Fastmail, Generic, iCloud, Outlook, ProtonMail, Yahoo) and a new Yandex test was added. composer.json replaced utopia-php/framework with utopia-php/validators. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Rationale: The diff touches many provider implementations with distinct normalization rules, adds a new provider and extensive test updates, and includes a dependency change. Each provider change requires independent verification against expected canonicalization behavior and tests. Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/Emails/Canonicals/Provider.php (1)
66-75: Consider simplifying the removeHyphenSubaddress implementation.The current ternary with count check can be simplified since
array_slicehandles edge cases naturally.Apply this diff to simplify:
protected function removeHyphenSubaddress(string $local): string { $components = explode('-', $local); - - return count($components) > 1 ? implode('-', array_slice($components, 0, -1)) : $components[0]; + return implode('-', array_slice($components, 0, -1)) ?: $local; }This returns the same result but is more concise. When there's only one component,
array_slice($components, 0, -1)returns an empty array,implodereturns an empty string, and the?:operator falls back to the original$local.tests/EmailTest.php (2)
852-865: Cross-provider sanity checks read well.Good smoke coverage to ensure correct provider selection and behavior differences.
Consider extracting a small helper to DRY “new Email($input) → $email->getCanonical()” assertions or switch to @dataProvider to reduce repetition across methods.
Also applies to: 859-861
463-491: Remove duplicate test case; implementation confirmed correct.The codebase correctly implements last-hyphen removal for Yahoo addresses, matching validator.js behavior. The duplicate test
['user-name@yahoo.com', 'user@yahoo.com']at line 479 should be removed.Apply diff:
- ['user-name@yahoo.com', 'user@yahoo.com'],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
src/Emails/Canonicals/Provider.php(2 hunks)src/Emails/Canonicals/Providers/Fastmail.php(2 hunks)src/Emails/Canonicals/Providers/Generic.php(2 hunks)src/Emails/Canonicals/Providers/Gmail.php(2 hunks)src/Emails/Canonicals/Providers/Icloud.php(2 hunks)src/Emails/Canonicals/Providers/Outlook.php(2 hunks)src/Emails/Canonicals/Providers/Protonmail.php(2 hunks)src/Emails/Canonicals/Providers/Yahoo.php(2 hunks)src/Emails/Canonicals/Providers/Yandex.php(1 hunks)tests/Canonicals/Providers/FastmailTest.php(1 hunks)tests/Canonicals/Providers/GenericTest.php(1 hunks)tests/Canonicals/Providers/IcloudTest.php(1 hunks)tests/Canonicals/Providers/OutlookTest.php(3 hunks)tests/Canonicals/Providers/ProtonmailTest.php(1 hunks)tests/Canonicals/Providers/YahooTest.php(2 hunks)tests/Canonicals/Providers/YandexTest.php(1 hunks)tests/EmailTest.php(10 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
src/Emails/Canonicals/Providers/Yandex.php (2)
src/Emails/Canonicals/Provider.php (6)
Provider(10-84)supports(15-15)getCanonical(24-24)toLowerCase(80-83)getCanonicalDomain(29-29)getSupportedDomains(34-34)src/Emails/Canonicals/Providers/Fastmail.php (4)
supports(20-23)getCanonical(25-37)getCanonicalDomain(39-42)getSupportedDomains(44-47)
src/Emails/Canonicals/Providers/Outlook.php (1)
src/Emails/Canonicals/Provider.php (2)
Provider(10-84)removePlusAddressing(39-47)
tests/EmailTest.php (9)
src/Emails/Email.php (2)
getCanonical(297-303)src/Emails/Canonicals/Provider.php (1)
getCanonical(24-24)src/Emails/Canonicals/Providers/Fastmail.php (1)
getCanonical(25-37)src/Emails/Canonicals/Providers/Generic.php (1)
getCanonical(22-34)src/Emails/Canonicals/Providers/Gmail.php (1)
getCanonical(27-47)src/Emails/Canonicals/Providers/Icloud.php (1)
getCanonical(26-43)src/Emails/Canonicals/Providers/Outlook.php (1)
getCanonical(39-56)src/Emails/Canonicals/Providers/Protonmail.php (1)
getCanonical(25-37)src/Emails/Canonicals/Providers/Yahoo.php (1)
getCanonical(29-46)
tests/Canonicals/Providers/OutlookTest.php (2)
src/Emails/Canonicals/Provider.php (1)
supports(15-15)src/Emails/Canonicals/Providers/Outlook.php (1)
supports(34-37)
src/Emails/Canonicals/Providers/Gmail.php (1)
src/Emails/Canonicals/Provider.php (2)
removePlusAddressing(39-47)removeDots(53-56)
src/Emails/Canonicals/Providers/Icloud.php (1)
src/Emails/Canonicals/Provider.php (1)
removePlusAddressing(39-47)
tests/Canonicals/Providers/YandexTest.php (2)
src/Emails/Canonicals/Providers/Yandex.php (5)
Yandex(14-50)supports(22-25)getCanonical(27-39)getCanonicalDomain(41-44)getSupportedDomains(46-49)src/Emails/Canonicals/Provider.php (4)
supports(15-15)getCanonical(24-24)getCanonicalDomain(29-29)getSupportedDomains(34-34)
src/Emails/Canonicals/Providers/Yahoo.php (1)
src/Emails/Canonicals/Provider.php (2)
Provider(10-84)removeHyphenSubaddress(70-75)
🪛 PHPMD (2.15.0)
src/Emails/Canonicals/Providers/Yandex.php
27-27: Avoid unused parameters such as '$domain'. (undefined)
(UnusedFormalParameter)
🔇 Additional comments (26)
src/Emails/Canonicals/Provider.php (1)
49-56: LGTM!The docblock enhancement clarifies that providers can override this method for custom dot-handling behavior, which is good documentation practice.
src/Emails/Canonicals/Providers/Fastmail.php (1)
25-37: Verify that preserving all characters (including plus addressing and dots) aligns with Fastmail's actual email handling.The implementation now only lowercases the local part without removing subaddresses or dots. This is a significant behavior change that could affect email deduplication and canonical matching.
Please confirm:
- Fastmail's actual behavior supports this approach (i.e., they treat
user+tag@fastmail.comanduser@fastmail.comas different mailboxes)- Existing users/callers are aware of this behavior change
- This aligns with the validator.js rules mentioned in the PR objectives
Based on learnings: The changes reference validator.js rules - you may want to verify Fastmail's behavior matches those rules.
src/Emails/Canonicals/Providers/Generic.php (1)
22-34: LGTM! Sensible default for unknown email providers.Preserving all characters and only lowercasing is the safest approach for generic/unknown providers, as different providers have different normalization rules. This prevents false positives in canonical matching.
src/Emails/Canonicals/Providers/Gmail.php (2)
38-41: LGTM! Essential validation for empty local parts.The validation correctly prevents invalid canonical emails where the local part would be empty after normalization (e.g.,
+tag@gmail.comor.@gmail.com).
32-36: Normalization order verified—matches validator.js reference implementation.The PHP code order (remove plus addressing → remove dots) aligns with validator.js, which removes the subaddress first, then removes dots. The code change correctly implements the reference behavior.
src/Emails/Canonicals/Providers/Outlook.php (1)
44-50: LGTM! Consistent plus addressing removal and validation.The implementation correctly removes plus addressing and validates non-empty local parts, consistent with Gmail and iCloud implementations.
tests/Canonicals/Providers/OutlookTest.php (3)
17-33: LGTM! Comprehensive domain coverage in tests.The test properly validates support for the expanded domain list, including the new msn.com, passport.com, and country-specific variants.
35-85: Excellent test coverage for plus addressing and edge cases.The test cases thoroughly cover:
- Plus addressing removal across all domain variants
- Dots preservation in local parts
- Edge cases like trailing plus signs (
user+)- Complex tags with dots, hyphens, and underscores
92-110: LGTM! Expected domains list matches implementation.The test correctly validates that all 60+ domains are returned by
getSupportedDomains().src/Emails/Canonicals/Providers/Icloud.php (1)
26-43: LGTM! Consistent implementation with Gmail and Outlook.The implementation correctly:
- Removes plus addressing for iCloud/me.com/mac.com domains
- Preserves dots in local parts
- Validates non-empty local parts after normalization
- Normalizes to icloud.com canonical domain
This aligns with the validator.js-based rules and is consistent with similar providers.
src/Emails/Canonicals/Providers/Protonmail.php (1)
25-37: Code implementation verified against ProtonMail's actual behavior.ProtonMail supports +aliases and treats dots in the local-part as transparent, with messages to dotted variations arriving in the same inbox. The code correctly preserves both by only normalizing case and domain, which aligns with ProtonMail's actual handling of these address formats.
tests/Canonicals/Providers/FastmailTest.php (1)
29-52: LGTM! Comprehensive test coverage for Fastmail canonicalization.The expanded test cases thoroughly verify that Fastmail preserves all characters in the local part (dots, plus signs, hyphens, underscores) while canonicalizing the domain. Edge cases like trailing/leading dots and consecutive dots are well covered.
tests/Canonicals/Providers/IcloudTest.php (1)
30-55: LGTM! Thorough test coverage for iCloud's plus-addressing removal.The test cases properly verify iCloud's canonicalization behavior: removing plus-based subaddresses while preserving dots. Cross-domain canonicalization (me.com, mac.com → icloud.com) is also well tested.
tests/Canonicals/Providers/ProtonmailTest.php (1)
30-55: LGTM! Complete test coverage for ProtonMail's preservation behavior.The test cases comprehensively verify that ProtonMail preserves all local part characters, including plus signs, dots, hyphens, and underscores. Domain canonicalization across proton.me and pm.me variants is properly tested.
tests/Canonicals/Providers/GenericTest.php (1)
32-61: LGTM! Robust test coverage for Generic provider.The test cases thoroughly verify character preservation across multiple domain types. The comprehensive coverage of edge cases and domain variations ensures the generic provider behaves consistently across different email domains.
tests/Canonicals/Providers/YandexTest.php (1)
1-71: LGTM! Well-structured test suite for the new Yandex provider.The test file follows the established pattern from other provider tests and provides comprehensive coverage. The test cases properly verify that Yandex preserves all local part characters while canonicalizing various Yandex domains to yandex.ru.
src/Emails/Canonicals/Providers/Yandex.php (1)
27-39: LGTM! Clean implementation of Yandex email canonicalization.The implementation correctly lowercases the local part and canonicalizes the domain to yandex.ru without applying any subaddress or dot transformations, which aligns with Yandex's email handling behavior.
Note: The static analysis hint about the unused
$domainparameter is a false positive - the parameter is required by the abstract method signature in the Provider base class.tests/Canonicals/Providers/YahooTest.php (2)
32-69: Comprehensive test coverage for Yahoo's hyphen-based subaddress removal.The test cases thoroughly verify the hyphen removal logic across various scenarios including multiple hyphens, dots with hyphens, and cross-domain canonicalization. The expanded domain support (yahoo.de, yahoo.fr, yahoo.in, yahoo.it) aligns with validator.js rules.
However, consider adding test coverage for the exception scenario mentioned in Yahoo.php lines 38-40. The implementation throws
InvalidArgumentExceptionwhen the local part is empty after normalization, but there are no test cases verifying this behavior for inputs like:
- Single hyphen:
['-', 'yahoo.com']- Only hyphens:
['--', 'yahoo.com']Additionally, verify whether Line 58's expectation
['user--tag', 'yahoo.com', 'user-', 'yahoo.com']is intentional - it results in a trailing hyphen which may not be a valid email local part according to RFC 5321.
86-86: No action required — domain list ordering is consistent.The expected domain list in the test matches the implementation exactly. Both define domains in the same order:
yahoo.com,yahoo.co.uk,yahoo.ca,yahoo.de,yahoo.fr,yahoo.in,yahoo.it,ymail.com,rocketmail.com.tests/EmailTest.php (7)
510-525: iCloud: plus-address removal + domain canonicalization (me.com/mac.com) looks good.Dots preserved as expected; edge case for empty tag handled via local-before-plus.
Also applies to: 530-530
549-566: ProtonMail: preservation of dots and subaddresses with domain mapping is correct.Good coverage across protonmail.com, proton.me, pm.me.
Also applies to: 567-567
585-602: Fastmail: preservation behavior and fastmail.fm → fastmail.com mapping look correct.Edge case coverage included.
Also applies to: 603-603
619-619: Generic domains: preservation of dots/plus is correct.Good to keep a clear contrast vs provider-specific rules.
Also applies to: 621-632, 634-634, 637-637, 639-639
719-741: Case sensitivity: expectations match provider rules.Lowercasing + provider-specific normalization verified across providers.
655-676: Implementation verified—leading '+' cases correctly handled.The
removePlusAddressingmethod insrc/Emails/Canonicals/Provider.phpcorrectly implements the required semantics:
- Line 42's condition
$plusPos > 0ensures removal only occurs when+is NOT at position 0- Test cases like
['+user@gmail.com', '+user@gmail.com']are preserved as expected- Test cases like
['user+@gmail.com', 'user@gmail.com']are normalized as expected- Empty-local safeguards already exist in provider implementations (Outlook, Icloud)
No action required—the code and tests are correct and consistent.
412-436: Verify domain canonicalization is consistent across all Outlook regional variants.The Outlook provider supports 15 domain variants (outlook.com, outlook.at, outlook.be, outlook.cl, outlook.co.il, outlook.co.nz, outlook.co.th, outlook.co.uk, outlook.com.ar, outlook.com.au, outlook.com.br, outlook.com.gr, outlook.com.pe, outlook.com.tr, outlook.com.vn), but the test covers only 6 domains. If normalization behavior is identical across all variants, current coverage is sufficient. If regional differences exist, add at least one non-UK variant (e.g., outlook.com.au) to validate the assumption.
| private const SUPPORTED_DOMAINS = [ | ||
| 'outlook.com', 'hotmail.com', 'live.com', | ||
| 'outlook.co.uk', 'hotmail.co.uk', 'live.co.uk', | ||
| 'outlook.com', 'outlook.at', 'outlook.be', 'outlook.cl', 'outlook.co.il', 'outlook.co.nz', 'outlook.co.th', 'outlook.co.uk', | ||
| 'outlook.com.ar', 'outlook.com.au', 'outlook.com.br', 'outlook.com.gr', 'outlook.com.pe', 'outlook.com.tr', 'outlook.com.vn', | ||
| 'outlook.cz', 'outlook.de', 'outlook.dk', 'outlook.es', 'outlook.fr', 'outlook.hu', 'outlook.id', 'outlook.ie', | ||
| 'outlook.in', 'outlook.it', 'outlook.jp', 'outlook.kr', 'outlook.lv', 'outlook.my', 'outlook.ph', 'outlook.pt', | ||
| 'outlook.sa', 'outlook.sg', 'outlook.sk', | ||
| 'hotmail.com', 'hotmail.at', 'hotmail.be', 'hotmail.ca', 'hotmail.cl', 'hotmail.co.il', 'hotmail.co.nz', 'hotmail.co.th', 'hotmail.co.uk', | ||
| 'hotmail.com.ar', 'hotmail.com.au', 'hotmail.com.br', 'hotmail.com.gr', 'hotmail.com.mx', 'hotmail.com.pe', 'hotmail.com.tr', 'hotmail.com.vn', | ||
| 'hotmail.cz', 'hotmail.de', 'hotmail.dk', 'hotmail.es', 'hotmail.fr', 'hotmail.hu', 'hotmail.id', 'hotmail.ie', | ||
| 'hotmail.in', 'hotmail.it', 'hotmail.jp', 'hotmail.kr', 'hotmail.lv', 'hotmail.my', 'hotmail.ph', 'hotmail.pt', | ||
| 'hotmail.sa', 'hotmail.sg', 'hotmail.sk', | ||
| 'live.com', 'live.be', 'live.co.uk', 'live.com.ar', 'live.com.mx', 'live.de', 'live.es', 'live.eu', 'live.fr', 'live.it', 'live.nl', | ||
| 'msn.com', 'passport.com', | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the expanded domain list is complete and correct.
The SUPPORTED_DOMAINS list expanded significantly from ~6 to 60+ domains. While this appears comprehensive for Outlook/Hotmail/Live variants, it should be validated against official Microsoft documentation.
🌐 Web query:
What are all the official Outlook, Hotmail, Live, MSN, and Passport email domains supported by Microsoft?
💡 Result:
Short answer — Microsoft supports addresses on these official Microsoft-owned domains (including many country-code variants of each):
- @outlook.com (and country variants like outlook.co.uk, outlook.de, outlook.fr, etc.). [1]
- @hotmail.com (and country variants like hotmail.co.uk, hotmail.de, hotmail.fr, hotmail.it, hotmail.co.jp, hotmail.com.au, etc.). [2][3]
- @live.com (and country variants like live.co.uk, live.de, live.fr, live.it, live.cn, etc.). [2][3]
- @msn.com (and regional/msn.* variants). [1][2]
- legacy domains still maintained for existing accounts: @windowslive.com and @passport.com (and their regional variants). [1][2]
Notes:
- Microsoft’s documentation treats @Hotmail, @LiVe, @msn and @passport addresses as supported legacy Microsoft account addresses but mainly issues new mailboxes on @outlook.com now. [1][2]
- There are many country-specific TLD variants for Hotmail/Live/Outlook/MSN (too many to list exhaustively here). If you want, I can enumerate every known country-code variant and provide sources for each.
Sources: Microsoft Support (Outlook/Hotmail/MSN support) [1]; Outlook.com / Microsoft account pages and historical domain lists compiled (examples) [2][3].
Add missing @windowslive.com legacy domain to SUPPORTED_DOMAINS list.
Microsoft's documentation treats @windowslive.com as a supported legacy Microsoft account domain still maintained for existing accounts. The current list is missing windowslive.com and its country variants. Additionally, some country-specific variants like live.cn appear to be absent, though the list covers most common regional TLDs.
Add windowslive.com at minimum to ensure accounts migrated to or still using this legacy domain are properly recognized.
🤖 Prompt for AI Agents
In src/Emails/Canonicals/Providers/Outlook.php around lines 17 to 30, the
SUPPORTED_DOMAINS array omits the legacy Microsoft domain windowslive.com (and
country variants); add at least 'windowslive.com' to the list of supported
domains (ideally grouped with other Microsoft legacy domains like hotmail/live)
so addresses using the legacy domain are recognized; update any related tests or
validation that depend on SUPPORTED_DOMAINS to include this new entry.
| // Remove hyphen-based subaddress (everything after last -) | ||
| $normalizedLocal = $this->removeHyphenSubaddress($normalizedLocal); | ||
|
|
||
| // Remove plus addressing (everything after +) | ||
| // $normalizedLocal = $this->removePlusAddressing($normalizedLocal); | ||
|
|
||
| // Remove dots only if there was plus addressing (Yahoo treats dots as aliases only with plus) | ||
| // if ($hasPlus) { | ||
| // $normalizedLocal = $this->removeDots($normalizedLocal); | ||
| // } | ||
|
|
||
| // Remove hyphens (Yahoo treats hyphens as aliases) | ||
| // $normalizedLocal = $this->removeHyphens($normalizedLocal); | ||
| // Ensure local part is not empty after normalization | ||
| if (empty($normalizedLocal)) { | ||
| throw new \InvalidArgumentException('Email local part cannot be empty after normalization'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify test coverage for empty local part validation.
The implementation correctly validates that the local part is not empty after hyphen subaddress removal. However, I don't see test cases in YahooTest.php that verify this exception is thrown for edge cases like:
- Single hyphen:
- - Only hyphens:
--or---
Run the following script to check if the exception scenario is tested:
🏁 Script executed:
#!/bin/bash
# Description: Search for test cases that verify the InvalidArgumentException
# Check if YahooTest.php tests the exception
rg -n "expectException|InvalidArgumentException|^\s*\['-'" tests/Canonicals/Providers/YahooTest.phpLength of output: 0
---
🏁 Script executed:
```shell
#!/bin/bash
# Find test files related to Yahoo provider
fd -i yahoo tests/ --type f
Length of output: 40
🏁 Script executed:
#!/bin/bash
# Check tests directory structure
find tests/ -type d | head -20Length of output: 66
🏁 Script executed:
#!/bin/bash
# Search for any test files in Canonicals/Providers directory
fd --type f tests/Canonicals/Providers/ 2>/dev/null || find tests/Canonicals/Providers/ -type f 2>/dev/nullLength of output: 382
🏁 Script executed:
#!/bin/bash
# Broader search for InvalidArgumentException in all test files
rg -n "InvalidArgumentException" tests/ --type phpLength of output: 0
---
🏁 Script executed:
```shell
#!/bin/bash
# Display YahooTest.php content to see test cases
cat tests/Canonicals/Providers/YahooTest.php
Length of output: 4356
🏁 Script executed:
#!/bin/bash
# Display Yahoo.php implementation
cat src/Emails/Canonicals/Providers/Yahoo.phpLength of output: 1560
🏁 Script executed:
#!/bin/bash
# Search for test data or fixtures related to Yahoo tests
rg -n "dataProvider|@test" tests/Canonicals/Providers/YahooTest.php -A 2Length of output: 0
Add test cases to verify InvalidArgumentException for empty local parts.
The implementation correctly throws InvalidArgumentException when the local part becomes empty after hyphen subaddress removal (lines 34-40 of Yahoo.php). However, the test suite lacks coverage for this exception scenario.
Current test cases do not include edge cases that would result in an empty local part after normalization:
- Single hyphen:
- - Only hyphens:
--,---, etc.
Add test cases to verify the exception is thrown for these inputs.
🤖 Prompt for AI Agents
In src/Emails/Canonicals/Providers/Yahoo.php around lines 34-40 the code throws
an InvalidArgumentException when the local part becomes empty after removing
hyphen subaddresses; the test suite lacks coverage for inputs that produce an
empty local part (e.g., '-', '--', '---'). Add test cases in the YahooTest
(test_get_canonical or a new test method) that assert InvalidArgumentException
is thrown for these inputs (use a data provider or iterate the cases) so the
exception path is exercised and covered by tests.
…utopia-php/validators for improved validation capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "require": { | ||
| "php": ">=8.0", | ||
| "utopia-php/framework": "0.33.*", | ||
| "utopia-php/validators": "^0.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the stability of the utopia-php/validators dependency.
The version constraint ^0.0.1 indicates an early-stage package (0.x.x semantics), which typically implies active development and potential breaking changes. Confirm that this package version is stable enough for production use and that the replacement of utopia-php/framework is intentional and comprehensive.
Please verify the following:
- The
utopia-php/validatorspackage exists and is appropriate for the enhanced email normalization rules mentioned in the PR. - The version constraint
^0.0.1is intentional for this library, especially given the 0.x.x versioning. - The
utopia-php/frameworkpackage is no longer needed elsewhere in the codebase.
Run the following script to check if utopia-php/framework is referenced in other code files:
🏁 Script executed:
#!/bin/bash
# Description: Search for references to utopia-php/framework in the codebase
# Check for direct references in PHP code
rg -n "utopia.*framework" --type=php
# Check for other composer.json files or lock file references
find . -name "composer.lock" -o -name "composer.json" | xargs grep -l "utopia-php/framework" 2>/dev/null || echo "No additional references found"Length of output: 30
🌐 Web query:
Does the utopia-php/validators package exist on Packagist and what is the purpose of version 0.0.1?
💡 Result:
Short answer: No — there is no utopia-php/validators package listed on Packagist, and therefore there is no published version 0.0.1 on Packagist. Packagist's utopia-php package index (which lists the available utopia-php packages) does not include a "validators" package. [1]
If you have a reference (composer.json, repo, or error) that mentions utopia-php/validators v0.0.1, paste it and I can check whether it's a private package, a typo, or a placeholder/dev artifact. [1]
Non-existent dependency: "utopia-php/validators" does not exist on Packagist.
The utopia-php organization publishes packages like utopia-php/emails (for parsing and validating email addresses), but there is no "validators" package. The composer.json references a package that cannot be installed, causing composer to fail. Verify the correct package name—given the PR context (email normalization), this may be intended as utopia-php/emails instead.
🤖 Prompt for AI Agents
In composer.json around line 29, the dependency "utopia-php/validators":
"^0.0.1" references a non-existent Packagist package and will break composer
install; replace or remove it: determine the intended package (if this PR deals
with email validation, replace with "utopia-php/emails" and pick the correct
version constraint), or if it was meant to be a private/internal package add the
appropriate "repositories" entry and correct package name/version; after
updating composer.json run composer validate and composer update to ensure
dependency resolution succeeds and adjust any code imports/namespaces to match
the chosen package.
…yphen-based subaddress removal and updating documentation. Refactor tests to reflect changes in handling plus addressing and dot preservation across various providers, ensuring comprehensive coverage for Fastmail, Generic, Gmail, Icloud, Outlook, Protonmail, and Yahoo.
Rules are based on: https://github.com/validatorjs/validator.js/blob/master/src/lib/normalizeEmail.js
Summary by CodeRabbit
New Features
Improvements
Tests