From 7afada5dad29d34a981baf5c60ff8955e6b3a2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 6 Mar 2022 22:36:38 +0100 Subject: [PATCH] fix cs --- src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php | 2 ++ src/Bundle/ChillPersonBundle/Entity/PersonPhone.php | 2 +- src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php index 8fdaf2596..22f580d78 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -92,9 +92,11 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface switch ($this->phoneNumberUtil->getNumberType($phonenumber)) { case PhoneNumberType::MOBILE: return 'mobile'; + case PhoneNumberType::FIXED_LINE: case PhoneNumberType::VOIP: return 'landline'; + default: return 'landline'; } diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonPhone.php b/src/Bundle/ChillPersonBundle/Entity/PersonPhone.php index 7d0bce1ff..7f0e28ddb 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonPhone.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonPhone.php @@ -98,7 +98,7 @@ class PersonPhone public function isEmpty(): bool { - return ("" === $this->getDescription() || null === $this->getDescription()) + return ('' === $this->getDescription() || null === $this->getDescription()) && null === $this->getPhonenumber(); } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php index 1910d4605..3b1de28c7 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php @@ -16,7 +16,6 @@ use Chill\MainBundle\Phonenumber\PhonenumberHelper; use Chill\PersonBundle\Entity\PersonPhone; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\TelType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormEvent;