mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 13:54:59 +00:00
fix: Use odolbeau/phone-number-bundle
for formatting phone number type fields.
There is no need to use the bundle, we could have used the library instead. However, this idea is to switch to that bundle at some point.
This commit is contained in:
@@ -14,19 +14,16 @@ namespace Chill\MainBundle\Phonenumber;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
class Templating extends AbstractExtension
|
||||
final class Templating extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* @var PhonenumberHelper
|
||||
*/
|
||||
protected $phonenumberHelper;
|
||||
protected PhoneNumberHelperInterface $phonenumberHelper;
|
||||
|
||||
public function __construct(PhonenumberHelper $phonenumberHelper)
|
||||
public function __construct(PhoneNumberHelperInterface $phonenumberHelper)
|
||||
{
|
||||
$this->phonenumberHelper = $phonenumberHelper;
|
||||
}
|
||||
|
||||
public function formatPhonenumber($phonenumber)
|
||||
public function formatPhonenumber(string $phonenumber): string
|
||||
{
|
||||
return $this->phonenumberHelper->format($phonenumber) ?? $phonenumber;
|
||||
}
|
||||
|
Reference in New Issue
Block a user