mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Enable more risky rules.
This commit is contained in:
@@ -38,7 +38,11 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Form\FormFactory;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function file_get_contents;
|
||||
use function get_class;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
use function json_decode;
|
||||
|
||||
final class ImportPeopleFromCSVCommand extends Command
|
||||
@@ -352,7 +356,7 @@ final class ImportPeopleFromCSVCommand extends Command
|
||||
}
|
||||
|
||||
// handle address
|
||||
if (\in_array('postalcode', $headers)) {
|
||||
if (in_array('postalcode', $headers)) {
|
||||
if (!empty($postalCodeValue)) {
|
||||
$address = new Address();
|
||||
$postalCode = $this->guessPostalCode($postalCodeValue, $localityValue ?? '');
|
||||
@@ -363,7 +367,7 @@ final class ImportPeopleFromCSVCommand extends Command
|
||||
|
||||
$address->setPostcode($postalCode);
|
||||
|
||||
if (\in_array('street1', $headers)) {
|
||||
if (in_array('street1', $headers)) {
|
||||
$address->setStreetAddress1($street1Value);
|
||||
}
|
||||
$address->setValidFrom(new DateTime('today'));
|
||||
@@ -516,13 +520,13 @@ final class ImportPeopleFromCSVCommand extends Command
|
||||
->getResult();
|
||||
|
||||
if (count($centers) > 1) {
|
||||
if (\strtolower($centers[0]->getName()) === \strtolower($centerName)) {
|
||||
if (strtolower($centers[0]->getName()) === strtolower($centerName)) {
|
||||
return $centers[0];
|
||||
}
|
||||
}
|
||||
|
||||
$centersByName = [];
|
||||
$names = \array_map(function (Center $c) use (&$centersByName) {
|
||||
$names = array_map(function (Center $c) use (&$centersByName) {
|
||||
$n = $c->getName();
|
||||
$centersByName[$n] = $c;
|
||||
|
||||
@@ -605,7 +609,7 @@ final class ImportPeopleFromCSVCommand extends Command
|
||||
}
|
||||
|
||||
$postalCodeByName = [];
|
||||
$names = \array_map(function (PostalCode $pc) use (&$postalCodeByName) {
|
||||
$names = array_map(function (PostalCode $pc) use (&$postalCodeByName) {
|
||||
$n = $pc->getName();
|
||||
$postalCodeByName[$n] = $pc;
|
||||
|
||||
|
Reference in New Issue
Block a user