xefi / faker-php-locales-en-ca
Faker extension to include en_CA locale
v1.0.1
2026-11-18 10:25 UTC
Requires
- php: ^8.3
- psr/container: ^2.0
- xefi/faker-php: ^1.5.3
Requires (Dev)
- phpunit/phpunit: ^11
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Canadian English (en_CA) locale for Faker PHP.
Installation
composer require --dev xefi/faker-php-locales-en-ca
The service provider is discovered automatically through Composer.
Usage
use Xefi\Faker\Faker; $faker = new Faker('en_CA');
Generators without a en_CA variant fall back to the default locale.
Locale-specific generators
$faker->province(); // 'Ontario' $faker->provinceCode(); // 'ON' $faker->postcode(); // 'K1A 0B1' $faker->sin(); // Social Insurance Number, valid Luhn check digit $faker->businessNumber(); // 9-digit Business Number, valid Luhn check digit
Canada does not use IBAN: iban() returns an IBAN-shaped CA string built from a transit, institution and account number.
Contributing
- Fork the repository and create a branch from
main. - Add an extension under
src/Extensions/and register it inFakerEnCaServiceProvider::boot(). - Add a test under
tests/Unit/. - Run the suite with
vendor/bin/phpunit(ordocker compose run php vendor/bin/phpunit). - Open a pull request against
main.
License
MIT