Skip to content

Commit 8f8f10f

Browse files
committed
Update helpers.php
1 parent 0735548 commit 8f8f10f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/helpers.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
*
77
* @param string|null $locale
88
*/
9-
function faker(string $locale = null) : \Xefi\Faker\Faker
9+
function faker(string $locale = '') : \Xefi\Faker\Faker
1010
{
11-
if (app()->bound('config')) {
12-
$locale ??= app('config')->get('app.faker_locale');
11+
if ($locale === '') {
12+
$locale = app()->bound('config') ?
13+
app('config')->get('app.faker_locale')
14+
: 'en_US';
1315
}
1416

15-
$locale ??= 'en_US';
16-
1717
$abstract = \Xefi\Faker\Faker::class.':'.$locale;
1818

1919
if (! app()->bound($abstract)) {

0 commit comments

Comments
 (0)