mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 15:25:00 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -17,10 +17,7 @@ use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Intl\Intl;
|
||||
|
||||
use Symfony\Component\Intl\Languages;
|
||||
use function in_array;
|
||||
|
||||
/*
|
||||
* Load or update the languages entities command
|
||||
@@ -41,8 +38,6 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
|
||||
/**
|
||||
* LoadCountriesCommand constructor.
|
||||
*
|
||||
* @param $availableLanguages
|
||||
*/
|
||||
public function __construct(private readonly EntityManager $entityManager, private $availableLanguages)
|
||||
{
|
||||
@@ -58,21 +53,21 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
{
|
||||
$this
|
||||
->setName('chill:main:languages:populate')
|
||||
->setDescription('Load or update languages in db. This command does not delete existing ' .
|
||||
->setDescription('Load or update languages in db. This command does not delete existing '.
|
||||
'languages, but will update names according to available languages')
|
||||
->addOption(
|
||||
self::INCLUDE_REGIONAL_VERSION,
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'Include the regional languages. The regional languages are languages with code containing _ excepted '
|
||||
. implode(',', $this->regionalVersionToInclude) . '.'
|
||||
.implode(',', $this->regionalVersionToInclude).'.'
|
||||
)
|
||||
->addOption(
|
||||
self::INCLUDE_ANCIENT,
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'Include the ancient languages that are languages with code '
|
||||
. implode(', ', $this->ancientToExclude) . '.'
|
||||
.implode(', ', $this->ancientToExclude).'.'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -96,10 +91,10 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
(
|
||||
!$input->getOption(self::INCLUDE_REGIONAL_VERSION)
|
||||
&& strpos($code, '_')
|
||||
&& !in_array($code, $this->regionalVersionToInclude, true)
|
||||
&& !\in_array($code, $this->regionalVersionToInclude, true)
|
||||
) || (
|
||||
!$input->getOption(self::INCLUDE_ANCIENT)
|
||||
&& in_array($code, $this->ancientToExclude, true)
|
||||
&& \in_array($code, $this->ancientToExclude, true)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -125,6 +120,7 @@ class LoadAndUpdateLanguagesCommand extends Command
|
||||
}
|
||||
|
||||
$em->flush();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user