Skip to content

Conversation

@LixNew2
Copy link
Contributor

@LixNew2 LixNew2 commented Oct 15, 2025

Adding a new extension: Country extension

This extension adds the following methods:

country
countryCodeISOAlpha2
countryCodeISOAlpha3

closes #68

Copy link

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 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 CountryExtension class 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.

@15g-lucas
Copy link
Contributor

15g-lucas commented Oct 21, 2025

Can you fix style CI here? :)

@martinsoenen
Copy link
Contributor

I think we can put that in a dedicated package and include all countries in the world in the extension.
@GautierDele What do you think about it ?

Copy link
Contributor

@martinsoenen martinsoenen left a 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

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.

Country Extension

3 participants