Skip to content

Commit 18cc792

Browse files
authored
Merge pull request #1 from xefi/feature/null-locale
✨ null locale
2 parents 8f8f10f + a2bd03d commit 18cc792

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* @param string|null $locale
88
*/
9-
function faker(string $locale = '') : \Xefi\Faker\Faker
9+
function faker(null|string $locale = '') : \Xefi\Faker\Faker
1010
{
1111
if ($locale === '') {
1212
$locale = app()->bound('config') ?

tests/Unit/HelperTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ public function testFakerHelper() {
1111

1212
$this->assertInstanceOf(Faker::class, $faker);
1313
}
14+
15+
public function testFakerHelperWithNullLocale() {
16+
$faker = faker(null);
17+
18+
$this->assertEquals(null, $faker->getLocale());
19+
}
1420
}

0 commit comments

Comments
 (0)