Conversation
There was a problem hiding this comment.
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.
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