FIX [phpcsfixer][phpstan]

This commit is contained in:
Julie Lenaerts 2023-01-27 12:18:19 +01:00
parent fa8a2c5cc5
commit 1c673db628
6 changed files with 8 additions and 20 deletions

View File

@ -340,11 +340,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1

View File

@ -64,6 +64,5 @@ class AbsenceController extends AbstractController
$em->flush();
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
}
}

View File

@ -12,12 +12,10 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\ChillDateTimeType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;
class AbsenceType extends AbstractType
{

View File

@ -15,7 +15,6 @@ use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\Type\ChillDateTimeType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\PickCivilityType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
@ -33,7 +32,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Regex;
use Symfony\Contracts\Translation\TranslatorInterface;
class UserType extends AbstractType
{

View File

@ -87,7 +87,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'user_job' => $this->normalizer->normalize($object->getUserJob(), $format, $userJobContext),
'main_center' => $this->normalizer->normalize($object->getMainCenter(), $format, $centerContext),
'main_scope' => $this->normalizer->normalize($object->getMainScope(), $format, $scopeContext),
'isAbsent' => $object->isAbsent()
'isAbsent' => $object->isAbsent(),
];
if ('docgen' === $format) {

View File

@ -26,7 +26,6 @@ use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface;
use DateTime;
use Exception;
use libphonenumber\PhoneNumber;
use Symfony\Component\Form\Extension\Core\Type\TelType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Templating\EngineInterface;
@ -116,24 +115,23 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf
{
$string = '@person ';
$string .= empty($data['_default']) ? '' : $data['_default'] . ' ';
$string .= $data['_default'] ? '' : $data['_default'] . ' ';
foreach (['firstname', 'lastname', 'gender', 'city'] as $key) {
$string .= empty($data[$key]) ? '' : $key . ':' .
$string .= $data[$key] ? '' : $key . ':' .
// add quote if contains spaces
(strpos($data[$key], ' ') !== false ? '"' . $data[$key] . '"' : $data[$key])
. ' ';
}
foreach (['birthdate', 'birthdate-before', 'birthdate-after'] as $key) {
$string .= empty($data[$key]) ?
$string .= $data[$key] ?
''
:
$key . ':' . $data[$key]->format('Y-m-d') . ' ';
}
$string .= empty($data['phonenumber']) ? '' : 'phonenumber:' . $data['phonenumber']->getNationalNumber();
$string .= $data['phonenumber'] ? '' : 'phonenumber:' . $data['phonenumber']->getNationalNumber();
return $string;
}
@ -164,13 +162,13 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf
$phonenumber = new PhoneNumber();
$phonenumber->setNationalNumber($terms['phonenumber']);
} catch (Exception $ex) {
throw new ParsingException("The date for {$key} is "
throw new ParsingException('The date for phonenumber is '
. 'not parsable', 0, $ex);
}
$data['phonenumber'] = $phonenumber ?? null;
}
$data['phonenumber'] = $phonenumber ?? null;
return $data;
}