mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -20,7 +20,6 @@ use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodResourceVoter;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Exception;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
@@ -28,8 +27,6 @@ use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* Class ChillPersonExtension
|
||||
* Loads and manages your bundle configuration.
|
||||
@@ -39,7 +36,7 @@ use function array_key_exists;
|
||||
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
/**
|
||||
* @throws Exception
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
@@ -73,7 +70,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
// register all configuration in a unique parameter
|
||||
$container->setParameter('chill_person', $config);
|
||||
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
||||
$loader->load('services.yaml');
|
||||
$loader->load('services/widgets.yaml');
|
||||
$loader->load('services/fixtures.yaml');
|
||||
@@ -97,7 +94,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
|
||||
$loader->load('services/exports_person.yaml');
|
||||
|
||||
if ($container->getParameter('chill_person.accompanying_period') !== 'hidden') {
|
||||
if ('hidden' !== $container->getParameter('chill_person.accompanying_period')) {
|
||||
$loader->load('services/exports_accompanying_course.yaml');
|
||||
$loader->load('services/exports_social_actions.yaml');
|
||||
$loader->load('services/exports_evaluation.yaml');
|
||||
@@ -117,7 +114,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
$this->prependCruds($container);
|
||||
$this->prependWorkflows($container);
|
||||
|
||||
//add person_fields parameter as global
|
||||
// add person_fields parameter as global
|
||||
$chillPersonConfig = $container->getExtensionConfig($this->getAlias());
|
||||
$config = $this->processConfiguration(new Configuration(), $chillPersonConfig);
|
||||
$twigConfig = [
|
||||
@@ -135,7 +132,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
|
||||
$this->declarePersonAsCustomizable($container);
|
||||
|
||||
//declare routes for person bundle
|
||||
// declare routes for person bundle
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'routing' => [
|
||||
'resources' => [
|
||||
@@ -918,7 +915,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
*/
|
||||
protected function prependDoctrineDQL(ContainerBuilder $container)
|
||||
{
|
||||
//add DQL function to ORM (default entity_manager)
|
||||
// add DQL function to ORM (default entity_manager)
|
||||
|
||||
$container->prependExtensionConfig('doctrine', [
|
||||
'orm' => [
|
||||
@@ -1026,7 +1023,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'mark_inactive_long' => [
|
||||
'from' => [
|
||||
AccompanyingPeriod::STEP_CONFIRMED,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT,
|
||||
],
|
||||
'to' => AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG,
|
||||
],
|
||||
@@ -1035,7 +1032,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT,
|
||||
],
|
||||
'to' => AccompanyingPeriod::STEP_CONFIRMED
|
||||
'to' => AccompanyingPeriod::STEP_CONFIRMED,
|
||||
],
|
||||
'close' => [
|
||||
'from' => [
|
||||
@@ -1071,9 +1068,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $config
|
||||
*/
|
||||
private function handleAccompanyingPeriodsFieldsParameters(ContainerBuilder $container, $config)
|
||||
{
|
||||
$container->setParameter('chill_person.accompanying_period_fields', $config);
|
||||
@@ -1084,19 +1078,16 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
break;
|
||||
|
||||
default:
|
||||
$container->setParameter('chill_person.accompanying_period_fields.' . $key, $value);
|
||||
$container->setParameter('chill_person.accompanying_period_fields.'.$key, $value);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $config
|
||||
*/
|
||||
private function handlePersonFieldsParameters(ContainerBuilder $container, $config)
|
||||
{
|
||||
if (array_key_exists('enabled', $config)) {
|
||||
if (\array_key_exists('enabled', $config)) {
|
||||
unset($config['enabled']);
|
||||
}
|
||||
|
||||
@@ -1105,7 +1096,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
foreach ($config as $key => $value) {
|
||||
match ($key) {
|
||||
'accompanying_period' => $container->setParameter('chill_person.accompanying_period', $value),
|
||||
default => $container->setParameter('chill_person.person_fields.' . $key, $value),
|
||||
default => $container->setParameter('chill_person.person_fields.'.$key, $value),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user