mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
cs: Fix code-style (using PHPCSFixer and PHPCS).
This commit is contained in:
@@ -32,6 +32,7 @@ use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function array_keys;
|
||||
use function array_merge;
|
||||
@@ -308,8 +309,10 @@ class ChillImportUsersCommand extends Command
|
||||
|
||||
$permissionGroupsByName = [];
|
||||
|
||||
foreach ($this->em->getRepository(PermissionsGroup::class)
|
||||
->findAll() as $permissionGroup) {
|
||||
foreach (
|
||||
$this->em->getRepository(PermissionsGroup::class)
|
||||
->findAll() as $permissionGroup
|
||||
) {
|
||||
$permissionGroupsByName[$permissionGroup->getName()] = $permissionGroup;
|
||||
}
|
||||
|
||||
@@ -338,11 +341,13 @@ class ChillImportUsersCommand extends Command
|
||||
|
||||
$this->tempOutput->writeln('You have chosen ' . implode(', ', $keys));
|
||||
|
||||
if ($helper->ask(
|
||||
$this->tempInput,
|
||||
$this->tempOutput,
|
||||
new ConfirmationQuestion('Are you sure ?', true)
|
||||
)) {
|
||||
if (
|
||||
$helper->ask(
|
||||
$this->tempInput,
|
||||
$this->tempOutput,
|
||||
new ConfirmationQuestion('Are you sure ?', true)
|
||||
)
|
||||
) {
|
||||
foreach ($keys as $key) {
|
||||
$this->permissionGroups[$alias][] = $permissionGroupsByName[$key];
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
use function in_array;
|
||||
@@ -141,8 +142,10 @@ class ChillUserSendRenewPasswordCodeCommand extends Command
|
||||
|
||||
$headers = $reader->getHeader();
|
||||
|
||||
if (false === in_array('username', $headers, true)
|
||||
&& false === in_array('email', $headers, true)) {
|
||||
if (
|
||||
false === in_array('username', $headers, true)
|
||||
&& false === in_array('email', $headers, true)
|
||||
) {
|
||||
throw new InvalidArgumentException('The csv file does not have an '
|
||||
. 'username or email header');
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/*
|
||||
|
@@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
use function count;
|
||||
|
||||
class LoadPostalCodesCommand extends Command
|
||||
@@ -88,13 +89,15 @@ class LoadPostalCodesCommand extends Command
|
||||
$num = 0;
|
||||
$line = 0;
|
||||
|
||||
while (false !== ($row = fgetcsv(
|
||||
$csv,
|
||||
0,
|
||||
$input->getOption('delimiter'),
|
||||
$input->getOption('enclosure'),
|
||||
$input->getOption('escape')
|
||||
))) {
|
||||
while (
|
||||
false !== ($row = fgetcsv(
|
||||
$csv,
|
||||
0,
|
||||
$input->getOption('delimiter'),
|
||||
$input->getOption('enclosure'),
|
||||
$input->getOption('escape')
|
||||
))
|
||||
) {
|
||||
try {
|
||||
$this->addPostalCode($row, $output);
|
||||
++$num;
|
||||
|
Reference in New Issue
Block a user