Skip to content

Commit 3cab8c1

Browse files
sertxudevgithub-actions[bot]
authored andcommitted
Fix code styling
1 parent 67e692a commit 3cab8c1

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/Traits/HasTranslations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait HasTranslations
1010
/**
1111
* Get the translated $attribute if not exist return the fallback translation
1212
*/
13-
public function getTranslated(string $attribute, string $lang = null): string {
13+
public function getTranslated(string $attribute, ?string $lang = null): string {
1414
if (!$lang) {
1515
$lang = App::getLocale();
1616
}

src/Translatable.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Translatable
1212
/**
1313
* Check if the provided locale is within the supported locales.
1414
*
15-
* @param string $locale The locale to check.
15+
* @param string $locale The locale to check.
1616
*/
1717
public function checkLocaleInSupportedLocales(string $locale): bool {
1818
$locales = config('translatable.locales');
@@ -43,7 +43,7 @@ public function getLocaleFromRequest(): string {
4343
/**
4444
* Check if the provided locale is the fallback locale.
4545
*
46-
* @param string $locale The locale to check.
46+
* @param string $locale The locale to check.
4747
*/
4848
public function isFallbackLocale(string $locale): bool {
4949
return config('translatable.fallback_locale') === $locale;
@@ -59,13 +59,13 @@ public function isFallbackLocaleHidden(): bool {
5959
/**
6060
* Given a route name or path, return it localized if possible.
6161
*
62-
* @param string $name The route name or path to localize.
63-
* @param mixed $parameters The route parameters.
64-
* @param bool $absolute Whether to return an absolute URL.
65-
* @param string|null $locale The locale to use.
62+
* @param string $name The route name or path to localize.
63+
* @param mixed $parameters The route parameters.
64+
* @param bool $absolute Whether to return an absolute URL.
65+
* @param string|null $locale The locale to use.
6666
* @return string The localized route.
6767
*/
68-
public function route(string $name, $parameters = [], bool $absolute = false, string $locale = null): string {
68+
public function route(string $name, $parameters = [], bool $absolute = false, ?string $locale = null): string {
6969
$name = $this->stripLocaleFromRouteName($name);
7070

7171
$currentLocale = $this->getLocaleFromRequest();
@@ -108,7 +108,7 @@ public function route(string $name, $parameters = [], bool $absolute = false, st
108108
/**
109109
* Get the current path localized with the provided locale.
110110
*
111-
* @param string $locale The locale to use.
111+
* @param string $locale The locale to use.
112112
* @return string The localized path.
113113
*/
114114
public function switchToLocale(string $locale): string {
@@ -141,7 +141,7 @@ public function switchToLocale(string $locale): string {
141141
/**
142142
* Strip the locale from the beginning of a route name.
143143
*
144-
* @param string $name The route name to strip.
144+
* @param string $name The route name to strip.
145145
* @return string The stripped route name.
146146
*/
147147
protected function stripLocaleFromRouteName(string $name): string {

0 commit comments

Comments
 (0)