Skip to content

Conversation

@eldadfux
Copy link
Member

@eldadfux eldadfux commented Oct 19, 2025

…vior

Enhance the Email class by introducing an option to allow empty values during validation. This change includes a constructor parameter to set the allowEmpty flag and updates the validation logic accordingly. Additional tests have been added to verify the behavior with allowEmpty enabled and disabled, ensuring comprehensive coverage of the new functionality.

Summary by CodeRabbit

Release Notes

  • New Features

    • Email validator now includes configurable support for accepting empty strings as valid input, with strict validation as the default behavior to maintain backward compatibility.
  • Tests

    • Added comprehensive test coverage verifying the new empty string handling configuration works correctly across all validation scenarios.

…vior

Enhance the Email class by introducing an option to allow empty values during validation. This change includes a constructor parameter to set the allowEmpty flag and updates the validation logic accordingly. Additional tests have been added to verify the behavior with allowEmpty enabled and disabled, ensuring comprehensive coverage of the new functionality.
@coderabbitai
Copy link

coderabbitai bot commented Oct 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce configurable empty email validation to the Email validator class. A new constructor parameter allowEmpty (default false) is added to the Email class, along with a protected property to store the configuration. When enabled, empty strings are treated as valid during validation. Three new test cases cover the behavior across disabled, enabled, and default configuration scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a consistent, straightforward pattern: a single boolean constructor parameter with corresponding validation logic modification, and three parallel test cases validating each configuration state. The scope is limited to two files with minimal logic density and repetitive test structure, reducing cognitive overhead for review.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-dep-update

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48d772c and 7e1c8db.

📒 Files selected for processing (2)
  • src/Emails/Validator/Email.php (2 hunks)
  • tests/Validator/EmailTest.php (1 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@eldadfux eldadfux merged commit aebfd79 into main Oct 19, 2025
6 of 7 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