Skip to content

Commit

Permalink
force ltr
Browse files Browse the repository at this point in the history
  • Loading branch information
emargareten authored Aug 18, 2024
1 parent 7bedf5e commit a9bfe51
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
28 changes: 14 additions & 14 deletions src/Infolists/PhoneEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,33 @@ public function displayFormat(PhoneInputNumberType $format)

$format = $format->toLibPhoneNumberFormat();

if ($format === PhoneNumberFormat::RFC3966) {
$formatted = phone(
number: $state,
country: $country,
format: $format
);
$formatted = phone(
number: $state,
country: $country,
format: $format
);

if ($format === PhoneNumberFormat::RFC3966) {
$national = phone(
number: $state,
country: $country,
format: PhoneNumberFormat::NATIONAL
);

$html = <<<HTML
<a href="$formatted">
<a href="$formatted" dir="ltr">
$national
</a>
HTML;

return new HtmlString($html);
} else {
$html = <<<HTML
<span dir="ltr">
$formatted
</span>
HTML;
}

return phone(
number: $state,
country: $country,
format: $format
);
return new HtmlString($html);
} catch (NumberParseException $e) {
return $state;
}
Expand Down
29 changes: 16 additions & 13 deletions src/Tables/PhoneColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,36 @@ public function displayFormat(PhoneInputNumberType $format)

$format = $format->toLibPhoneNumberFormat();

if ($format === PhoneNumberFormat::RFC3966) {
$formatted = phone(
number: $state,
country: $country,
format: $format
);
$formatted = phone(
number: $state,
country: $country,
format: $format
);

if ($format === PhoneNumberFormat::RFC3966) {
$national = phone(
number: $state,
country: $country,
format: PhoneNumberFormat::NATIONAL
);

$html = <<<HTML
<a href="$formatted">
<a href="$formatted" dir="ltr">
$national
</a>
HTML;

return new HtmlString($html);

} else {
$html = <<<HTML
<span dir="ltr">
$formatted
</span>
HTML;
}

return phone(
number: $state,
country: $country,
format: $format
);

return new HtmlString($html);
} catch (NumberParseException $e) {
return $state;
}
Expand Down

0 comments on commit a9bfe51

Please sign in to comment.