-
Notifications
You must be signed in to change notification settings - Fork 4
country extension #69
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR introduces a Country extension that provides methods for generating random country names and their ISO 3166-1 alpha-2 and alpha-3 country codes. The extension is registered with the service provider and includes basic test coverage.
Key changes:
- New
CountryExtensionclass with methods for country names and ISO codes - Registration of the extension in
FakerServiceProvider - Unit tests validating the format of generated country data
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Extensions/CountryExtension.php | Implements the country extension with data array and three public methods |
| src/FakerServiceProvider.php | Registers the CountryExtension in the boot method |
| tests/Unit/Extensions/CountryExtensionTest.php | Adds unit tests for all three country methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Can you fix style CI here? :) |
|
I think we can put that in a dedicated package and include all countries in the world in the extension. |
martinsoenen
left a 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.
Just created a repo so you can put the extension on it @LixNew2
-> https://github.com/xefi/faker-php-countries
Adding a new extension: Country extension
This extension adds the following methods:
country
countryCodeISOAlpha2
countryCodeISOAlpha3
closes #68