mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
FIX [phpcsfixer][phpstan]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user