diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f76ec4b98..8600f7e3f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -60,7 +60,7 @@ code_style:
- bin
- tests/app/vendor/
-sa_tests:
+phpstan_tests:
stage: Tests
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
script:
@@ -71,6 +71,17 @@ sa_tests:
- bin
- tests/app/vendor/
+psalm_tests:
+ stage: Tests
+ image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
+ script:
+ - bin/grumphp run --tasks=psalm
+ artifacts:
+ expire_in: 30 min
+ paths:
+ - bin
+ - tests/app/vendor/
+
unit_tests:
stage: Tests
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
diff --git a/composer.json b/composer.json
index 6e18ea69a..a46446531 100644
--- a/composer.json
+++ b/composer.json
@@ -8,9 +8,10 @@
],
"license": "AGPL-3.0-only",
"require": {
- "champs-libres/async-uploader-bundle": "dev-sf4",
- "champs-libres/wopi-bundle": "dev-master",
- "composer/package-versions-deprecated": "^1.10",
+ "php": "^7.4",
+ "champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
+ "champs-libres/wopi-bundle": "dev-master#59b468503b9413f8d588ef9e626e7675560db3d8",
+ "ocramius/package-versions": "^1.10",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.7",
@@ -25,28 +26,28 @@
"ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^5.5",
"spomky-labs/base64url": "^2.0",
- "symfony/asset": "4.*",
- "symfony/browser-kit": "^5.2",
- "symfony/css-selector": "^5.2",
- "symfony/expression-language": "4.*",
- "symfony/form": "4.*",
- "symfony/intl": "4.*",
- "symfony/mime": "^4 || ^5",
+ "symfony/asset": "^4.4",
+ "symfony/browser-kit": "^4.4",
+ "symfony/css-selector": "^4.4",
+ "symfony/expression-language": "^4.4",
+ "symfony/form": "^4.4",
+ "symfony/intl": "^4.4",
+ "symfony/mime": "^4.4",
"symfony/monolog-bundle": "^3.5",
- "symfony/security-bundle": "4.*",
- "symfony/serializer": "^5.2",
+ "symfony/security-bundle": "^4.4",
+ "symfony/serializer": "^5.3",
"symfony/swiftmailer-bundle": "^3.5",
- "symfony/templating": "4.*",
- "symfony/translation": "4.*",
+ "symfony/templating": "^4.4",
+ "symfony/translation": "^4.4",
"symfony/twig-bundle": "^4.4",
- "symfony/validator": "4.*",
+ "symfony/validator": "^4.4",
"symfony/webpack-encore-bundle": "^1.11",
- "symfony/workflow": "4.*",
- "symfony/yaml": "4.*",
- "twig/extra-bundle": "^2.12 || ^3.0",
+ "symfony/workflow": "^4.4",
+ "symfony/yaml": "^4.4",
+ "twig/extra-bundle": "^3.0",
"twig/intl-extra": "^3.0",
"twig/markdown-extra": "^3.3",
- "twig/twig": "^2.12 || ^3.0"
+ "twig/twig": "^3.0"
},
"conflict": {
"symfony/symfony": "*"
@@ -57,17 +58,20 @@
"fakerphp/faker": "^1.13",
"nelmio/alice": "^3.8",
"phpstan/phpstan-strict-rules": "^1.0",
- "phpunit/phpunit": "^7.0",
+ "phpunit/phpunit": ">= 7.5",
"symfony/debug-bundle": "^5.1",
- "symfony/dotenv": "^5.1",
+ "symfony/dotenv": "^4.4",
"symfony/maker-bundle": "^1.20",
- "symfony/phpunit-bridge": "^5.2",
- "symfony/stopwatch": "^5.1",
- "symfony/var-dumper": "4.*",
- "symfony/web-profiler-bundle": "^5.0"
+ "symfony/phpunit-bridge": "^4.4",
+ "symfony/stopwatch": "^4.4",
+ "symfony/var-dumper": "^4.4",
+ "symfony/web-profiler-bundle": "^4.4",
+ "vimeo/psalm": "^4.15"
},
"config": {
"bin-dir": "bin",
+ "optimize-autoloader": true,
+ "sort-packages": true,
"vendor-dir": "tests/app/vendor"
},
"autoload": {
diff --git a/docs/source/_static/code/exports/CountPerson.php b/docs/source/_static/code/exports/CountPerson.php
index 98c4fcd00..dd95f3c88 100644
--- a/docs/source/_static/code/exports/CountPerson.php
+++ b/docs/source/_static/code/exports/CountPerson.php
@@ -91,7 +91,9 @@ class CountPerson implements ExportInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// we gather all center the user choose.
- $centers = array_map(static function ($el) { return $el['center']; }, $acl);
+ $centers = array_map(static function ($el) {
+ return $el['center'];
+ }, $acl);
$qb = $this->entityManager->createQueryBuilder();
diff --git a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php
index 2786b3376..d11225245 100644
--- a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php
+++ b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php
@@ -11,53 +11,53 @@ declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection;
- use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
- use Symfony\Component\Config\Definition\Builder\TreeBuilder;
- use Symfony\Component\Config\Definition\ConfigurationInterface;
- use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
- /**
- * Configure the main bundle.
- */
- class ChillMainConfiguration implements ConfigurationInterface
- {
- use AddWidgetConfigurationTrait;
+/**
+ * Configure the main bundle.
+ */
+class ChillMainConfiguration implements ConfigurationInterface
+{
+ use AddWidgetConfigurationTrait;
- /**
- * @var ContainerBuilder
- */
- private $containerBuilder;
+ /**
+ * @var ContainerBuilder
+ */
+ private $containerBuilder;
- public function __construct(
- array $widgetFactories,
- ContainerBuilder $containerBuilder
- ) {
- // we register here widget factories (see below)
- $this->setWidgetFactories($widgetFactories);
- // we will need the container builder later...
- $this->containerBuilder = $containerBuilder;
- }
+ public function __construct(
+ array $widgetFactories,
+ ContainerBuilder $containerBuilder
+ ) {
+ // we register here widget factories (see below)
+ $this->setWidgetFactories($widgetFactories);
+ // we will need the container builder later...
+ $this->containerBuilder = $containerBuilder;
+ }
- public function getConfigTreeBuilder()
- {
- $treeBuilder = new TreeBuilder();
- $rootNode = $treeBuilder->root('chill_main');
+ public function getConfigTreeBuilder()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('chill_main');
- $rootNode
- ->children()
+ $rootNode
+ ->children()
- // ...
- ->arrayNode('widgets')
- ->canBeDisabled()
- ->children()
- // we declare here all configuration for homepage place
- ->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
- ->end() // end of widgets/children
- ->end() // end of widgets
- ->end() // end of root/children
- ->end() // end of root
+ // ...
+ ->arrayNode('widgets')
+ ->canBeDisabled()
+ ->children()
+ // we declare here all configuration for homepage place
+ ->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
+ ->end() // end of widgets/children
+ ->end() // end of widgets
+ ->end() // end of root/children
+ ->end() // end of root
;
- return $treeBuilder;
- }
- }
+ return $treeBuilder;
+ }
+}
diff --git a/grumphp.yml b/grumphp.yml
index d25cc01ba..8efce6109 100644
--- a/grumphp.yml
+++ b/grumphp.yml
@@ -12,3 +12,28 @@ parameters:
tasks.phpcsfixer.allow_risky: true
tasks.phpcsfixer.diff: true
tasks.phpstan.level: 1
+ tasks.phpstan.blocking: true
+ tasks.phpstan.ignore_patterns:
+ - "/.github/"
+ - "/.idea/"
+ - "/build/"
+ - "/benchmarks/"
+ - "/docs/"
+ - "/node_modules/"
+ - "/resource/"
+ - "/spec/"
+ - "/var/"
+ - "/vendor/"
+
+ # Psalm
+ tasks.psalm.blocking: true
+ tasks.psalm.ignore_patterns:
+ - "/.github/"
+ - "/.idea/"
+ - "/build/"
+ - "/benchmarks/"
+ - "/node_modules/"
+ - "/resource/"
+ - "/spec/"
+ - "/var/"
+ - "/vendor/"
diff --git a/phpstan-deprecations.neon b/phpstan-deprecations.neon
index 05442b25a..24deda05f 100644
--- a/phpstan-deprecations.neon
+++ b/phpstan-deprecations.neon
@@ -417,15 +417,6 @@ parameters:
count: 1
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
- -
- message:
- """
- #^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
- since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
- """
- count: 3
- path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
-
-
message:
"""
@@ -435,15 +426,6 @@ parameters:
count: 1
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
- -
- message:
- """
- #^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
- since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
- """
- count: 1
- path: src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php
-
-
message:
"""
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
new file mode 100644
index 000000000..33107d40b
--- /dev/null
+++ b/psalm-baseline.xml
@@ -0,0 +1,2006 @@
+
+
+
+
+ 'ChillActivityBundle:ActivityReasonCategory'
+ 'ChillActivityBundle:ActivityReasonCategory'
+ 'ChillActivityBundle:ActivityReasonCategory'
+ 'ChillActivityBundle:ActivityReasonCategory'
+
+
+
+
+ 'ChillActivityBundle:ActivityReason'
+ 'ChillActivityBundle:ActivityReason'
+ 'ChillActivityBundle:ActivityReason'
+ 'ChillActivityBundle:ActivityReason'
+
+
+
+
+ $socialIssue
+
+
+
+
+ $qb
+
+
+
+
+ $qb
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ $person
+
+
+
+
+ Activity[]|array
+ Activity[]|array
+
+
+
+
+ require __DIR__ . '/../../../../../vendor/autoload.php'
+
+
+
+
+ return trigger_error($e, E_USER_ERROR);
+
+
+ $baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(dirname($baseUrl),'/'.DIRECTORY_SEPARATOR).'/')
+
+
+ $files
+ $files
+
+
+
+
+ addProvider
+ addProvider
+ new \Chill\CustomFieldsBundle\Form\CustomFieldType($this->get('chill.custom_field.provider'))
+ new \Chill\CustomFieldsBundle\Templating\Twig\CustomFieldRenderingTwig()
+ new \Chill\MainBundle\Form\Type\Select2CountryType($this->get('request_stack'), $this->get('doctrine.orm.default_entity_manager'))
+ new \Chill\MainBundle\Form\Type\Select2LanguageType($this->get('request_stack'), $this->get('doctrine.orm.default_entity_manager'))
+ new \Chill\MainBundle\Routing\MenuComposer()
+ new \Chill\MainBundle\Security\Authorization\AuthorizationHelper($this->get('security.role_hierarchy'))
+ new \Chill\MainBundle\Templating\TranslatableStringHelper($this->get('request_stack'), $this->get('translator.default'))
+ new \Chill\MainBundle\Templating\TranslatableStringTwig()
+ new \Chill\PersonBundle\Search\PersonSearch($this->get('doctrine.orm.default_entity_manager'), $this->get('security.token_storage'), $this->get('chill.main.security.authorization.helper'))
+ new \Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodClosing($this->get('doctrine.orm.default_entity_manager'))
+ new \Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodOpening($this->get('doctrine.orm.default_entity_manager'))
+
+
+ InactiveScopeException
+ InactiveScopeException
+ \Assetic\Cache\ConfigCache
+ \Assetic\Extension\Twig\TwigFormulaLoader
+ \Assetic\Factory\LazyAssetManager
+ \Assetic\Factory\Loader\CachedFormulaLoader
+ \Assetic\Filter\CssRewriteFilter
+ \Chill\MainBundle\Form\Type\CenterType
+ \Chill\PersonBundle\Form\Type\ClosingMotiveType
+ \Doctrine\Common\Cache\ArrayCache
+ \Doctrine\Common\Cache\ArrayCache
+ \Doctrine\Common\Cache\ArrayCache
+ \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain
+ \SensioLabs\Security\Command\SecurityCheckerCommand
+ \SensioLabs\Security\SecurityChecker
+ \Sensio\Bundle\DistributionBundle\Configurator\Configurator
+ \Sensio\Bundle\DistributionBundle\Configurator\Step\DoctrineStep
+ \Sensio\Bundle\DistributionBundle\Configurator\Step\SecretStep
+ \Symfony\Bridge\Monolog\Handler\DebugHandler
+ \Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer
+ \Symfony\Bundle\AsseticBundle\DefaultValueSupplier
+ \Symfony\Bundle\AsseticBundle\Factory\AssetFactory
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource
+ \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource
+ \Symfony\Bundle\AsseticBundle\FilterManager
+ \Symfony\Bundle\AsseticBundle\Twig\AsseticExtension
+ \Symfony\Bundle\FrameworkBundle\DataCollector\AjaxDataCollector
+ \Symfony\Bundle\FrameworkBundle\EventListener\SessionListener
+ \Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener
+ \Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor
+ \Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader
+ \Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory
+ \Symfony\Bundle\TwigBundle\Extension\ActionsExtension
+ \Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
+ \Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter
+ \Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel
+ \Symfony\Component\Security\Core\SecurityContext
+ \Symfony\Component\Security\Core\Util\SecureRandom
+ \Twig_Environment
+ \Twig_Extension_Debug
+ \Twig_Extensions_Extension_Intl
+ \Twig_Profiler_Profile
+
+
+ InactiveScopeException
+ InactiveScopeException
+ \Assetic\Factory\LazyAssetManager
+ \Assetic\Filter\CssRewriteFilter
+ \Chill\MainBundle\Form\Type\CenterType
+ \Chill\PersonBundle\Form\Type\ClosingMotiveType
+ \Doctrine\Common\Cache\ArrayCache
+ \Doctrine\Common\Cache\ArrayCache
+ \Doctrine\Common\Cache\ArrayCache
+ \SensioLabs\Security\Command\SecurityCheckerCommand
+ \SensioLabs\Security\SecurityChecker
+ \Sensio\Bundle\DistributionBundle\Configurator\Configurator
+ \Symfony\Bridge\Monolog\Handler\DebugHandler
+ \Symfony\Bundle\AsseticBundle\Factory\AssetFactory
+ \Symfony\Bundle\AsseticBundle\FilterManager
+ \Symfony\Bundle\FrameworkBundle\EventListener\SessionListener
+ \Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener
+ \Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor
+ \Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader
+ \Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter
+ \Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel
+ \Symfony\Component\Security\Core\SecurityContext
+ \Symfony\Component\Security\Core\Util\SecureRandom
+ \Twig_Environment
+ \Twig_Extensions_Extension_Intl
+ \Twig_Profiler_Profile
+
+
+
+
+ type
+ type
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+ \Chill\PersonBundle\Export\Filter\PersonHavingActivityBetweenDateFilter
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+ Prophecy\Prophet
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+ type
+
+
+
+
+ $activity
+
+
+
+
+ $createdAt
+ $createdBy
+ $updatedAt
+ $updatedBy
+
+
+
+
+ $asideActivityCategory
+ $asideActivityCategory
+ $asideActivityCategory
+
+
+
+
+ public function setUp()
+
+
+
+
+ $calculator::getAlias()
+ $calculator::getAlias()
+ $calculator::getAlias()
+
+
+
+
+ decimal
+
+
+
+
+ AbstractMigration
+
+
+
+
+ $qb
+
+
+
+
+ 'ChillCalendarBundle:Calendar'
+ 'ChillCalendarBundle:Calendar'
+ 'ChillCalendarBundle:Calendar'
+
+
+
+
+ public function setUp()
+
+
+
+
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+
+
+
+
+ 'ChillCustomFieldsBundle:CustomField'
+
+
+
+
+ 'ChillCustomFieldsBundle:CustomFieldsDefaultGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+
+
+
+
+ $date
+
+
+
+
+ \Chill\CustomFieldsBundle\CustomField\CustomField
+ \Chill\CustomFieldsBundle\CustomField\CustomField
+ \Chill\CustomFieldsBundle\CustomField\CustomField
+ \Chill\CustomFieldsBundle\CustomField\CustomField
+ \Chill\CustomFieldsBundle\CustomField\FormBuilderInterface
+ \Chill\CustomFieldsBundle\CustomField\FormBuilderInterface
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ $customFieldsGroup
+ $id
+
+
+
+
+ $customFieldsArray
+ $customFieldsJSON
+
+
+
+
+ $this->customFieldCompiler
+ CustomFieldCompiler
+
+
+
+
+ AppKernel
+
+
+
+
+ require __DIR__ . '/../../../../../vendor/autoload.php'
+
+
+
+
+ require_once __DIR__ . '/../app/bootstrap.php.cache'
+
+
+
+
+ Container
+ CustomFieldInterface
+ type
+ type
+
+
+
+
+ $customFieldType
+ $customFieldType
+ $customFieldType
+ The
+
+
+
+
+ CustomFieldsGroud
+
+
+
+
+ type
+
+
+ type
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ type
+ type
+ type
+ type
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ 'ChillDocStoreBundle:AccompanyingCourseDocument'
+
+
+
+
+ 'ChillDocStoreBundle:DocumentCategory'
+ 'ChillDocStoreBundle:DocumentCategory'
+ 'ChillDocStoreBundle:DocumentCategory'
+
+
+
+
+ 'ChillDocStoreBundle:PersonDocument'
+
+
+
+
+ \Chill\PersonBundle\Entity\user
+
+
+
+
+ $this->getPerson()
+ \Chill\MainBundle\Entity\Person
+
+
+
+
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Participation'
+ 'ChillEventBundle:Participation'
+ 'ChillPersonBundle:Person'
+
+
+
+
+ 'ChillEventBundle:EventType'
+ 'ChillEventBundle:EventType'
+ 'ChillEventBundle:EventType'
+ 'ChillEventBundle:EventType'
+ 'ChillEventBundle:EventType'
+
+
+
+
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Participation'
+ 'ChillPersonBundle:Person'
+
+
+ $participation
+ $participation
+ $participation
+ $participation
+ $participations[0]
+ Participation|Participations[]
+
+
+
+
+ 'ChillEventBundle:Role'
+ 'ChillEventBundle:Role'
+ 'ChillEventBundle:Role'
+ 'ChillEventBundle:Role'
+ 'ChillEventBundle:Role'
+
+
+
+
+ 'ChillEventBundle:Status'
+ 'ChillEventBundle:Status'
+ 'ChillEventBundle:Status'
+ 'ChillEventBundle:Status'
+ 'ChillEventBundle:Status'
+
+
+
+
+ 'ChillMainBundle:Center'
+ 'ChillPersonBundle:Person'
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ AppKernel
+
+
+
+
+ type
+
+
+ public function setUp()
+
+
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillEventBundle:Event'
+ 'ChillMainBundle:Center'
+ 'ChillMainBundle:Center'
+ 'ChillMainBundle:Scope'
+ 'ChillPersonBundle:Person'
+
+
+ type
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ 'ChillMainBundle:Scope'
+
+
+ $dateTo
+ $dateTo
+
+
+
+
+ date_immutable|null
+ date_immutable|null
+
+
+
+
+ AbstractMigration
+
+
+
+
+ $this->buildQueryEntities($action, $request)
+ $this->buildQueryEntities($action, $request)
+ QueryBuilder
+ \Symfony\Component\Security\Core\Exception\AccessDeniedHttpException
+
+
+
+
+ ?Scope
+
+
+ $query
+ \Symfony\Component\Security\Core\Exception\AccessDeniedHttpException
+ type
+ type
+ type
+
+
+
+
+
+
+
+ 'ChillMainBundle:Language'
+
+
+
+
+ 'ChillMainBundle:Country'
+
+
+
+
+ 'ChillMainBundle:User'
+
+
+
+
+ $qb
+
+
+
+
+ 'ChillMainBundle:Center'
+ 'ChillMainBundle:Center'
+ 'ChillMainBundle:Center'
+ 'ChillMainBundle:Center'
+
+
+
+
+ Response
+ type
+
+
+
+
+ 'ChillMainBundle:PermissionsGroup'
+ 'ChillMainBundle:PermissionsGroup'
+ 'ChillMainBundle:PermissionsGroup'
+ 'ChillMainBundle:PermissionsGroup'
+ 'ChillMainBundle:PermissionsGroup'
+ 'ChillMainBundle:PermissionsGroup'
+ 'ChillMainBundle:RoleScope'
+ 'ChillMainBundle:RoleScope'
+
+
+ Respon
+ redirection
+ type
+
+
+
+
+ $qb
+
+
+
+
+ 'ChillMainBundle:Scope'
+ 'ChillMainBundle:Scope'
+ 'ChillMainBundle:Scope'
+ 'ChillMainBundle:Scope'
+
+
+
+
+ $search
+ $search
+ $search
+ $searchProvider
+ $searchProvider
+
+
+
+
+ 'ChillMainBundle:GroupCenter'
+ 'ChillMainBundle:GroupCenter'
+ 'ChillMainBundle:User'
+ 'ChillMainBundle:User'
+
+
+
+
+
+
+
+ $class::getMenuIds()
+
+
+
+
+ unknown
+
+
+
+
+ WidgetFactoryInterface[]
+ WidgetFactoryInterface[]
+ type
+ type
+ type
+ type
+
+
+
+
+ type
+ type
+ type
+
+
+
+
+ \Chill\MainBundle\DependencyInjection\Widget\WidgetFactoryInterface
+
+
+
+
+ $fieldDeclaration
+
+
+
+
+ the
+
+
+
+
+ interger
+
+
+
+
+ PermissionGroup
+
+
+
+
+ $createdAt
+ $createdBy
+ $updatedAt
+ $updatedBy
+
+
+
+
+ Agent
+ Report
+
+
+
+
+ array
+ protected array $label = [];
+
+
+
+
+ $this->authorizationChecker
+ AuthorizationChecker
+ type
+ type
+ type
+ type
+
+
+
+
+ type
+
+
+
+
+ type
+
+
+
+
+ $this->aggregatorsData
+ $this->aggregatorsData
+
+
+ $this->formatterData
+ type
+ type
+ type
+
+
+
+
+ type
+
+
+
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ $address
+ $address
+
+
+
+
+ $data
+ $data
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ $center
+ $id
+
+
+
+
+ $array
+ $array
+
+
+
+
+ $id
+ $object
+
+
+
+
+ $id
+ $scope
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ \Symfony\Component\Mailer\Exception\TransportExceptionInterface
+
+
+
+
+ $current
+
+
+
+
+ $itemPerPage
+
+
+ type
+
+
+
+
+ $query->buildParameters()
+
+
+
+
+ $query->buildParameters()
+
+
+
+
+ $onlyEnabled
+
+
+
+
+ AppKernel
+
+
+
+
+ require __DIR__ . '/../../../../../vendor/autoload.php'
+
+
+
+
+ type
+
+
+
+
+ $args
+ $args
+ $args
+ $params
+ $this->buildSelectParams($countOnly)
+ $this->fromClauseParams
+ $this->fromClauseParams
+ $this->jsonbMetadataParams
+ $this->pertinenceParams
+ $this->selectKeyParams
+ $this->selectParams
+ $this->whereClausesParams
+ $this->whereClausesParams
+
+
+
+
+ number
+ number
+
+
+ HasAdvancedSearchForm
+ HasAdvancedSearchForm[]
+ number
+ number
+ private $hasAdvancedFormSearchServices = [];
+ type
+
+
+
+
+ $subject
+
+
+
+
+ type
+ type
+
+
+
+
+ resolveScope
+
+
+ Center|Center[]|null
+
+
+
+
+ $address
+
+
+
+
+ $center
+
+
+
+
+ $collection
+
+
+
+
+ $date
+
+
+
+
+ $user
+
+
+
+
+ The
+
+
+
+
+ $addr
+ $addr
+
+
+
+
+ type
+ type
+
+
+
+
+ The
+
+
+
+
+ $widget
+ $widget
+
+
+
+
+ type
+
+
+
+
+ getClient
+
+
+ Query
+
+
+
+
+ public function setUp()
+
+
+ type
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function tearDown()
+ public function setUp()
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ $this->prophet
+ Prophecy\Prophet
+
+
+
+
+ CenterType
+
+
+ CenterType
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+ unknown
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ unknown
+
+
+
+
+ type
+ type
+
+
+
+
+ type
+
+
+
+
+ type
+
+
+
+
+ \Chill\MainBundle\CRUD\Controller\string|string
+
+
+ Symfony\Component\HttpKernel\Exception\NotFoundHttpException
+ \Chill\PersonBundle\CRUD\Controller\QueryBuilder
+ \Chill\PersonBundle\CRUD\Controller\QueryBuilder
+
+
+
+
+ $sqls
+
+
+
+
+ $cfProvider->getCustomFieldByType($customField->getType())
+ type
+ type
+
+
+
+
+ $participation
+
+
+
+
+ 'ChillPersonBundle:Person'
+
+
+
+
+ \Chill\MainBundle\CRUD\Controller\string|string
+
+
+
+
+ $person
+
+
+
+
+ $p
+
+
+
+
+ $qb
+
+
+
+
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+
+
+ Chill\PersonBundle\Entity\Person
+
+
+
+
+ 'ChillCustomFieldsBundle:CustomFieldsDefaultGroup'
+
+
+
+
+ $sqls
+ InvalidArgumentException
+ InvalidArgumentException
+
+
+
+
+ \Chill\PersonBundle\DependencyInjection\containerBuilder
+
+
+
+
+ $a
+
+
+
+
+ $createdBy
+
+
+ Collection|SocialAction[]
+ Collection|SocialIssues[]
+
+
+
+
+ $createdAt
+ $createdBy
+
+
+
+
+ $createdAt
+ $createdBy
+ $updatedAt
+ $updatedBy
+
+
+
+
+ DateTimeImmutable|null
+
+
+
+
+ $createdAt
+ $updatedAt
+ $updatedBy
+
+
+
+
+ Person[]
+
+
+
+
+ $createdBy
+
+
+ Chill\MainBundle\Entity\Country
+ Chill\MainBundle\Entity\Country
+ Chill\MainBundle\Entity\Country
+ Report
+ type
+
+
+
+
+ $createdAt
+ $updatedAt
+ $updatedBy
+
+
+
+
+ $qb
+
+
+
+
+ 'ChillMainBundle:Country'
+
+
+
+ $choiceSlug
+
+
+
+
+ EntityRepository
+
+
+
+
+ FormInterface[]
+
+
+
+
+ $id
+ $issue
+
+
+ 'ChillPersonBundle:Person'
+
+
+
+
+ OptionsResolverInterface
+
+
+
+
+ $qb
+ $qb
+ $qb
+ QueryBuilder
+ SocialAction
+ SocialAction
+
+
+ $action
+ $orderBy
+
+
+
+
+ AppKernel
+
+
+
+
+ require __DIR__ . '/../../../../../vendor/autoload.php'
+
+
+
+
+ require_once __DIR__ . '/../app/bootstrap.php.cache'
+
+
+
+
+ $period
+
+
+
+
+ $origin
+
+
+
+
+ $participation
+
+
+
+
+ ·\is_array('concerned')
+
+
+
+
+ $person
+
+
+
+
+ $person
+
+
+
+
+ $relation
+
+
+
+
+ $socialAction
+
+
+
+
+ $socialIssue
+
+
+
+
+ $person
+ $person
+
+
+
+
+ $socialAction
+ $socialAction
+
+
+
+
+ $socialIssue
+ $socialIssue
+
+
+
+
+ public function setUp()
+ public static function setUpBeforeClass()
+
+
+ AccompanyingPeriodRepository
+ stdClass
+
+
+
+
+ public function setUp()
+ public static function setUpBeforeClass()
+
+
+
+
+ public function setUp()
+
+
+
+
+
+ public function setUp()
+ public function tearDown()
+ public static function setUpBeforeClass()
+
+
+ 'ChillMainBundle:Center'
+ 'ChillPersonBundle:AccompanyingPeriod\ClosingMotive'
+ LogicalException
+
+
+ Chill\PersonBundle\Entity\AccompanyingPeriod
+ Chill\PersonBundle\Entity\AccompanyingPeriod
+
+
+
+
+ protected function tearDown()
+
+
+ User
+
+
+
+
+ protected function setUp()
+
+
+
+
+ $this
+
+
+ public function setUp()
+ public static function setUpBeforeClass()
+
+
+ 'ChillPersonBundle:Person'
+
+
+
+
+ public static function tearDownAfterClass()
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ 'ChillMainBundle:Country'
+ 'ChillPersonBundle:Person'
+
+
+ $person->getCountryOfBirth()
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ 'ChillMainBundle:Country'
+ 'ChillPersonBundle:Person'
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ 'ChillPersonBundle:Person'
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ 'ChillPersonBundle:Person'
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ $participationL
+
+
+ getEndDate
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ public function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ protected function setUp()
+
+
+
+
+ 'ChillPersonBundle:AccompanyingPeriod'
+
+
+
+
+ $period
+
+
+
+
+ $period
+
+
+
+
+ $participations
+
+
+
+
+ $resources
+
+
+
+
+ $person
+
+
+
+
+ $household
+
+
+
+
+ $person
+
+
+
+
+ 'ChillCustomFieldsBundle:CustomField'
+
+
+
+
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillPersonBundle:Person'
+ 'ChillReportBundle:Report'
+ 'ChillReportBundle:Report'
+ 'ChillReportBundle:Report'
+ 'ChillReportBundle:Report'
+
+
+ A
+ Response
+ Response
+ Response
+ Response
+ Response
+ Response
+ Response
+ Response
+
+
+
+
+ the
+
+
+
+
+ 'ChillMainBundle:Country'
+
+
+
+ $choiceSlug
+
+
+
+
+ AppKernel
+
+
+
+
+ require __DIR__ . '/../../../../../vendor/autoload.php'
+
+
+
+
+ public function setUp()
+
+
+
+
+ type
+
+
+ public function setUp()
+ public static function setUpBeforeClass()
+
+
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $client
+ $this->getAuthenticatedClient('center a_administrative')
+ Client
+ \Chill\ReportBundle\Tests\Controller\Person
+ \SClientymfony\Component\BrowserKit\
+ type
+ type
+ type
+
+
+
+
+ Exception
+
+
+
+
+ public function setUp()
+ public static function setUpBeforeClass()
+
+
+ type
+ type
+ type
+
+
+
+
+ public function setUp()
+ public function tearDown()
+
+
+ 'ChillCustomFieldsBundle:CustomFieldsGroup'
+
+
+
+
+ 'ChillReportBundle:Report'
+
+
+
+
+ $defaultScopeId
+
+
+
+
+ \Chill\TaskBundle\Controller\AbstractTask
+
+
+ $type
+
+
+
+
+ $definition->getClass()::getAssociatedWorkflowName()
+ $definition->getClass()::getAssociatedWorkflowName()
+ $definition->getClass()::getAssociatedWorkflowName()
+
+
+
+
+ json
+ private $currentStates = [];
+
+
+
+
+ dateinterval
+ dateinterval
+ dateinterval
+ dateinterval
+ dateinterval
+ dateinterval
+
+
+
+
+ datetime_immutable
+ datetime_immutable
+ datetime_immutable
+
+
+
+
+ type
+ type
+
+
+
+
+ \Chill\PersonBundle\Entity\Person|Chill\TaskBundle\Entity\AbstractTask|null
+
+
+
+
+ $this->cachePool
+ $this->cachePool
+ $this->cachePool
+ $this->cachePool
+ CacheItempPoolInterface
+
+
+
+
+ protected function setUp()
+
+
+
+
+ $taggedService->getClass()::getKey()
+
+
+
+
+ $createdAt
+ $updatedAt
+ $updatedBy
+
+
+
+
+ type
+
+
+ type
+
+
+
+
+ $thirdParty
+
+
+
+
+ protected function setUp()
+
+
+
+
+ $object
+ $object
+ $object
+ $object->url
+ $object->url
+ $object->url
+
+
+
diff --git a/psalm.xml b/psalm.xml
new file mode 100644
index 000000000..be17d1d86
--- /dev/null
+++ b/psalm.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php
index 863190a9f..6db1f6945 100644
--- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php
+++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php
@@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Serializer\SerializerInterface;
+
use function array_key_exists;
final class ActivityController extends AbstractController
@@ -307,8 +308,10 @@ final class ActivityController extends AbstractController
$activityData = $request->query->get('activityData');
}
- if (!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
- || !$activityType->isActive()) {
+ if (
+ !$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
+ || !$activityType->isActive()
+ ) {
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
if (null !== $activityData) {
diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php
index 7da49a823..3d5591b77 100644
--- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php
+++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php
@@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php
index c656fe7a7..d69347ae9 100644
--- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php
+++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php
@@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Form\ActivityReasonType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php
index cb2d46d49..f61e15f1c 100644
--- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php
+++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php
@@ -19,6 +19,7 @@ use Chill\MainBundle\Entity\RoleScope;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php
index f4b9d177c..4e4e6f3c6 100644
--- a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php
+++ b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php
@@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
+
use function is_int;
/**
diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php
index 56306d90a..19811f584 100644
--- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php
+++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php
@@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function array_key_exists;
use function count;
diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
index 8fcb6ec6f..07153fc2c 100644
--- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
+++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
@@ -27,6 +27,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function array_key_exists;
use function count;
use function in_array;
@@ -189,7 +190,9 @@ class ListActivity implements ListInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
- $centers = array_map(static function ($el) { return $el['center']; }, $acl);
+ $centers = array_map(static function ($el) {
+ return $el['center'];
+ }, $acl);
// throw an error if any fields are present
if (!array_key_exists('fields', $data)) {
diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php
index ff0767116..467471a8d 100644
--- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php
+++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php
@@ -25,6 +25,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function array_key_exists;
use function count;
diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php
index 0b283632a..d3f35a746 100644
--- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php
+++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php
@@ -24,6 +24,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function count;
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php
index 55b1337bf..f162ed2ef 100644
--- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php
+++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php
@@ -31,6 +31,7 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function count;
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php
index d19f4ce19..7c5e0e410 100644
--- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php
+++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php
@@ -48,6 +48,7 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function in_array;
class ActivityType extends AbstractType
diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php
index b0e91a3a5..636d03488 100644
--- a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php
+++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php
@@ -36,8 +36,10 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
{
$period = $parameters['accompanyingCourse'];
- if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
- && $this->security->isGranted(ActivityVoter::SEE, $period)) {
+ if (
+ AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
+ && $this->security->isGranted(ActivityVoter::SEE, $period)
+ ) {
$menu->addChild($this->translator->trans('Activity'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [
diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php
index 58b0825dc..13c3b3e6a 100644
--- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php
+++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security;
+
use function in_array;
final class AdminMenuBuilder implements LocalMenuBuilderInterface
diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
index e80dc5522..48f750c26 100644
--- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
+++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
@@ -22,6 +22,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Security;
+
use function count;
use function in_array;
@@ -167,7 +168,9 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
// we get the ids for those scopes
$reachablesScopesId = array_map(
- static function (Scope $scope) { return $scope->getId(); },
+ static function (Scope $scope) {
+ return $scope->getId();
+ },
$reachableScopes
);
diff --git a/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php
index 914d09ffd..e171c8521 100644
--- a/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php
+++ b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php
@@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
-if (isset($_SERVER['HTTP_CLIENT_IP'])
+if (
+ isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
) {
diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php
index 39b0deef9..789e634e5 100644
--- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php
+++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
+
use function in_array;
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
@@ -64,8 +65,10 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
protected function supports($attribute, $subject)
{
- if ($subject instanceof Center
- && in_array($attribute, $this->getAttributes(), true)) {
+ if (
+ $subject instanceof Center
+ && in_array($attribute, $this->getAttributes(), true)
+ ) {
return true;
}
diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php
index 6d38c789c..9911bf9fd 100644
--- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php
+++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php
@@ -24,6 +24,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
use RuntimeException;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Security;
+
use function in_array;
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
diff --git a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
index 072ba39d9..74e98e9dc 100644
--- a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
+++ b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
@@ -24,6 +24,7 @@ use RuntimeException;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\User\UserInterface;
+
use function implode;
use function in_array;
use function strtr;
diff --git a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php
index d429d4e4d..b1d0f13e7 100644
--- a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php
+++ b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php
@@ -17,6 +17,7 @@ use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
+
use function array_merge;
use function count;
diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php b/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php
index 8501767b2..b24bb9ea7 100644
--- a/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php
+++ b/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php
@@ -13,6 +13,7 @@ namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
+
use function count;
/**
diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php
index e6fdbb5fe..ae84ac472 100644
--- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php
+++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php
@@ -19,6 +19,7 @@ use DateTimeImmutable;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function random_int;
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php
index da5cb721b..5c897e8ec 100644
--- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php
+++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php
@@ -18,10 +18,12 @@ class LoadAsideActivityCategory extends \Doctrine\Bundle\FixturesBundle\Fixture
{
public function load(ObjectManager $manager)
{
- foreach ([
- 'Appel téléphonique',
- 'Formation',
- ] as $key => $label) {
+ foreach (
+ [
+ 'Appel téléphonique',
+ 'Formation',
+ ] as $key => $label
+ ) {
$category = new AsideActivityCategory();
$category->setTitle(['fr' => $label]);
$manager->persist($category);
diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php
index 3032e1b2c..a077ce902 100644
--- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php
+++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php
@@ -13,6 +13,7 @@ namespace Chill\AsideActivityBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
+
use function is_int;
class Configuration implements ConfigurationInterface
diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
index b0147a20f..5a4eec9e0 100644
--- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
+++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
@@ -32,6 +32,7 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function in_array;
final class AsideActivityFormType extends AbstractType
diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php
index 2d5968e48..4fa2c2c96 100644
--- a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php
+++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php
@@ -13,6 +13,7 @@ namespace Chill\AsideActivityBundle\Menu;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security;
+
use function in_array;
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
diff --git a/src/Bundle/ChillBudgetBundle/Calculator/CalculatorManager.php b/src/Bundle/ChillBudgetBundle/Calculator/CalculatorManager.php
index 2a9a89b13..0916b703c 100644
--- a/src/Bundle/ChillBudgetBundle/Calculator/CalculatorManager.php
+++ b/src/Bundle/ChillBudgetBundle/Calculator/CalculatorManager.php
@@ -13,6 +13,7 @@ namespace Chill\AMLI\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
use OutOfBoundsException;
+
use function array_key_exists;
use function array_keys;
use function implode;
diff --git a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php
index fd596cc3a..01315e889 100644
--- a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php
+++ b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php
@@ -21,6 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Translation\TranslatorInterface;
+
use function get_class;
abstract class AbstractElementController extends Controller
diff --git a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php
index b0c01732b..df1e83081 100644
--- a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php
+++ b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php
@@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_merge;
use function count;
diff --git a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php
index f64283b5a..96aea3ea4 100644
--- a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php
+++ b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php
@@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use function array_flip;
use function asort;
diff --git a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php
index ddb4dd777..9f772648d 100644
--- a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php
+++ b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php
@@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use function array_flip;
class ResourceType extends AbstractType
diff --git a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php
index 71a5f2523..e0d9e9266 100644
--- a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php
+++ b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php
@@ -18,6 +18,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Security\Core\Role\Role;
+
use function in_array;
class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php
index f62323a29..018d23426 100644
--- a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php
+++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php
@@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
+
use function count;
class CalendarRangeAPIController extends ApiController
diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php
index d026b399c..11104cc6a 100644
--- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php
+++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php
@@ -28,6 +28,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;
use Symfony\Component\Validator\Mapping\ClassMetadata;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php
index c79cccbf5..ec902bd64 100644
--- a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php
+++ b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php
@@ -14,6 +14,7 @@ namespace Chill\CalendarBundle\Event;
use Chill\ActivityBundle\Entity\Activity;
use Doctrine\Persistence\Event\LifecycleEventArgs;
use Symfony\Component\HttpFoundation\RequestStack;
+
use function array_key_exists;
class ListenToActivityCreate
diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php
index f36c7f07b..acaeccf34 100644
--- a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php
+++ b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php
@@ -20,7 +20,6 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\CommentType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Person;
-
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTimeImmutable;
use Doctrine\Persistence\ObjectManager;
diff --git a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
index 633f70f05..a20157ce0 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
@@ -25,6 +25,7 @@ use Symfony\Component\Console\Question\Question;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser;
+
use function count;
/**
diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
index 718f5dbb7..b57fdf4db 100644
--- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
+++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
@@ -23,6 +23,7 @@ use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_key_exists;
use function count;
use function in_array;
diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
index 1afa9982a..38a31491d 100644
--- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
+++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
@@ -135,7 +135,7 @@ class CustomFieldDate extends AbstractCustomField
return null;
}
- return $date->format('Y-m-d');
+ return $date->format('Y-m-d');
default:
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:date.'
diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
index 311df8fad..20b1a9ec7 100644
--- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
+++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
@@ -21,6 +21,7 @@ use LogicException;
use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
+
use function get_class;
use function gettype;
use function is_object;
diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
index c7ec62ba2..cd42ca751 100644
--- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
+++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
@@ -18,7 +18,6 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
-
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Symfony\Component\Validator\Constraints\LessThanOrEqual;
diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
index 62325b797..849f851fd 100644
--- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
+++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
@@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
+
use function array_key_exists;
class CustomFieldText extends AbstractCustomField
@@ -65,8 +66,10 @@ class CustomFieldText extends AbstractCustomField
$attrArray = [];
- if (array_key_exists(self::MULTIPLE_CF_INLINE, $options)
- && $options[self::MULTIPLE_CF_INLINE]) {
+ if (
+ array_key_exists(self::MULTIPLE_CF_INLINE, $options)
+ && $options[self::MULTIPLE_CF_INLINE]
+ ) {
$attrArray['class'] = 'multiple-cf-inline';
}
diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php
index f9d773f72..7dff8e119 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php
@@ -20,6 +20,7 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatorInterface;
+
use function count;
class CustomFieldsGroupType extends AbstractType
diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php
index 937aaaa9b..fc6dfd75f 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php
@@ -15,6 +15,7 @@ use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
+
use function gettype;
class CustomFieldsGroupToIdTransformer implements DataTransformerInterface
diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php
index 095c6f463..250418581 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php
@@ -14,7 +14,9 @@ namespace Chill\CustomFieldsBundle\Form\DataTransformer;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Form\DataTransformerInterface;
+
use function array_key_exists;
+
use const JSON_THROW_ON_ERROR;
class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
@@ -33,7 +35,9 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
// @TODO: in the array_map callback, CustomField::getLabel() does not exist. What do we do here?
$customFieldsLablels = array_map(
- static function ($e) { return $e->getLabel(); },
+ static function ($e) {
+ return $e->getLabel();
+ },
$customFields
);
diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php
index 6c35097e5..42428c21b 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php
@@ -15,6 +15,7 @@ use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use function array_key_exists;
/**
diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php
index b2d50b422..77a479728 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php
@@ -17,7 +17,6 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
-
use Symfony\Component\Form\FormEvents;
class ChoicesListType extends AbstractType
diff --git a/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php
index 914d09ffd..e171c8521 100644
--- a/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php
+++ b/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php
@@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
-if (isset($_SERVER['HTTP_CLIENT_IP'])
+if (
+ isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
) {
diff --git a/src/Bundle/ChillDocGeneratorBundle/Context/Exception/UnexpectedTypeException.php b/src/Bundle/ChillDocGeneratorBundle/Context/Exception/UnexpectedTypeException.php
index 617ec537a..f992e674d 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Context/Exception/UnexpectedTypeException.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Context/Exception/UnexpectedTypeException.php
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\DocGeneratorBundle\Context\Exception;
use LogicException;
+
use function get_class;
use function gettype;
use function is_object;
diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
index de71daa6f..66d475d89 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
@@ -28,12 +28,10 @@ use GuzzleHttp\Client;
use GuzzleHttp\Exception\TransferException;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
-
// TODO à mettre dans services
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
@@ -42,7 +40,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
-
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Contracts\HttpClient\HttpClientInterface;
@@ -206,8 +203,10 @@ final class DocGeneratorTemplateController extends AbstractController
$contextGenerationData = [];
- if ($context instanceof DocGeneratorContextWithPublicFormInterface
- && $context->hasPublicForm($template, $entity) || $isTest) {
+ if (
+ $context instanceof DocGeneratorContextWithPublicFormInterface
+ && $context->hasPublicForm($template, $entity) || $isTest
+ ) {
if ($context instanceof DocGeneratorContextWithPublicFormInterface) {
$builder = $this->createFormBuilder(
array_merge(
diff --git a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php
index 4275cf53e..ff516d3de 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php
@@ -54,8 +54,10 @@ class DocGeneratorTemplateType extends AbstractType
'required' => true,
]);
- if ($context instanceof DocGeneratorContextWithAdminFormInterface
- && $context->hasAdminForm()) {
+ if (
+ $context instanceof DocGeneratorContextWithAdminFormInterface
+ && $context->hasAdminForm()
+ ) {
$sub = $builder
->create('options', null, ['compound' => true])
->addModelTransformer(new CallbackTransformer(
diff --git a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php
index 39b21ed0e..d88f0c122 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function in_array;
class AdminMenuBuilder implements LocalMenuBuilderInterface
diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php
index 2de46228a..b8fca5119 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php
@@ -11,13 +11,15 @@ declare(strict_types=1);
namespace Chill\DocGeneratorBundle\Serializer\Encoder;
+use Symfony\Component\Serializer\Encoder\EncoderInterface;
+
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
use function array_keys;
use function is_array;
-class DocGenEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInterface
+class DocGenEncoder implements EncoderInterface
{
- public function encode($data, string $format, array $context = [])
+ public function encode($data, $format, array $context = [])
{
if (!$this->isAssociative($data)) {
throw new UnexpectedValueException('Only associative arrays are allowed; lists are not allowed');
@@ -29,7 +31,7 @@ class DocGenEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInte
return $result;
}
- public function supportsEncoding(string $format)
+ public function supportsEncoding($format)
{
return 'docgen' === $format;
}
diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php
index f6be7bd5a..91e8e6170 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\DocGeneratorBundle\Serializer\Helper;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+
use function array_merge;
class NormalizeNullValueHelper
diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php
index 35c683138..55774dd83 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php
@@ -26,10 +26,11 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
/**
* @param Collection $object
+ * @param null|string $format
*
* @return array|ArrayObject|bool|float|int|string|void|null
*/
- public function normalize($object, ?string $format = null, array $context = [])
+ public function normalize($object, $format = null, array $context = [])
{
$data = [];
@@ -44,7 +45,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
return $data;
}
- public function supportsNormalization($data, ?string $format = null, array $context = [])
+ public function supportsNormalization($data, $format = null, array $context = [])
{
if ('docgen' !== $format) {
return false;
diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
index 35c4729bb..fc4b4beb9 100644
--- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
+++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
@@ -26,6 +26,7 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+
use function array_filter;
use function array_key_exists;
use function array_merge;
@@ -54,7 +55,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
$this->translatableStringHelper = $translatableStringHelper;
}
- public function normalize($object, ?string $format = null, array $context = [])
+ public function normalize($object, $format = null, array $context = [])
{
$classMetadataKey = $object ?? $context['docgen:expects'] ?? null;
@@ -65,7 +66,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
if (!$this->classMetadataFactory->hasMetadataFor($classMetadataKey)) {
throw new LogicException(sprintf(
'This object does not have metadata: %s. Add groups on this entity to allow to serialize with the format %s and groups %s',
- is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/ ,
+ is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/,
$format,
implode(', ', ($context['groups'] ?? []))
));
@@ -95,7 +96,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
return $this->normalizeObject($object, $format, $context, $expectedGroups, $metadata, $attributes);
}
- public function supportsNormalization($data, ?string $format = null): bool
+ public function supportsNormalization($data, $format = null): bool
{
return 'docgen' === $format && (is_object($data) || null === $data);
}
diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php
index 28a35dfb4..cab5895a9 100644
--- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php
+++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php
@@ -18,6 +18,7 @@ use Chill\MainBundle\Entity\RoleScope;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php
index 4de5cf48c..f9cb645f7 100644
--- a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php
+++ b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use function json_decode;
use function json_encode;
diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php
index 18377211c..88e701fcf 100644
--- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php
+++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php
@@ -22,6 +22,7 @@ use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Security;
+
use function in_array;
class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
@@ -101,8 +102,10 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov
return false;
}
- if (AccompanyingPeriod::STEP_CLOSED === $subject->getCourse()->getStep()
- && in_array($attribute, [self::CREATE, self::DELETE, self::UPDATE], true)) {
+ if (
+ AccompanyingPeriod::STEP_CLOSED === $subject->getCourse()->getStep()
+ && in_array($attribute, [self::CREATE, self::DELETE, self::UPDATE], true)
+ ) {
return false;
}
}
diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php
index 43d17e420..dbaa474a3 100644
--- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php
+++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php
@@ -95,8 +95,10 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera
return false;
}
- if ($subject instanceof PersonDocument
- && !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
+ if (
+ $subject instanceof PersonDocument
+ && !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())
+ ) {
return false;
}
diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php
index c7d98baaa..d87afac09 100644
--- a/src/Bundle/ChillEventBundle/Controller/EventController.php
+++ b/src/Bundle/ChillEventBundle/Controller/EventController.php
@@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
+
use function count;
/**
diff --git a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php
index b4e19efc7..f1ced71a5 100644
--- a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php
+++ b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php
@@ -14,7 +14,6 @@ namespace Chill\EventBundle\Controller;
use Chill\EventBundle\Entity\EventType;
use Chill\EventBundle\Form\EventTypeType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php
index b3294cfc6..63f40df32 100644
--- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php
+++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php
@@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+
use function count;
/**
@@ -112,7 +113,9 @@ class ParticipationController extends AbstractController
[
'event_id' => current($participations)->getEvent()->getId(),
'persons_ids' => implode(',', array_map(
- static function (Participation $p) { return $p->getPerson()->getId(); },
+ static function (Participation $p) {
+ return $p->getPerson()->getId();
+ },
$participations
)),
]
@@ -648,7 +651,9 @@ class ParticipationController extends AbstractController
/** @var \Doctrine\Common\Collections\ArrayCollection $peopleParticipating */
$peopleParticipating = $peopleParticipating ??
$participation->getEvent()->getParticipations()->map(
- static function (Participation $p) { return $p->getPerson()->getId(); }
+ static function (Participation $p) {
+ return $p->getPerson()->getId();
+ }
);
// check that the user is not already in the event
if ($peopleParticipating->contains($participation->getPerson()->getId())) {
diff --git a/src/Bundle/ChillEventBundle/Controller/StatusController.php b/src/Bundle/ChillEventBundle/Controller/StatusController.php
index 7da8b989f..72e80b27b 100644
--- a/src/Bundle/ChillEventBundle/Controller/StatusController.php
+++ b/src/Bundle/ChillEventBundle/Controller/StatusController.php
@@ -14,7 +14,6 @@ namespace Chill\EventBundle\Controller;
use Chill\EventBundle\Entity\Status;
use Chill\EventBundle\Form\StatusType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php
index ddcef3422..8bd1a3513 100644
--- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php
+++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php
@@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\RoleScope;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillEventBundle/Entity/Participation.php b/src/Bundle/ChillEventBundle/Entity/Participation.php
index 9ba34d398..d52618bcd 100644
--- a/src/Bundle/ChillEventBundle/Entity/Participation.php
+++ b/src/Bundle/ChillEventBundle/Entity/Participation.php
@@ -21,6 +21,7 @@ use DateTime;
use Doctrine\ORM\Mapping as ORM;
use RuntimeException;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function in_array;
/**
@@ -172,15 +173,19 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
return;
}
- if ($this->getRole()->getType()->getId() !==
- $this->getEvent()->getType()->getId()) {
+ if (
+ $this->getRole()->getType()->getId() !==
+ $this->getEvent()->getType()->getId()
+ ) {
$context->buildViolation('The role is not allowed with this event type')
->atPath('role')
->addViolation();
}
- if ($this->getStatus()->getType()->getId() !==
- $this->getEvent()->getType()->getId()) {
+ if (
+ $this->getStatus()->getType()->getId() !==
+ $this->getEvent()->getType()->getId()
+ ) {
$context->buildViolation('The status is not allowed with this event type')
->atPath('status')
->addViolation();
diff --git a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
index 953f1cc82..faac75668 100644
--- a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
+++ b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
@@ -16,6 +16,7 @@ use Doctrine\ORM\EntityRepository;
use RuntimeException;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
+
use function call_user_func;
use function count;
use function in_array;
@@ -83,8 +84,10 @@ class EventChoiceLoader implements ChoiceLoaderInterface
$event = $this->eventRepository->find($value);
- if ($this->hasCenterFilter()
- && !in_array($event->getCenter(), $this->centers, true)) {
+ if (
+ $this->hasCenterFilter()
+ && !in_array($event->getCenter(), $this->centers, true)
+ ) {
throw new RuntimeException('chosen an event not in correct center');
}
diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
index bb12e272c..881a9645b 100644
--- a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
+++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
@@ -29,6 +29,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
+
use function in_array;
use function is_array;
@@ -170,10 +171,14 @@ class PickEventType extends AbstractType
. 'option must be an instance of ' . Center::class);
}
- if (!in_array($c->getId(), array_map(
- static function (Center $c) { return $c->getId(); },
- $centers
- ), true)) {
+ if (
+ !in_array($c->getId(), array_map(
+ static function (Center $c) {
+ return $c->getId();
+ },
+ $centers
+ ), true)
+ ) {
throw new AccessDeniedException('The given center is not reachable');
}
$selectedCenters[] = $c;
diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php
index 2f90b785e..9b2052305 100644
--- a/src/Bundle/ChillEventBundle/Search/EventSearch.php
+++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php
@@ -20,6 +20,7 @@ use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Templating\EngineInterface as TemplatingEngine;
+
use function count;
/**
@@ -174,7 +175,8 @@ class EventSearch extends AbstractSearch
if (
(isset($terms['name']) || isset($terms['_default']))
- && (!empty($terms['name']) || !empty($terms['_default']))) {
+ && (!empty($terms['name']) || !empty($terms['_default']))
+ ) {
// the form with name:"xyz" has precedence
$name = $terms['name'] ?? $terms['_default'];
diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php b/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php
index b2c201e01..9d7c88500 100644
--- a/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php
+++ b/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php
@@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Role\Role;
+
use function count;
use function in_array;
diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php b/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php
index 3438f71c3..8d7a76c62 100644
--- a/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php
+++ b/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php
@@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Role\Role;
+
use function count;
use function in_array;
diff --git a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php
index c8747a2c4..132a74144 100644
--- a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php
+++ b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php
@@ -23,6 +23,7 @@ use Doctrine\ORM\Mapping\ClassMetadata;
use LogicException;
use RuntimeException;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function count;
/**
@@ -207,7 +208,9 @@ class TimelineEventProvider implements TimelineProviderInterface
foreach ($reachableCenters as $center) {
$reachableCircleId = array_map(
- static function (Scope $scope) { return $scope->getId(); },
+ static function (Scope $scope) {
+ return $scope->getId();
+ },
$this->helper->getReachableCircles($this->user, $role, $person->getCenter())
);
$centerAndScopeLines[] = sprintf(
diff --git a/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php b/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
index 73c320720..2340ba7b9 100644
--- a/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
+++ b/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
@@ -18,6 +18,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Security\Core\Role\Role;
+
use function in_array;
class FamilyMemberVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
index cd458e222..b1ee4894e 100644
--- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
+++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
@@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
+
use function array_merge;
abstract class AbstractCRUDController extends AbstractController
diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
index 15d8dbcc3..cfbe811fa 100644
--- a/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
+++ b/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
@@ -23,6 +23,7 @@ use Symfony\Component\Serializer\Exception\NotEncodableValueException;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Validator\ConstraintViolationListInterface;
+
use function array_merge;
use function ucfirst;
diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
index 0e2881b54..d6e0450e3 100644
--- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
+++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
@@ -28,6 +28,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_key_exists;
use function array_merge;
diff --git a/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php b/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
index 11b84e586..d11c5fb98 100644
--- a/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
+++ b/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\CRUD\Resolver;
use Doctrine\ORM\EntityManagerInterface;
use LogicException;
+
use function array_key_exists;
use function strtoupper;
diff --git a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
index 33cce8a2f..322218202 100644
--- a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
+++ b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
@@ -16,11 +16,13 @@ use Symfony\Component\Config\Loader\Loader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
+
use function array_filter;
use function array_keys;
use function array_search;
use function count;
use function in_array;
+
use const ARRAY_FILTER_USE_BOTH;
class CRUDRoutesLoader extends Loader
@@ -139,7 +141,9 @@ class CRUDRoutesLoader extends Loader
$methods = array_keys(array_filter(
$action['methods'],
- static function ($value, $key) { return $value; },
+ static function ($value, $key) {
+ return $value;
+ },
ARRAY_FILTER_USE_BOTH
));
diff --git a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
index 1f07af303..383fd501d 100644
--- a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
+++ b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
@@ -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];
}
diff --git a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
index c94ea35c2..c119907b4 100644
--- a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
+++ b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
@@ -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');
}
diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
index dfb912eb9..dd751db01 100644
--- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
+++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
@@ -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;
/*
diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
index a5f3c8611..a3b1c1a26 100644
--- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
+++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
@@ -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;
diff --git a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php
index 498c77c68..1a7d8956a 100644
--- a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php
+++ b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php
@@ -23,6 +23,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
+
use function trim;
final class AddressReferenceAPIController extends ApiController
diff --git a/src/Bundle/ChillMainBundle/Controller/AdminController.php b/src/Bundle/ChillMainBundle/Controller/AdminController.php
index 96ba627e4..efde1ae20 100644
--- a/src/Bundle/ChillMainBundle/Controller/AdminController.php
+++ b/src/Bundle/ChillMainBundle/Controller/AdminController.php
@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Routing\Annotation\Route;
class AdminController extends AbstractController
diff --git a/src/Bundle/ChillMainBundle/Controller/CenterController.php b/src/Bundle/ChillMainBundle/Controller/CenterController.php
index 02ea19e20..fbdca566b 100644
--- a/src/Bundle/ChillMainBundle/Controller/CenterController.php
+++ b/src/Bundle/ChillMainBundle/Controller/CenterController.php
@@ -14,7 +14,6 @@ namespace Chill\MainBundle\Controller;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Form\CenterType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
-
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php
index 809d0502d..6921dd284 100644
--- a/src/Bundle/ChillMainBundle/Controller/ExportController.php
+++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php
@@ -25,6 +25,7 @@ use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Translation\TranslatorInterface;
+
use function count;
use function serialize;
use function unserialize;
@@ -484,11 +485,13 @@ class ExportController extends AbstractController
$data = $form->getData();
// check ACL
- if ($exportManager->isGrantedForElement(
- $export,
- null,
- $exportManager->getPickedCenters($data['centers'])
- ) === false) {
+ if (
+ $exportManager->isGrantedForElement(
+ $export,
+ null,
+ $exportManager->getPickedCenters($data['centers'])
+ ) === false
+ ) {
throw $this->createAccessDeniedException('you do not have '
. 'access to this export for those centers');
}
diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php
index 6a2afccb2..5293ddc70 100644
--- a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php
+++ b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php
@@ -18,6 +18,7 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
+
use function array_key_exists;
use function json_decode;
diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
index 8cffd02b3..59b97a57c 100644
--- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
+++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
@@ -26,6 +26,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Role\RoleHierarchy;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_key_exists;
/**
diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php
index 0280be61f..f38e0004b 100644
--- a/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php
+++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php
@@ -18,6 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
+
use function array_map;
/**
@@ -54,12 +55,12 @@ class PostalCodeController extends AbstractController
->createQuery(
sprintf(
'SELECT p.id AS id, p.name AS name, p.code AS code, '
- . 'country.name AS country_name, '
- . 'country.countryCode AS country_code '
- . 'FROM %s p '
- . 'JOIN p.country country '
- . 'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) '
- . 'ORDER BY code',
+ . 'country.name AS country_name, '
+ . 'country.countryCode AS country_code '
+ . 'FROM %s p '
+ . 'JOIN p.country country '
+ . 'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) '
+ . 'ORDER BY code',
PostalCode::class
)
)
diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php
index c231bf162..b9f5d19d8 100644
--- a/src/Bundle/ChillMainBundle/Controller/SearchController.php
+++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php
@@ -27,6 +27,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function count;
use function key;
use function reset;
diff --git a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php
index 8cf5f8782..5d50f246c 100644
--- a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php
+++ b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php
@@ -17,6 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
+
use function count;
class TimelineCenterController extends AbstractController
diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
index 47d63efdf..0b6e6a833 100644
--- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
+++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
@@ -18,6 +18,7 @@ use Doctrine\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Intl\Intl;
+
use function in_array;
/**
@@ -51,7 +52,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface,
if (
!in_array($code, $this->regionalVersionToInclude, true)
&& !in_array($code, $this->ancientToExclude, true)
- ) {
+ ) {
$lang = (new Language())
->setId($code)
->setName($this->prepareName($code));
diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php
index ecf839450..3da6e86da 100644
--- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php
+++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php
@@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\PostalCode;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function strtolower;
use function ucwords;
diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php
index b7d7cb941..6a518bada 100644
--- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php
+++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php
@@ -20,6 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
+
use function str_replace;
/**
diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
index 012643aad..2a64c36a4 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
@@ -44,6 +44,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
use function count;
/**
diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php
index 5a803e9de..15943b775 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php
@@ -15,6 +15,7 @@ use LogicException;
use RuntimeException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
+
use function count;
/**
diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
index e352470e7..0b055b682 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
@@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use UnexpectedValueException;
+
use function array_key_exists;
use function count;
use function get_class;
@@ -373,8 +374,10 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface
private function isPlaceAllowedForWidget($place, $widgetAlias, ContainerBuilder $container)
{
if ($this->widgetServices[$widgetAlias] instanceof WidgetFactoryInterface) {
- if (in_array($place, $this->widgetServices[$widgetAlias]
- ->getAllowedPlaces(), true)) {
+ if (
+ in_array($place, $this->widgetServices[$widgetAlias]
+ ->getAllowedPlaces(), true)
+ ) {
return true;
}
} else {
diff --git a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php
index 3aabe46fc..ad355544f 100644
--- a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php
+++ b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php
@@ -41,8 +41,10 @@ class TrackCreateUpdateSubscriber implements EventSubscriber
{
$object = $args->getObject();
- if ($object instanceof TrackCreationInterface
- && $this->security->getUser() instanceof User) {
+ if (
+ $object instanceof TrackCreationInterface
+ && $this->security->getUser() instanceof User
+ ) {
$object->setCreatedBy($this->security->getUser());
$object->setCreatedAt(new DateTimeImmutable('now'));
}
@@ -59,8 +61,10 @@ class TrackCreateUpdateSubscriber implements EventSubscriber
protected function onUpdate(object $object): void
{
- if ($object instanceof TrackUpdateInterface
- && $this->security->getUser() instanceof User) {
+ if (
+ $object instanceof TrackUpdateInterface
+ && $this->security->getUser() instanceof User
+ ) {
$object->setUpdatedBy($this->security->getUser());
$object->setUpdatedAt(new DateTimeImmutable('now'));
}
diff --git a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php
index f63101b33..31983d969 100644
--- a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php
+++ b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Doctrine\Model;
use Exception;
use JsonSerializable;
+
use function json_encode;
class Point implements JsonSerializable
diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php
index a1ec0c955..8f8d63aef 100644
--- a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php
+++ b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php
@@ -16,6 +16,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\DateIntervalType;
use Exception;
+
use function count;
use function current;
use function preg_match;
diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php
index de9d1199c..0c3194fba 100644
--- a/src/Bundle/ChillMainBundle/Entity/User.php
+++ b/src/Bundle/ChillMainBundle/Entity/User.php
@@ -18,6 +18,7 @@ use RuntimeException;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php
index 6c0d3bd8b..f9964ea3b 100644
--- a/src/Bundle/ChillMainBundle/Export/ExportManager.php
+++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php
@@ -26,6 +26,7 @@ use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use UnexpectedValueException;
+
use function array_key_exists;
use function count;
use function get_class;
@@ -122,8 +123,10 @@ class ExportManager
public function &getFiltersApplyingOn(ExportInterface $export, ?array $centers = null)
{
foreach ($this->filters as $alias => $filter) {
- if (in_array($filter->applyOn(), $export->supportsModifiers(), true)
- && $this->isGrantedForElement($filter, $export, $centers)) {
+ if (
+ in_array($filter->applyOn(), $export->supportsModifiers(), true)
+ && $this->isGrantedForElement($filter, $export, $centers)
+ ) {
yield $alias => $filter;
}
}
@@ -143,8 +146,10 @@ class ExportManager
}
foreach ($this->aggregators as $alias => $aggregator) {
- if (in_array($aggregator->applyOn(), $export->supportsModifiers(), true)
- && $this->isGrantedForElement($aggregator, $export, $centers)) {
+ if (
+ in_array($aggregator->applyOn(), $export->supportsModifiers(), true)
+ && $this->isGrantedForElement($aggregator, $export, $centers)
+ ) {
yield $alias => $aggregator;
}
}
diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php
index 914fa15c3..7e5b71268 100644
--- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php
+++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php
@@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_key_exists;
use function array_slice;
use function call_user_func;
diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php
index 94c8c5ee3..cb184e250 100644
--- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php
+++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_key_exists;
use function array_keys;
use function array_map;
@@ -198,7 +199,9 @@ class CSVListFormatter implements FormatterInterface
foreach ($keys as $key) {
// get an array with all values for this key if possible
- $values = array_map(static function ($v) use ($key) { return $v[$key]; }, $this->result);
+ $values = array_map(static function ($v) use ($key) {
+ return $v[$key];
+ }, $this->result);
// store the label in the labelsCache property
$this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData);
}
diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php
index 7e3334340..790a8b540 100644
--- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php
+++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php
@@ -18,6 +18,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_map;
use function count;
@@ -186,7 +187,9 @@ class CSVPivotedListFormatter implements FormatterInterface
foreach ($keys as $key) {
// get an array with all values for this key if possible
- $values = array_map(static function ($v) use ($key) { return $v[$key]; }, $this->result);
+ $values = array_map(static function ($v) use ($key) {
+ return $v[$key];
+ }, $this->result);
// store the label in the labelsCache property
$this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData);
}
diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
index 590e79a41..0c890f009 100644
--- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
+++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
@@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_map;
use function array_merge;
use function array_multisort;
diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
index e31535602..aaebadd99 100644
--- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
+++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
@@ -24,6 +24,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_key_exists;
use function array_keys;
use function array_map;
@@ -257,7 +258,9 @@ class SpreadsheetListFormatter implements FormatterInterface
foreach ($keys as $key) {
// get an array with all values for this key if possible
- $values = array_map(static function ($v) use ($key) { return $v[$key]; }, $this->result);
+ $values = array_map(static function ($v) use ($key) {
+ return $v[$key];
+ }, $this->result);
// store the label in the labelsCache property
$this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData);
}
diff --git a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
index 7e0702de1..ed0426b8b 100644
--- a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
+++ b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\PostalCode;
use Chill\MainBundle\Repository\PostalCodeRepository;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
+
use function call_user_func;
/**
diff --git a/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php b/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php
index e798a262e..706ba4f08 100644
--- a/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php
+++ b/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php
@@ -17,6 +17,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use function array_combine;
use function array_merge;
use function count;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php
index 1398a8ce2..11b079f4a 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php
@@ -15,7 +15,6 @@ use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\PermissionsGroup;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
-
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php
index bf5e2d4f8..2f3378ae8 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php
@@ -16,10 +16,10 @@ use Chill\MainBundle\Security\RoleProvider;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
-
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php
index a0f609d46..1bc02f9dd 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php
@@ -18,6 +18,7 @@ use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Traversable;
+
use function count;
class CenterTransformer implements DataTransformerInterface
diff --git a/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php b/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php
index 66ae4d846..a99ee6135 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\GreaterThan;
+
use function array_diff;
use function array_values;
use function count;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
index daf33eb57..2fe5ff8f2 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
@@ -23,6 +23,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function array_intersect;
use function array_key_exists;
use function array_merge;
@@ -85,7 +86,9 @@ class PickCenterType extends AbstractType
'query_builder' => static function (EntityRepository $er) use ($centers) {
$qb = $er->createQueryBuilder('c');
$ids = array_map(
- static function (Center $el) { return $el->getId(); },
+ static function (Center $el) {
+ return $el->getId();
+ },
$centers
);
@@ -93,7 +96,9 @@ class PickCenterType extends AbstractType
},
'multiple' => true,
'expanded' => true,
- 'choice_label' => static function (Center $c) { return $c->getName(); },
+ 'choice_label' => static function (Center $c) {
+ return $c->getName();
+ },
'data' => count($this->groupingCenters) > 0 ? null : $centers,
]);
@@ -122,8 +127,12 @@ class PickCenterType extends AbstractType
}
$builder->addModelTransformer(new CallbackTransformer(
- function ($data) use ($centers) { return $this->transform($data, $centers); },
- function ($data) use ($centers) { return $this->reverseTransform($data, $centers); }
+ function ($data) use ($centers) {
+ return $this->transform($data, $centers);
+ },
+ function ($data) use ($centers) {
+ return $this->reverseTransform($data, $centers);
+ }
));
}
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php
index 2b1c8e093..885be3c27 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php
@@ -15,7 +15,6 @@ use Chill\MainBundle\Export\ExportManager;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
-
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php
index 488246a50..2b6cdc21d 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\HttpFoundation\RequestStack;
+
use function array_combine;
use function array_map;
use function count;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php
index 647c45553..20933563a 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php
@@ -20,6 +20,7 @@ use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function uniqid;
/**
diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php
index 5ccf217a0..053ee31e1 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php
@@ -25,6 +25,7 @@ use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;
+
use function array_merge;
use function array_values;
use function count;
@@ -151,8 +152,10 @@ class PickCenterType extends AbstractType
$centers = [];
foreach ($scopes as $scope) {
- foreach ($this->authorizationHelper
- ->getReachableCenters($this->security->getUser(), $role, $scope) as $center) {
+ foreach (
+ $this->authorizationHelper
+ ->getReachableCenters($this->security->getUser(), $role, $scope) as $center
+ ) {
$centers[spl_object_hash($center)] = $center;
}
}
diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php
index 0438669b4..92a1b26c3 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php
@@ -29,6 +29,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Security;
+
use function array_map;
use function count;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
index bed90ad18..d3374e9de 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use const SORT_FLAG_CASE;
use const SORT_STRING;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
index 9fad2bdb3..4c8e11a49 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use const SORT_FLAG_CASE;
use const SORT_STRING;
diff --git a/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php b/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php
index 3f44a4e97..822ff0101 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\Translator;
+
use function in_array;
class TranslatableStringFormType extends AbstractType
diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php
index 84382b4fb..479502060 100644
--- a/src/Bundle/ChillMainBundle/Notification/Mailer.php
+++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php
@@ -18,6 +18,7 @@ use Swift_Message;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Twig\Environment;
+
use function call_user_func;
/**
diff --git a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php
index e02729287..5b3684d3c 100644
--- a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php
+++ b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php
@@ -123,11 +123,11 @@ class PaginatorFactory
{
return array_merge(
$this->router->getContext()->getParameters(),
- // get the route parameters
+ // get the route parameters
$this->requestStack
->getCurrentRequest()
->attributes->get('_route_params'),
- // get the query parameters
+ // get the query parameters
$this->requestStack
->getCurrentRequest()->query->all()
);
diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
index 08243e560..0eae018a8 100644
--- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
+++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
@@ -17,6 +17,7 @@ use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\ServerException;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Log\LoggerInterface;
+
use function array_key_exists;
use function in_array;
use function json_decode;
@@ -58,13 +59,14 @@ class PhonenumberHelper
$this->logger = $logger;
$this->cachePool = $cachePool;
- if (array_key_exists('twilio_sid', $config)
+ if (
+ array_key_exists('twilio_sid', $config)
&& !empty($config['twilio_sid'])
&& strlen($config['twilio_sid']) > 2
&& array_key_exists('twilio_secret', $config)
&& !empty($config['twilio_secret'])
&& strlen($config['twilio_secret']) > 2
- ) {
+ ) {
$this->twilioClient = new Client([
'auth' => [$config['twilio_sid'], $config['twilio_secret']],
]);
diff --git a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php
index 6be52ec85..9cbad91c9 100644
--- a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php
+++ b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php
@@ -20,6 +20,7 @@ use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
use Doctrine\Persistence\ObjectRepository;
use RuntimeException;
+
use function explode;
use function implode;
use function strtr;
diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepository.php b/src/Bundle/ChillMainBundle/Repository/UserRepository.php
index 00556702e..fc3a6e187 100644
--- a/src/Bundle/ChillMainBundle/Repository/UserRepository.php
+++ b/src/Bundle/ChillMainBundle/Repository/UserRepository.php
@@ -17,6 +17,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ObjectRepository;
+
use function count;
final class UserRepository implements ObjectRepository
diff --git a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php
index a94cf41f3..763eab0e5 100644
--- a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php
+++ b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php
@@ -16,6 +16,7 @@ use Knp\Menu\ItemInterface;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_key_exists;
use function array_merge;
use function array_values;
diff --git a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php
index adadc3422..099c4e438 100644
--- a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php
+++ b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Search;
use DateTime;
+
use function array_key_exists;
use function strpos;
diff --git a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php
index 5a68fab37..5c3c6b057 100644
--- a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php
+++ b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Search\Entity;
use Chill\MainBundle\Repository\UserRepository;
use Chill\MainBundle\Search\SearchApiInterface;
use Chill\MainBundle\Search\SearchApiQuery;
+
use function array_map;
use function in_array;
diff --git a/src/Bundle/ChillMainBundle/Search/SearchApi.php b/src/Bundle/ChillMainBundle/Search/SearchApi.php
index b0740b383..7436b3303 100644
--- a/src/Bundle/ChillMainBundle/Search/SearchApi.php
+++ b/src/Bundle/ChillMainBundle/Search/SearchApi.php
@@ -16,6 +16,7 @@ use Chill\MainBundle\Serializer\Model\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
+
use function array_map;
use function array_merge;
use function count;
diff --git a/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php b/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php
index 46dfc759b..1f3a1b3df 100644
--- a/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php
+++ b/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Search;
use RuntimeException;
use Throwable;
+
use function implode;
class SearchApiNoQueryException extends RuntimeException
diff --git a/src/Bundle/ChillMainBundle/Search/SearchProvider.php b/src/Bundle/ChillMainBundle/Search/SearchProvider.php
index 61eb3fcd8..efae25751 100644
--- a/src/Bundle/ChillMainBundle/Search/SearchProvider.php
+++ b/src/Bundle/ChillMainBundle/Search/SearchProvider.php
@@ -276,8 +276,10 @@ class SearchProvider
//remove from search pattern
$this->mustBeExtracted[] = $matches[0][$key];
//strip parenthesis
- if (mb_substr($match, 0, 1) === '"'
- && mb_substr($match, mb_strlen($match) - 1) === '"') {
+ if (
+ mb_substr($match, 0, 1) === '"'
+ && mb_substr($match, mb_strlen($match) - 1) === '"'
+ ) {
$match = trim(mb_substr($match, 1, mb_strlen($match) - 2));
}
$terms[$matches[1][$key]] = $match;
diff --git a/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php b/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php
index 058bfe070..6035744e1 100644
--- a/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php
+++ b/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Search\Utils;
use DateTimeImmutable;
+
use function preg_match_all;
use function strtr;
use function trim;
diff --git a/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php b/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php
index caad6d093..b6286fa35 100644
--- a/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php
+++ b/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Search\Utils;
use LogicException;
+
use function count;
use function implode;
use function preg_match;
diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
index 2cca61e9f..2392457b8 100644
--- a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
+++ b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
@@ -13,8 +13,10 @@ namespace Chill\MainBundle\Security\Authorization;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
+
use function get_class;
use function in_array;
+
use const E_USER_DEPRECATED;
/**
diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
index de7bff9ab..c1db57b7f 100644
--- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
+++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
@@ -23,6 +23,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\User\UserInterface;
use Traversable;
use UnexpectedValueException;
+
use function array_merge;
use function get_class;
diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php
index 95f070b3b..01f04acd4 100644
--- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php
+++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
+
use function in_array;
final class DefaultVoterHelper implements VoterHelperInterface
diff --git a/src/Bundle/ChillMainBundle/Security/ParentRoleHelper.php b/src/Bundle/ChillMainBundle/Security/ParentRoleHelper.php
index 137c774b2..317ec4cd1 100644
--- a/src/Bundle/ChillMainBundle/Security/ParentRoleHelper.php
+++ b/src/Bundle/ChillMainBundle/Security/ParentRoleHelper.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Security;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
+
use function array_keys;
use function in_array;
diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php
index 40787fe74..a47443486 100644
--- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php
+++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\User;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
+
use function in_array;
class PasswordRecoverVoter extends Voter
diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php
index e6f3db0e7..1244e2a61 100644
--- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php
+++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Notification\Mailer;
use DateTimeInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+
use function array_merge;
class RecoverPasswordHelper
diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
index 3d9eb29d2..5d3673b84 100644
--- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
+++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
@@ -17,6 +17,7 @@ use DateTimeImmutable;
use DateTimeInterface;
use Psr\Log\LoggerInterface;
use UnexpectedValueException;
+
use function bin2hex;
use function hash;
use function hex2bin;
diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php
index 2dfe1ecf2..dc873ee79 100644
--- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php
+++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Security\Resolver;
use Chill\MainBundle\Entity\Center;
use UnexpectedValueException;
+
use function get_class;
use function is_array;
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php
index fd250e967..f66eb4de6 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php
@@ -48,8 +48,9 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
/**
* @param Address $address
+ * @param null|string $format
*/
- public function normalize($address, ?string $format = null, array $context = [])
+ public function normalize($address, $format = null, array $context = [])
{
if ($address instanceof Address) {
$text = $address->isNoAddress() ? '' : $address->getStreet() . ', ' . $address->getStreetNumber();
@@ -118,7 +119,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
throw new UnexpectedValueException();
}
- public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ public function supportsNormalization($data, $format = null, array $context = []): bool
{
if ('json' === $format) {
return $data instanceof Address;
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php
index cbe712ee8..c4d7fa871 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php
@@ -17,6 +17,7 @@ use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+
use function array_key_exists;
class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
@@ -28,7 +29,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
$this->repository = $repository;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
if (false === array_key_exists('type', $data)) {
throw new InvalidArgumentException('missing "type" key in data');
@@ -51,7 +52,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
return $center;
}
- public function normalize($center, ?string $format = null, array $context = [])
+ public function normalize($center, $format = null, array $context = [])
{
/** @var Center $center */
return [
@@ -61,12 +62,12 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
];
}
- public function supportsDenormalization($data, string $type, ?string $format = null)
+ public function supportsDenormalization($data, $type, $format = null)
{
return Center::class === $type;
}
- public function supportsNormalization($data, ?string $format = null): bool
+ public function supportsNormalization($data, $format = null): bool
{
return $data instanceof Center && 'json' === $format;
}
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php
index 0c80e0439..7ca4d563c 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php
@@ -22,8 +22,9 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf
/**
* @param Collection $collection
+ * @param null|string $format
*/
- public function normalize($collection, ?string $format = null, array $context = [])
+ public function normalize($collection, $format = null, array $context = [])
{
$paginator = $collection->getPaginator();
@@ -40,7 +41,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf
];
}
- public function supportsNormalization($data, ?string $format = null): bool
+ public function supportsNormalization($data, $format = null): bool
{
return $data instanceof Collection;
}
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php
index 032fa484d..70958d5a9 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php
@@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
+
use function array_key_exists;
use function is_array;
@@ -35,7 +36,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
$this->parameterBag = $parameterBag;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
if (null === $data) {
return null;
@@ -53,7 +54,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
throw new UnexpectedValueException();
}
- public function normalize($date, ?string $format = null, array $context = [])
+ public function normalize($date, $format = null, array $context = [])
{
/** @var DateTimeInterface $date */
switch ($format) {
@@ -90,7 +91,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
}
}
- public function supportsDenormalization($data, string $type, ?string $format = null): bool
+ public function supportsDenormalization($data, $type, $format = null): bool
{
return DateTimeInterface::class === $type
|| DateTime::class === $type
@@ -98,7 +99,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|| (is_array($data) && array_key_exists('datetime', $data));
}
- public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ public function supportsNormalization($data, $format = null, array $context = []): bool
{
if ('json' === $format) {
return $data instanceof DateTimeInterface;
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php
index f31b5d60d..77f14c8da 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php
@@ -16,6 +16,7 @@ use Symfony\Component\Serializer\Exception\RuntimeException;
use Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
+
use function count;
use function implode;
@@ -37,7 +38,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
*/
public const TYPE = '@multi';
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
foreach ($context[self::ALLOWED_TYPES] as $localType) {
if ($this->denormalizer->supportsDenormalization($data, $localType, $format)) {
@@ -53,7 +54,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
'ALLOWED_TYPES: %s', implode(', ', $context[self::ALLOWED_TYPES])));
}
- public function supportsDenormalization($data, string $type, ?string $format = null, array $context = [])
+ public function supportsDenormalization($data, $type, $format = null, array $context = [])
{
if (self::TYPE !== $type) {
return false;
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
index aa9d12e24..1cf94ac9f 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
@@ -16,6 +16,7 @@ use Doctrine\ORM\Mapping\ClassMetadata;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
+
use function array_key_exists;
use function count;
use function is_array;
@@ -32,7 +33,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface
$this->serializerMetadataFactory = $serializerMetadataFactory;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
if (array_key_exists(AbstractNormalizer::OBJECT_TO_POPULATE, $context)) {
return $context[AbstractNormalizer::OBJECT_TO_POPULATE];
@@ -42,7 +43,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface
->find($data['id']);
}
- public function supportsDenormalization($data, string $type, ?string $format = null)
+ public function supportsDenormalization($data, $type, $format = null)
{
if (false === is_array($data)) {
return false;
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php
index c8c532802..479cc6864 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php
@@ -13,14 +13,14 @@ namespace Chill\MainBundle\Serializer\Normalizer;
use Chill\MainBundle\Doctrine\Model\Point;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
-
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
+
use function count;
use function is_array;
class PointNormalizer implements DenormalizerInterface
{
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
if (!is_array($data)) {
throw new InvalidArgumentException('point data is not an array. It should be an array of 2 coordinates.');
@@ -33,7 +33,7 @@ class PointNormalizer implements DenormalizerInterface
return Point::fromLonLat($data[0], $data[1]);
}
- public function supportsDenormalization($data, string $type, ?string $format = null): bool
+ public function supportsDenormalization($data, $type, $format = null): bool
{
return Point::class === $type;
}
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
index d8c616d82..082491bd0 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
@@ -40,7 +40,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
$this->userRender = $userRender;
}
- public function normalize($user, ?string $format = null, array $context = [])
+ public function normalize($user, $format = null, array $context = [])
{
/** @var User $user */
$userJobContext = array_merge(
@@ -77,7 +77,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
];
}
- public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ public function supportsNormalization($data, $format = null, array $context = []): bool
{
if ($data instanceof User && ('json' === $format || 'docgen' === $format)) {
return true;
diff --git a/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php b/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php
index 55212c64f..9bb29c21d 100644
--- a/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php
+++ b/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php
@@ -13,7 +13,6 @@ namespace Chill\MainBundle\Templating;
use Parsedown;
use Twig\Extension\AbstractExtension;
-
use Twig\TwigFilter;
/**
diff --git a/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php b/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
index 4bc0cffd4..782522760 100644
--- a/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
+++ b/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
@@ -15,6 +15,7 @@ use DateTimeInterface;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
+
use function array_merge;
class ChillTwigHelper extends AbstractExtension
diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
index 264f11688..1af5607c9 100644
--- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
+++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Templating\Entity;
use Chill\MainBundle\Entity\Address;
use Symfony\Component\Templating\EngineInterface;
+
use function array_merge;
use function strtr;
diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
index a6285d26b..aa2401c1e 100644
--- a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
+++ b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Templating\Entity;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Repository\UserRepository;
use Symfony\Component\Templating\EngineInterface;
+
use function array_merge;
class CommentRender extends AbstractChillEntityRender
diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
index 9247b8ffb..1fc83c2db 100644
--- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
+++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Templating\Entity;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Templating\EngineInterface;
+
use function array_merge;
class UserRender implements ChillEntityRenderInterface
diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php
index 82b5f8295..64694285e 100644
--- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php
+++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Form\Type\Listing\FilterOrderType;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RequestStack;
+
use function array_merge;
use function count;
diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php
index 9e6cb813c..38e2f3542 100644
--- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php
+++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php
@@ -55,11 +55,13 @@ class FilterOrderHelperBuilder
$helper->setSearchBox($this->searchBoxFields);
- foreach ($this->checkboxes as $name => [
- 'choices' => $choices,
- 'default' => $default,
- 'trans' => $trans,
- ]) {
+ foreach (
+ $this->checkboxes as $name => [
+ 'choices' => $choices,
+ 'default' => $default,
+ 'trans' => $trans,
+ ]
+ ) {
$helper->addCheckbox($name, $choices, $default, $trans);
}
diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php
index 88bb8f89d..66687711c 100644
--- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php
+++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Templating;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_key_exists;
final class TranslatableStringHelper implements TranslatableStringHelperInterface
diff --git a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php
index b8b751b81..dd3b8ee7f 100644
--- a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php
+++ b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php
@@ -16,6 +16,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
+
use function array_key_exists;
use function ksort;
diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php
index f5b26b353..9563ed4bf 100644
--- a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php
+++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php
@@ -15,6 +15,7 @@ use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Traversable;
+
use function call_user_func;
use function count;
use function is_array;
diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php
index 99e9779f1..7a888eb01 100644
--- a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php
+++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php
@@ -19,6 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Role\Role;
use Traversable;
+
use function call_user_func;
use function count;
use function is_array;
diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php
index 78cf0083a..44d52779d 100644
--- a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php
+++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Test\Export;
use Doctrine\ORM\QueryBuilder;
use Exception;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
+
use function count;
use function get_class;
use function is_array;
diff --git a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
index c36751960..a6cd9d6df 100644
--- a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
+++ b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
@@ -18,6 +18,7 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\Query\ResultSetMapping;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+
use function array_key_exists;
use function is_string;
@@ -291,7 +292,7 @@ class TimelineBuilder implements ContainerAwareInterface
$data = $this->getTemplateData(
$result['type'],
$entitiesByType[$result['type']][$result['id']], //the entity
- $context,
+ $context,
$args
);
diff --git a/src/Bundle/ChillMainBundle/Util/CountriesInfo.php b/src/Bundle/ChillMainBundle/Util/CountriesInfo.php
index 05089a04f..e5b392856 100644
--- a/src/Bundle/ChillMainBundle/Util/CountriesInfo.php
+++ b/src/Bundle/ChillMainBundle/Util/CountriesInfo.php
@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Util;
use UnexpectedValueException;
+
use function array_key_exists;
/**
diff --git a/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php b/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php
index 07f8b14ff..253f72aef 100644
--- a/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php
+++ b/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php
@@ -15,6 +15,7 @@ use DateTimeImmutable;
use DateTimeInterface;
use DateTimeZone;
use LogicException;
+
use function array_diff;
use function array_flip;
use function array_intersect_key;
@@ -24,6 +25,7 @@ use function array_unique;
use function array_values;
use function count;
use function ksort;
+
use const PHP_INT_MAX;
/**
diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php
index 5cc283d95..398c7b551 100644
--- a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php
+++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Validator\Constraints\Entity;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
+
use function call_user_func;
class UserCircleConsistencyValidator extends ConstraintValidator
diff --git a/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php b/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php
index 910a6b028..ac80f2a58 100644
--- a/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php
+++ b/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
use Doctrine\ORM\Query\ResultSetMapping;
use RuntimeException;
use Symfony\Component\DependencyInjection\ContainerInterface;
+
use function count;
/**
diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
index 930b96e07..63c6313ac 100644
--- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
+++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
@@ -17,6 +17,7 @@ use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+
use function array_merge;
use function implode;
use function in_array;
diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php
index d3de0bd3d..5143592b8 100644
--- a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php
+++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php
@@ -16,6 +16,7 @@ use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\QueryBuilder;
use Exception;
use Symfony\Component\HttpFoundation\Request;
+
use function array_merge;
/**
diff --git a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
index 3af14fb0b..4a2e86236 100644
--- a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
+++ b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
@@ -20,6 +20,7 @@ use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+
use function ctype_digit;
final class ChillPersonMoveCommand extends Command
diff --git a/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php b/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
index d3500acd6..fd328efc4 100644
--- a/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
+++ b/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
@@ -39,6 +39,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
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;
@@ -46,6 +47,7 @@ use function get_class;
use function in_array;
use function is_array;
use function json_decode;
+
use const JSON_PRETTY_PRINT;
use const LC_TIME;
@@ -417,13 +419,15 @@ final class ImportPeopleFromCSVCommand extends Command
$line = $this->line = 1;
try {
- while (false !== ($row = fgetcsv(
- $csv,
- $input->getOption('length'),
- $input->getOption('delimiter'),
- $input->getOption('enclosure'),
- $input->getOption('escape')
- ))) {
+ while (
+ false !== ($row = fgetcsv(
+ $csv,
+ $input->getOption('length'),
+ $input->getOption('delimiter'),
+ $input->getOption('enclosure'),
+ $input->getOption('escape')
+ ))
+ ) {
$this->logger->debug('Processing line ' . $this->line);
if (1 === $line) {
@@ -450,8 +454,10 @@ final class ImportPeopleFromCSVCommand extends Command
$this->eventDispatcher->dispatch('chill_person.person_import', $event);
- if ($this->input->getOption('force') === true
- && false === $event->skipPerson) {
+ if (
+ $this->input->getOption('force') === true
+ && false === $event->skipPerson
+ ) {
$this->em->persist($person);
}
@@ -602,8 +608,10 @@ final class ImportPeopleFromCSVCommand extends Command
->getResult();
if (count($postalCodes) >= 1) {
- if ($postalCodes[0]->getCode() === $postalCode
- && $postalCodes[0]->getName() === $locality) {
+ if (
+ $postalCodes[0]->getCode() === $postalCode
+ && $postalCodes[0]->getName() === $locality
+ ) {
return $postalCodes[0];
}
}
@@ -625,7 +633,7 @@ final class ImportPeopleFromCSVCommand extends Command
$question = new ChoiceQuestion(
sprintf(
'Which postal code match the '
- . 'name "%s" with postal code "%s" ? (default to "%s")',
+ . 'name "%s" with postal code "%s" ? (default to "%s")',
$locality,
$postalCode,
$names[0]
@@ -658,13 +666,15 @@ final class ImportPeopleFromCSVCommand extends Command
$csv = $this->openCSV();
// getting the first row
- if (false !== ($row = fgetcsv(
- $csv,
- $input->getOption('length'),
- $input->getOption('delimiter'),
- $input->getOption('enclosure'),
- $input->getOption('escape')
- ))) {
+ if (
+ false !== ($row = fgetcsv(
+ $csv,
+ $input->getOption('length'),
+ $input->getOption('delimiter'),
+ $input->getOption('enclosure'),
+ $input->getOption('escape')
+ ))
+ ) {
try {
$this->matchColumnToCustomField($row);
} finally {
@@ -863,7 +873,9 @@ final class ImportPeopleFromCSVCommand extends Command
if (!isset($this->cacheAnswersMapping[$cf->getSlug()][$value])) {
// try to find the answer (with array_keys and a search value
$values = array_keys(
- array_map(static function ($label) { return trim(strtolower($label)); }, $answers),
+ array_map(static function ($label) {
+ return trim(strtolower($label));
+ }, $answers),
trim(strtolower($value)),
true
);
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
index 9445dc302..3b051a59d 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
@@ -38,6 +38,7 @@ use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\ConstraintViolationListInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Workflow\Registry;
+
use function array_values;
use function count;
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php
index c5b8ed878..65e83cdbc 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php
@@ -1,21 +1,31 @@
setAccompanyingPeriod($accompanyingCourse);
$form = $this->createCommentForm($newComment, 'new');
+ $editForm = null;
if ($request->query->has('edit')) {
foreach ($accompanyingCourse->getComments() as $comment) {
@@ -37,23 +48,29 @@ class AccompanyingCourseCommentController extends Controller
}
}
$pinnedComment = $accompanyingCourse->getPinnedComment();
+
if ($pinnedComment->getId() === $request->query->getInt('edit')) {
$editForm = $this->createCommentForm($pinnedComment, 'edit');
$commentEditId = $pinnedComment->getId();
}
}
+ if (null === $editForm) {
+ throw new NotFoundHttpException('Unable to find an edit form.');
+ }
+
if ($request->getMethod() === Request::METHOD_POST) {
+ $currentForm = $editForm->handleRequest($request);
+
if (array_key_exists('edit', $request->request->all()[$editForm->getName()])) {
- $currentForm = $editForm->handleRequest($request);
$isEditingNew = false;
} else {
- $currentForm = $form->handleRequest($request);
$isEditingNew = true;
}
if ($currentForm->isSubmitted() && $currentForm->isValid()) {
$em = $this->getDoctrine()->getManager();
+
if ($isEditingNew) {
$em->persist($newComment);
}
@@ -61,14 +78,14 @@ class AccompanyingCourseCommentController extends Controller
}
return $this->redirectToRoute('chill_person_accompanying_period_comment_list', [
- 'accompanying_period_id' => $accompanyingCourse->getId()
+ 'accompanying_period_id' => $accompanyingCourse->getId(),
]);
}
return $this->render('@ChillPerson/AccompanyingCourse/comment_list.html.twig', [
'accompanyingCourse' => $accompanyingCourse,
'form' => $form->createView(),
- 'edit_form' => isset($editForm) ? $editForm->createView() : null,
+ 'edit_form' => null !== $editForm ? $editForm->createView() : null,
'commentEditId' => $commentEditId ?? null,
]);
}
@@ -78,7 +95,7 @@ class AccompanyingCourseCommentController extends Controller
$form = $this->createForm(AccompanyingCourseCommentType::class, $comment);
if ('edit' === $step) {
- $form->add('edit', HiddenType::class, ['mapped' => false ]);
+ $form->add('edit', HiddenType::class, ['mapped' => false]);
}
return $form;
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
index 7d0e841cf..5088b2381 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
@@ -30,6 +30,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Workflow\Registry;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function is_array;
/**
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php
index 1da7424bf..7e7b9a0c2 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php
@@ -67,7 +67,7 @@ class AccompanyingCourseWorkController extends AbstractController
'error',
$this->trans->trans(
'accompanying_work.You must add at least ' .
- 'one social issue on accompanying period'
+ 'one social issue on accompanying period'
)
);
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
index bfc85a5b3..bb0081c27 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
@@ -27,6 +27,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Validator\ConstraintViolationListInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
+
use function array_filter;
use function count;
@@ -170,8 +171,10 @@ class AccompanyingPeriodController extends AbstractController
$errors = $this->_validatePerson($person);
$flashBag = $this->get('session')->getFlashBag();
- if ($form->isValid(['Default', 'closed'])
- && count($errors) === 0) {
+ if (
+ $form->isValid(['Default', 'closed'])
+ && count($errors) === 0
+ ) {
$em = $this->getDoctrine()->getManager();
$em->persist($accompanyingPeriod);
$em->flush();
@@ -405,8 +408,10 @@ class AccompanyingPeriodController extends AbstractController
$errors = $this->_validatePerson($person);
$flashBag = $this->get('session')->getFlashBag();
- if ($form->isValid(['Default', 'closed'])
- && count($errors) === 0) {
+ if (
+ $form->isValid(['Default', 'closed'])
+ && count($errors) === 0
+ ) {
$em->flush();
$flashBag->add(
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php
index ddd3445a4..de9433558 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php
@@ -22,6 +22,7 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\SerializerInterface;
+
use function count;
use function in_array;
diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php
index 62f4fc68f..da8655f3d 100644
--- a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php
@@ -24,6 +24,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
+
use function array_filter;
use function array_values;
@@ -93,8 +94,10 @@ class HouseholdApiController extends ApiController
$addresses[$a->getId()] = $a;
}
- if (null !== $personLocation = $participation
- ->getAccompanyingPeriod()->getPersonLocation()) {
+ if (
+ null !== $personLocation = $participation
+ ->getAccompanyingPeriod()->getPersonLocation()
+ ) {
$a = $personLocation->getCurrentHouseholdAddress();
if (null !== $a) {
diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php
index 6ce73d508..ba4b788d7 100644
--- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php
@@ -25,6 +25,7 @@ use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_key_exists;
use function count;
diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
index 012d0fd68..78234d114 100644
--- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
@@ -27,6 +27,7 @@ use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Serializer\Exception;
use Symfony\Component\Translation\TranslatorInterface;
+
use function count;
class HouseholdMemberController extends ApiController
@@ -186,7 +187,7 @@ class HouseholdMemberController extends ApiController
$_format,
['groups' => ['read']]
);
- } catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) {
+ } catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) {
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e);
}
diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php
index d387ff737..2d4a60c15 100644
--- a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php
@@ -18,6 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\Validator\ValidatorInterface;
+
use function count;
/**
diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php
index b94e24b0c..28966c4e5 100644
--- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php
@@ -20,6 +20,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
+
use function array_filter;
use function array_values;
diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php
index f810852c0..02c77ebd3 100644
--- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php
@@ -32,6 +32,7 @@ use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
+
use function count;
use function hash;
use function implode;
@@ -207,8 +208,10 @@ final class PersonController extends AbstractController
{
$person = new Person();
- if (1 === count($this->security->getUser()
- ->getGroupCenters())) {
+ if (
+ 1 === count($this->security->getUser()
+ ->getGroupCenters())
+ ) {
$person->setCenter(
$this->security->getUser()
->getGroupCenters()[0]
@@ -227,8 +230,10 @@ final class PersonController extends AbstractController
if ($request->getMethod() === Request::METHOD_GET) {
$this->lastPostDataReset();
- } elseif ($request->getMethod() === Request::METHOD_POST
- && $form->isValid()) {
+ } elseif (
+ $request->getMethod() === Request::METHOD_POST
+ && $form->isValid()
+ ) {
$alternatePersons = $this->similarPersonMatcher
->matchPerson($person);
diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
index 0b3f36b1c..182a90d5a 100644
--- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
@@ -29,6 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Translation\TranslatorInterface;
+
use function count;
class PersonDuplicateController extends Controller
diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php
index 24c1c6645..a6042b0a6 100644
--- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php
@@ -17,6 +17,7 @@ use Chill\MainBundle\Serializer\Model\Collection;
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
+
use function count;
class SocialWorkSocialActionApiController extends ApiController
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/Helper/PersonRandomHelper.php b/src/Bundle/ChillPersonBundle/DataFixtures/Helper/PersonRandomHelper.php
index 4f5a51fd4..5b4eeb723 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/Helper/PersonRandomHelper.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/Helper/PersonRandomHelper.php
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\DataFixtures\Helper;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
+
use function array_pop;
use function random_int;
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/Helper/RandomPersonHelperTrait.php b/src/Bundle/ChillPersonBundle/DataFixtures/Helper/RandomPersonHelperTrait.php
index 516914f5f..00281311e 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/Helper/RandomPersonHelperTrait.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/Helper/RandomPersonHelperTrait.php
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\DataFixtures\Helper;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
+
use function random_int;
trait RandomPersonHelperTrait
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php
index d4bfe9a2d..2d368d2f4 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php
@@ -14,7 +14,6 @@ namespace Chill\PersonBundle\DataFixtures\ORM;
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
-
use Doctrine\Persistence\ObjectManager;
/**
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php
index d34c705ac..83698735e 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php
@@ -19,6 +19,7 @@ use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
use Chill\PersonBundle\Repository\SocialWork\EvaluationRepository;
use DateTimeImmutable;
use Doctrine\Persistence\ObjectManager;
+
use function array_pop;
use function array_rand;
use function count;
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php
index 9541aa76b..1e6435c8b 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php
@@ -28,7 +28,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class LoadCustomFields extends AbstractFixture implements
- ContainerAwareInterface,
+ ContainerAwareInterface,
OrderedFixtureInterface
{
/**
@@ -115,7 +115,9 @@ class LoadCustomFields extends AbstractFixture implements
// get possible values for cfGroup
$choices = array_map(
- static function ($a) { return $a['slug']; },
+ static function ($a) {
+ return $a['slug'];
+ },
$this->customFieldChoice->getOptions()['choices']
);
// create faker
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php
index 6f9edd768..02b5ef2e7 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php
@@ -25,6 +25,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager;
use Nelmio\Alice\Loader\NativeLoader;
+
use function array_pop;
use function array_rand;
use function random_int;
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php
index 42d2b7dd8..1642a71b9 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php
@@ -31,8 +31,10 @@ class LoadHouseholdPosition extends Fixture
public function load(ObjectManager $manager)
{
- foreach (self::POSITIONS_DATA as [$name, $share, $allowHolder,
- $ordering, $ref, ]) {
+ foreach (
+ self::POSITIONS_DATA as [$name, $share, $allowHolder,
+ $ordering, $ref, ]
+ ) {
$position = (new Position())
->setLabel(['fr' => $name])
->setAllowHolder($allowHolder)
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
index 924155955..b3bdd908f 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
@@ -42,6 +42,7 @@ use Nelmio\Alice\Loader\NativeLoader;
use Nelmio\Alice\ObjectSet;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\Workflow\Registry;
+
use function count;
use function random_int;
use function ucfirst;
diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php
index 80f3e711d..4fa9802f8 100644
--- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php
+++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php
@@ -20,6 +20,7 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager;
+
use function count;
class LoadRelationships extends Fixture implements DependentFixtureInterface
diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
index 65a45c2e6..000720a7f 100644
--- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
+++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
@@ -23,6 +23,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
use function array_key_exists;
/**
diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php b/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php
index c4f4dbdf3..31c04a59b 100644
--- a/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php
+++ b/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\DependencyInjection\CompilerPass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
index 685010836..9628da187 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
@@ -42,8 +42,10 @@ use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\GroupSequenceProviderInterface;
use UnexpectedValueException;
+
use function count;
use function in_array;
+
use const SORT_REGULAR;
/**
@@ -533,8 +535,10 @@ class AccompanyingPeriod implements
public function getCenters(): ?iterable
{
foreach ($this->getPersons() as $person) {
- if (!in_array($person->getCenter(), $centers ?? [], true)
- && null !== $person->getCenter()) {
+ if (
+ !in_array($person->getCenter(), $centers ?? [], true)
+ && null !== $person->getCenter()
+ ) {
$centers[] = $person->getCenter();
}
}
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php
index df4a5f5de..97424c2e3 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php
@@ -410,8 +410,10 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
*/
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
{
- if ($this->accompanyingPeriod instanceof AccompanyingPeriod
- && $accompanyingPeriod !== $this->accompanyingPeriod) {
+ if (
+ $this->accompanyingPeriod instanceof AccompanyingPeriod
+ && $accompanyingPeriod !== $this->accompanyingPeriod
+ ) {
throw new LogicException('A work cannot change accompanyingPeriod');
}
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php
index 479bbfb87..f9fbc95f9 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php
@@ -268,7 +268,8 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
if (
$accompanyingPeriodWork instanceof AccompanyingPeriodWork
&& $this->accompanyingPeriodWork instanceof AccompanyingPeriodWork
- && $this->accompanyingPeriodWork->getId() !== $accompanyingPeriodWork->getId()) {
+ && $this->accompanyingPeriodWork->getId() !== $accompanyingPeriodWork->getId()
+ ) {
throw new RuntimeException('Changing the ' .
'accompanyingPeriodWork is not allowed');
}
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php
index 538cffc36..cbb4231b8 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php
@@ -144,8 +144,10 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
{
// if an evaluation is already associated, we cannot change the association (removing the association,
// by setting a null value, is allowed.
- if ($this->accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
- && $accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation) {
+ if (
+ $this->accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
+ && $accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
+ ) {
if ($this->accompanyingPeriodWorkEvaluation !== $accompanyingPeriodWorkEvaluation) {
throw new RuntimeException('It is not allowed to change the evaluation for a document');
}
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php
index c31dfaa83..0c5517b71 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php
@@ -117,7 +117,8 @@ class AccompanyingPeriodWorkGoal
public function setAccompanyingPeriodWork(?AccompanyingPeriodWork $accompanyingPeriodWork): self
{
- if ($this->accompanyingPeriodWork instanceof AccompanyingPeriodWork
+ if (
+ $this->accompanyingPeriodWork instanceof AccompanyingPeriodWork
&& $accompanyingPeriodWork !== $this->accompanyingPeriodWork
&& null !== $accompanyingPeriodWork
) {
diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php
index 95aa83872..865526250 100644
--- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php
+++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php
@@ -24,6 +24,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function count;
/**
@@ -254,7 +255,9 @@ class Household
public function getCurrentPersons(?DateTimeImmutable $now = null): Collection
{
return $this->getCurrentMembers($now)
- ->map(static function (HouseholdMember $m) { return $m->getPerson(); });
+ ->map(static function (HouseholdMember $m) {
+ return $m->getPerson();
+ });
}
public function getId(): ?int
diff --git a/src/Bundle/ChillPersonBundle/EventListener/PersonEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/PersonEventListener.php
index d3b4beb47..993435ce5 100644
--- a/src/Bundle/ChillPersonBundle/EventListener/PersonEventListener.php
+++ b/src/Bundle/ChillPersonBundle/EventListener/PersonEventListener.php
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\EventListener;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\PersonAltName;
+
use const MB_CASE_TITLE;
class PersonEventListener
diff --git a/src/Bundle/ChillPersonBundle/Export/AbstractAccompanyingPeriodExportElement.php b/src/Bundle/ChillPersonBundle/Export/AbstractAccompanyingPeriodExportElement.php
index b570c83de..264f47955 100644
--- a/src/Bundle/ChillPersonBundle/Export/AbstractAccompanyingPeriodExportElement.php
+++ b/src/Bundle/ChillPersonBundle/Export/AbstractAccompanyingPeriodExportElement.php
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Export;
use Doctrine\ORM\QueryBuilder;
use LogicException;
+
use function in_array;
class AbstractAccompanyingPeriodExportElement
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
index ffa69026a..27774c885 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
@@ -90,7 +90,9 @@ class CountPerson implements ExportInterface
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
- $centers = array_map(static function ($el) { return $el['center']; }, $acl);
+ $centers = array_map(static function ($el) {
+ return $el['center'];
+ }, $acl);
$qb = $this->entityManager->createQueryBuilder();
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
index 6c02f4033..4528f1c92 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
@@ -32,6 +32,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function addcslashes;
use function array_key_exists;
use function array_keys;
@@ -266,7 +267,9 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
- $centers = array_map(static function ($el) { return $el['center']; }, $acl);
+ $centers = array_map(static function ($el) {
+ return $el['center'];
+ }, $acl);
// throw an error if any fields are present
if (!array_key_exists('fields', $data)) {
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
index c7587874b..a1adee826 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
@@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function array_filter;
use function count;
use function implode;
diff --git a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
index 2924b7e35..7ff30524f 100644
--- a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
+++ b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
@@ -16,6 +16,7 @@ use Chill\PersonBundle\Repository\PersonRepository;
use RuntimeException;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
+
use function call_user_func;
use function count;
use function in_array;
@@ -76,8 +77,10 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
$person = $this->personRepository->find($value);
- if ($this->hasCenterFilter()
- && !in_array($person->getCenter(), $this->centers, true)) {
+ if (
+ $this->hasCenterFilter()
+ && !in_array($person->getCenter(), $this->centers, true)
+ ) {
throw new RuntimeException('chosen a person not in correct center');
}
diff --git a/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php b/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php
index 13de3b9f5..d63c5f214 100644
--- a/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php
+++ b/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php
@@ -16,6 +16,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
+
use function array_key_exists;
use function is_array;
diff --git a/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php b/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php
index 43edfb8d0..90d548265 100644
--- a/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php
+++ b/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php
@@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Form\Type;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
-
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
index 98572b8bc..55d242f2d 100644
--- a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
+++ b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
@@ -28,6 +28,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
+
use function in_array;
use function is_array;
@@ -161,10 +162,14 @@ class PickPersonType extends AbstractType
. 'option must be an instance of ' . Center::class);
}
- if (!in_array($c->getId(), array_map(
- static function (Center $c) { return $c->getId(); },
- $centers
- ), true)) {
+ if (
+ !in_array($c->getId(), array_map(
+ static function (Center $c) {
+ return $c->getId();
+ },
+ $centers
+ ), true)
+ ) {
throw new AccessDeniedException('The given center is not reachable');
}
$selectedCenters[] = $c;
diff --git a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php
index c75b93f7a..742efbc7d 100644
--- a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php
+++ b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php
@@ -19,6 +19,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+
use const SORT_FLAG_CASE;
use const SORT_STRING;
diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php
index 2d3749fa7..4d855a980 100644
--- a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php
+++ b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php
@@ -21,6 +21,7 @@ use LogicException;
use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\ConstraintViolationListInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
+
use function in_array;
use function spl_object_hash;
diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php
index ee359434b..d83fa29dd 100644
--- a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php
+++ b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php
@@ -82,7 +82,8 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
'order' => 99999,
]);
- if ('visible' === $this->showAccompanyingPeriod
+ if (
+ 'visible' === $this->showAccompanyingPeriod
&& $this->security->isGranted(AccompanyingPeriodVoter::SEE, $parameters['person'])
) {
$menu->addChild($this->translator->trans('Accompanying period list'), [
diff --git a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php
index 0bfd7a435..10e25c327 100644
--- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php
+++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php
@@ -33,6 +33,7 @@ namespace Chill\PersonBundle\Privacy;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\EventDispatcher\Event;
+
use function count;
/**
diff --git a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php
index 5018743dc..480ddcb24 100644
--- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php
+++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php
@@ -35,6 +35,7 @@ use Chill\PersonBundle\Entity\Person;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function array_map;
class PrivacyEventSubscriber implements EventSubscriberInterface
@@ -75,7 +76,9 @@ class PrivacyEventSubscriber implements EventSubscriberInterface
$involved = $this->getInvolved();
$involved['period_id'] = $event->getPeriod()->getId();
$involved['persons'] = $event->getPeriod()->getPersons()
- ->map(static function (Person $p) { return $p->getId(); })
+ ->map(static function (Person $p) {
+ return $p->getId();
+ })
->toArray();
$this->logger->notice(
@@ -99,7 +102,9 @@ class PrivacyEventSubscriber implements EventSubscriberInterface
if ($event->hasPersons()) {
$involved['persons'] = array_map(
- static function (Person $p) { return $p->getId(); },
+ static function (Person $p) {
+ return $p->getId();
+ },
$event->getPersons()
);
}
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php
index 965231e3f..6e6c3ca44 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php
@@ -16,6 +16,7 @@ use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Security\Core\Security;
+
use function count;
final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodACLAwareRepositoryInterface
diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php
index 8becf4409..196bfc269 100644
--- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php
@@ -17,6 +17,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
use Doctrine\Persistence\ObjectRepository;
+
use function strtr;
final class HouseholdRepository implements ObjectRepository
diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php
index 972264282..78745af1d 100644
--- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php
@@ -23,6 +23,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NonUniqueResultException;
use Doctrine\ORM\Query;
use Symfony\Component\Security\Core\Security;
+
use function array_fill;
use function array_map;
use function array_merge;
@@ -316,7 +317,9 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac
),
]
),
- array_map(static function (Center $c) {return $c->getId(); }, $authorizedCenters)
+ array_map(static function (Center $c) {
+ return $c->getId();
+ }, $authorizedCenters)
);
}
}
diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
index 57cea2d55..bd8347852 100644
--- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
@@ -17,6 +17,7 @@ use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ObjectRepository;
use Exception;
+
use function count;
use function in_array;
use function str_replace;
diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php
index 7c5983fd3..0900796d6 100644
--- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php
@@ -8,6 +8,7 @@
*/
declare(strict_types=1);
+
/*
* Chill is a software for social workers
*
diff --git a/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php
index 914d09ffd..e171c8521 100644
--- a/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php
+++ b/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php
@@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
-if (isset($_SERVER['HTTP_CLIENT_IP'])
+if (
+ isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
) {
diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php
index 456b6fca4..08fdf072e 100644
--- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php
+++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php
@@ -28,6 +28,7 @@ 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;
+
use function array_fill_keys;
use function array_filter;
use function array_key_exists;
@@ -330,13 +331,17 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf
$phoneResults = $this->extractPhonenumberFromPattern->extractPhonenumber($datesResults->getFilteredSubject());
$terms['_default'] = $phoneResults->getFilteredSubject();
- if ($datesResults->hasResult() && (!array_key_exists('birthdate', $terms)
- || null !== $terms['birthdate'])) {
+ if (
+ $datesResults->hasResult() && (!array_key_exists('birthdate', $terms)
+ || null !== $terms['birthdate'])
+ ) {
$terms['birthdate'] = $datesResults->getFound()[0]->format('Y-m-d');
}
- if ($phoneResults->hasResult() && (!array_key_exists('phonenumber', $terms)
- || null !== $terms['phonenumber'])) {
+ if (
+ $phoneResults->hasResult() && (!array_key_exists('phonenumber', $terms)
+ || null !== $terms['phonenumber'])
+ ) {
$terms['phonenumber'] = $phoneResults->getFound()[0];
}
diff --git a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php
index fb842b4ae..e2c84275c 100644
--- a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php
+++ b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php
@@ -19,6 +19,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface;
use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface;
use Chill\PersonBundle\Repository\PersonRepository;
use Symfony\Component\Security\Core\Security;
+
use function array_map;
use function count;
use function in_array;
diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
index 8448844a6..98dc14110 100644
--- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
+++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
@@ -18,6 +18,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\PersonBundle\Templating\Entity\PersonRender;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function count;
class SimilarPersonMatcher
diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php
index ca212108a..3915c764a 100644
--- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php
+++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php
@@ -20,6 +20,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Security;
+
use function in_array;
class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
@@ -113,8 +114,10 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
if (AccompanyingPeriod::STEP_DRAFT === $subject->getStep()) {
// only creator can see, edit, delete, etc.
- if ($subject->getCreatedBy() === $token->getUser()
- || null === $subject->getCreatedBy()) {
+ if (
+ $subject->getCreatedBy() === $token->getUser()
+ || null === $subject->getCreatedBy()
+ ) {
return true;
}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php
index 244184ff6..4343561fc 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php
@@ -30,6 +30,7 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function is_array;
class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterface, NormalizerAwareInterface
@@ -92,8 +93,9 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
/**
* @param AccompanyingPeriod|null $period
+ * @param null|string $format
*/
- public function normalize($period, ?string $format = null, array $context = [])
+ public function normalize($period, $format = null, array $context = [])
{
if ($period instanceof AccompanyingPeriod) {
$scopes = $this->scopeResolverDispatcher->isConcerned($period) ? $this->scopeResolverDispatcher->resolveScope($period) : [];
@@ -146,7 +148,9 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
'hasRequestor' => $period->getRequestor() !== null,
'requestorKind' => $period->getRequestorKind(),
];
- } elseif (null === $period) {
+ }
+
+ if (null === $period) {
return array_merge(
(new NormalizeNullValueHelper($this->normalizer, 'type', 'accompanying_period'))
->normalize(self::PERIOD_NULL, $format, $context),
@@ -162,10 +166,10 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
);
}
- throw new InvalidArgumentException('this neither an accompanying period or null');
+ throw new InvalidArgumentException('This neither an accompanying period or null.');
}
- public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ public function supportsNormalization($data, $format = null, array $context = []): bool
{
if ('docgen' !== $format) {
return false;
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php
index 5c05d111e..88dce414f 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php
@@ -19,9 +19,12 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
*/
final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
{
- public function normalize($origin, ?string $format = null, array $context = [])
+ /**
+ * @param Origin $origin
+ * @param null|string $format
+ */
+ public function normalize($origin, $format = null, array $context = [])
{
- /** @var Origin $origin */
return [
'type' => 'origin',
'id' => $origin->getId(),
@@ -30,7 +33,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
];
}
- public function supportsNormalization($data, ?string $format = null): bool
+ public function supportsNormalization($data, $format = null): bool
{
return $data instanceof Origin;
}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php
index b4110a8ae..b392ccc24 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php
@@ -17,11 +17,14 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterface, NormalizerInterface
{
- protected ?NormalizerInterface $normalizer = null;
+ private ?NormalizerInterface $normalizer = null;
- public function normalize($participation, ?string $format = null, array $context = [])
+ /**
+ * @param AccompanyingPeriodParticipation $participation
+ * @param null|string $format
+ */
+ public function normalize($participation, $format = null, array $context = [])
{
- /** @var AccompanyingPeriodParticipation $participation */
return [
'id' => $participation->getId(),
'startDate' => $this->normalizer->normalize($participation->getStartDate(), $format),
@@ -35,8 +38,9 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf
$this->normalizer = $normalizer;
}
- public function supportsNormalization($data, ?string $format = null): bool
+ public function supportsNormalization($data, $format = null): bool
{
+ // @TODO Fix this.
return false;
return $data instanceof AccompanyingPeriodParticipation;
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php
index 0cd71c29e..cb883542a 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php
@@ -21,6 +21,7 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
+
use function array_key_exists;
use function array_merge;
use function count;
@@ -37,7 +38,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
$this->repository = $repository;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
$resource = $this->extractObjectToPopulate($type, $context);
@@ -86,7 +87,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
return $resource;
}
- public function supportsDenormalization($data, string $type, ?string $format = null)
+ public function supportsDenormalization($data, $type, $format = null)
{
return Resource::class === $type;
}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php
index 15551cf86..edbe07e47 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php
@@ -20,6 +20,7 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
+
use function array_key_exists;
use function array_merge;
use function in_array;
@@ -50,7 +51,7 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte
$this->em = $em;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
$work = $this->denormalizer->denormalize($data, $type, $format, array_merge(
$context,
@@ -64,7 +65,7 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte
return $work;
}
- public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool
+ public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
{
return AccompanyingPeriodWork::class === $type
&& self::class !== ($context['skip'] ?? null)
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
index 527434e50..e2fb0f7dc 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
@@ -21,6 +21,7 @@ use Symfony\Component\Serializer\Exception;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
+
use function array_key_exists;
class MembersEditorNormalizer implements DenormalizerAwareInterface, DenormalizerInterface
@@ -34,7 +35,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
$this->factory = $factory;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
// some test about schema first...
$this->performChecks($data);
@@ -49,7 +50,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
return $this->denormalizeMove($data, $type, $format, $context);
}
- public function supportsDenormalization($data, string $type, ?string $format = null)
+ public function supportsDenormalization($data, $type, $format = null)
{
return MembersEditor::class === $type;
}
@@ -152,8 +153,10 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
private function performChecks($data): void
{
- if (null === $data['concerned'] ?? null
- && false === ·\is_array('concerned')) {
+ if (
+ null === $data['concerned'] ?? null
+ && false === ·\is_array('concerned')
+ ) {
throw new Exception\UnexpectedValueException("The schema does not have any key 'concerned'");
}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php
index 3f7fd5d9e..7a728774b 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php
@@ -27,6 +27,7 @@ use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_map;
use function implode;
@@ -56,7 +57,7 @@ class PersonDocGenNormalizer implements
$this->translatableStringHelper = $translatableStringHelper;
}
- public function normalize($person, ?string $format = null, array $context = [])
+ public function normalize($person, $format = null, array $context = [])
{
/** @var Person $person */
$dateContext = $context;
@@ -131,7 +132,7 @@ class PersonDocGenNormalizer implements
return $data;
}
- public function supportsNormalization($data, ?string $format = null, array $context = [])
+ public function supportsNormalization($data, $format = null, array $context = [])
{
if ('docgen' !== $format) {
return false;
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php
index 98e157712..273c2aa32 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php
@@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Serializer\Normalizer;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension;
-use Chill\PersonBundle\Entity\Household\Household;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Repository\PersonRepository;
use DateTime;
@@ -59,7 +58,7 @@ class PersonJsonNormalizer implements
$this->centerResolverManager = $centerResolverManager;
}
- public function denormalize($data, string $type, ?string $format = null, array $context = [])
+ public function denormalize($data, $type, $format = null, array $context = [])
{
$person = $this->extractObjectToPopulate($type, $context);
@@ -140,12 +139,14 @@ class PersonJsonNormalizer implements
return $person;
}
- public function normalize($person, ?string $format = null, array $context = [])
+ /**
+ * @param Person $person
+ * @param null|string $format
+ */
+ public function normalize($person, $format = null, array $context = [])
{
- /** @var Household $household */
$household = $person->getCurrentHousehold();
- /** @var Person $person */
return [
'type' => 'person',
'id' => $person->getId(),
@@ -164,12 +165,12 @@ class PersonJsonNormalizer implements
];
}
- public function supportsDenormalization($data, string $type, ?string $format = null)
+ public function supportsDenormalization($data, $type, $format = null)
{
return Person::class === $type && 'person' === ($data['type'] ?? null);
}
- public function supportsNormalization($data, ?string $format = null): bool
+ public function supportsNormalization($data, $format = null): bool
{
return $data instanceof Person && 'json' === $format;
}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php
index 7d90e40e2..cfae9f6e6 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php
@@ -31,8 +31,9 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
/**
* @param Relationship $relation
+ * @param null|string $format
*/
- public function normalize($relation, ?string $format = null, array $context = [])
+ public function normalize($relation, $format = null, array $context = [])
{
$counterpart = $context['docgen:relationship:counterpart'] ?? null;
$contextPerson = array_merge($context, [
@@ -78,7 +79,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
];
}
- public function supportsNormalization($data, ?string $format = null, array $context = [])
+ public function supportsNormalization($data, $format = null, array $context = [])
{
if ('docgen' !== $format) {
return false;
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php
index e085f0224..e971c793a 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php
@@ -28,7 +28,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
$this->render = $render;
}
- public function normalize($socialAction, ?string $format = null, array $context = [])
+ public function normalize($socialAction, $format = null, array $context = [])
{
switch ($format) {
case 'json':
@@ -58,7 +58,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
}
}
- public function supportsNormalization($data, ?string $format = null, array $context = [])
+ public function supportsNormalization($data, $format = null, array $context = [])
{
if ($data instanceof SocialAction && 'json' === $format) {
return true;
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php
index 5be7df4bc..0e5fb3730 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php
@@ -28,7 +28,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
$this->render = $render;
}
- public function normalize($socialIssue, ?string $format = null, array $context = [])
+ public function normalize($socialIssue, $format = null, array $context = [])
{
/** @var SocialIssue $socialIssue */
switch ($format) {
@@ -37,7 +37,9 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
'type' => 'social_issue',
'id' => $socialIssue->getId(),
'parent_id' => $socialIssue->hasParent() ? $socialIssue->getParent()->getId() : null,
- 'children_ids' => $socialIssue->getChildren()->map(static function (SocialIssue $si) { return $si->getId(); }),
+ 'children_ids' => $socialIssue->getChildren()->map(static function (SocialIssue $si) {
+ return $si->getId();
+ }),
'title' => $socialIssue->getTitle(),
'text' => $this->render->renderString($socialIssue, []),
];
@@ -55,7 +57,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
}
}
- public function supportsNormalization($data, ?string $format = null, array $context = [])
+ public function supportsNormalization($data, $format = null, array $context = [])
{
if ($data instanceof SocialIssue && 'json' === $format) {
return true;
diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
index 60406c3d5..fc19b6590 100644
--- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
+++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
@@ -33,6 +33,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_key_exists;
class AccompanyingPeriodContext implements
@@ -149,7 +150,9 @@ class AccompanyingPeriodContext implements
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
{
$options = $template->getOptions();
- $persons = $entity->getCurrentParticipations()->map(static function (AccompanyingPeriodParticipation $p) { return $p->getPerson(); })
+ $persons = $entity->getCurrentParticipations()->map(static function (AccompanyingPeriodParticipation $p) {
+ return $p->getPerson();
+ })
->toArray();
foreach (['mainPerson', 'person1', 'person2'] as $key) {
@@ -157,7 +160,9 @@ class AccompanyingPeriodContext implements
$builder->add($key, EntityType::class, [
'class' => Person::class,
'choices' => $persons,
- 'choice_label' => function (Person $p) { return $this->personRender->renderString($p, []); },
+ 'choice_label' => function (Person $p) {
+ return $this->personRender->renderString($p, []);
+ },
'multiple' => false,
'expanded' => true,
'label' => $options[$key . 'Label'],
diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
index 26004eee3..b68921abf 100644
--- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
+++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
@@ -60,7 +60,9 @@ class AccompanyingPeriodWorkEvaluationContext implements
$this->accompanyingPeriodWorkContext->adminFormReverseTransform($data),
[
'evaluations' => array_map(
- static function (Evaluation $e) { return $e->getId(); },
+ static function (Evaluation $e) {
+ return $e->getId();
+ },
$data['evaluations']
),
]
@@ -73,7 +75,9 @@ class AccompanyingPeriodWorkEvaluationContext implements
$this->accompanyingPeriodWorkContext->adminFormTransform($data),
[
'evaluations' => array_map(
- function ($id) { return $this->evaluationRepository->find($id); },
+ function ($id) {
+ return $this->evaluationRepository->find($id);
+ },
$data['evaluations'] ?? []
),
]
diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php
index 621b97b7e..83342a435 100644
--- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php
+++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php
@@ -25,6 +25,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\Expr\Comparison;
use Doctrine\Persistence\ObjectRepository;
use Exception;
+
use function count;
final class SocialWorkMetadata implements SocialWorkMetadataInterface
diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
index 1f1601920..6464500c2 100644
--- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
+++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Templating\EngineInterface;
+
use function array_key_exists;
/**
diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php
index e5afe1d66..d8239a082 100644
--- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php
+++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Symfony\Component\Templating\EngineInterface;
+
use function array_merge;
use function array_reverse;
use function implode;
diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
index ecc71038a..56574541e 100644
--- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
+++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
@@ -15,6 +15,7 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Symfony\Component\Templating\EngineInterface;
+
use function array_reverse;
use function implode;
diff --git a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
index a391efe34..8ead27b2f 100644
--- a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
+++ b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
@@ -21,6 +21,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Doctrine\ORM\EntityManager;
use LogicException;
use Symfony\Component\Security\Core\Security;
+
use function implode;
use function in_array;
diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php
index 11e001988..0cf75397b 100644
--- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php
+++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php
@@ -19,6 +19,7 @@ use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
+
use function in_array;
class AccompanyingPeriodValidityValidator extends ConstraintValidator
@@ -68,7 +69,9 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
$periodIssuesWithAncestors = array_merge(
$periodIssuesWithAncestors,
array_map(
- static function (SocialIssue $si) { return $si->getId(); },
+ static function (SocialIssue $si) {
+ return $si->getId();
+ },
$si->getAncestors(true)
)
);
diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php
index 8fe511694..b17e1673a 100644
--- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php
+++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php
@@ -38,9 +38,11 @@ class LocationValidityValidator extends ConstraintValidator
}
if ($period->getLocationStatus() === 'person') {
- if (null === $period->getOpenParticipationContainsPerson(
- $period->getPersonLocation()
- )) {
+ if (
+ null === $period->getOpenParticipationContainsPerson(
+ $period->getPersonLocation()
+ )
+ ) {
$this->context->buildViolation($constraint->messagePersonLocatedMustBeAssociated)
->setParameter('{{ person_name }}', $this->render->renderString(
$period->getPersonLocation(),
@@ -50,8 +52,10 @@ class LocationValidityValidator extends ConstraintValidator
}
}
- if ($period->getStep() !== AccompanyingPeriod::STEP_DRAFT
- && $period->getLocationStatus() === 'none') {
+ if (
+ $period->getStep() !== AccompanyingPeriod::STEP_DRAFT
+ && $period->getLocationStatus() === 'none'
+ ) {
$this->context
->buildViolation(
$constraint->messagePeriodMustRemainsLocated
diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php
index 51014d16b..73c29b1b3 100644
--- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php
+++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php
@@ -19,6 +19,7 @@ use Doctrine\Common\Collections\Collection;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
+
use function count;
class ParticipationOverlapValidator extends ConstraintValidator
diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php
index 6c56c2f3d..3b84137fb 100644
--- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php
+++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php
@@ -18,6 +18,7 @@ use Doctrine\Common\Collections\Collection;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
+
use function count;
use function in_array;
diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php
index e7ee4cad4..89a9ba9a9 100644
--- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php
+++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php
@@ -17,6 +17,7 @@ use Chill\PersonBundle\Templating\Entity\PersonRender;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
+
use function count;
/**
diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php
index 2acc87371..20463f44f 100644
--- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php
+++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php
@@ -16,6 +16,7 @@ use DateTime;
use LogicException;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
+
use function get_class;
use function gettype;
use function is_object;
diff --git a/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php b/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
index 34a0bc9e8..d3763a905 100644
--- a/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
+++ b/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
@@ -25,6 +25,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\User\UserInterface;
use Twig\Environment;
use UnexpectedValueException;
+
use function array_key_exists;
use function count;
diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php
index 12d870c7f..d226dc1b2 100644
--- a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php
+++ b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php
@@ -13,6 +13,7 @@ namespace Chill\Migrations\Person;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
+
use function count;
/**
diff --git a/src/Bundle/ChillReportBundle/Controller/ReportController.php b/src/Bundle/ChillReportBundle/Controller/ReportController.php
index dfe9064e1..bca915090 100644
--- a/src/Bundle/ChillReportBundle/Controller/ReportController.php
+++ b/src/Bundle/ChillReportBundle/Controller/ReportController.php
@@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Role\Role;
+
use function count;
/**
diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php
index 0b3652ff7..75a35030a 100644
--- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php
+++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php
@@ -15,6 +15,7 @@ use Chill\CustomFieldsBundle\Entity\CustomField;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function count;
/**
diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php
index 006f18afe..9c8a9798c 100644
--- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php
+++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php
@@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\RoleScope;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
index 504cb2709..b8de60cf4 100644
--- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
+++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
@@ -21,6 +21,7 @@ use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory as FakerFactory;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+
use function count;
use function in_array;
diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php
index 85bb35774..1d21fb26f 100644
--- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php
+++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php
@@ -37,6 +37,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
+
use function array_key_exists;
use function array_keys;
use function array_merge;
@@ -331,7 +332,9 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
- $centers = array_map(static function ($el) { return $el['center']; }, $acl);
+ $centers = array_map(static function ($el) {
+ return $el['center'];
+ }, $acl);
// throw an error if any fields are present
if (!array_key_exists('fields', $data)) {
diff --git a/src/Bundle/ChillReportBundle/Search/ReportSearch.php b/src/Bundle/ChillReportBundle/Search/ReportSearch.php
index 47014cfef..4ec06ba7d 100644
--- a/src/Bundle/ChillReportBundle/Search/ReportSearch.php
+++ b/src/Bundle/ChillReportBundle/Search/ReportSearch.php
@@ -21,6 +21,7 @@ use RuntimeException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
+
use function array_key_exists;
/**
@@ -96,7 +97,9 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface
foreach ($reachableCenters as $center) {
$reachableScopesId = array_map(
- static function (Scope $scope) { return $scope->getId(); },
+ static function (Scope $scope) {
+ return $scope->getId();
+ },
$this->helper->getReachableScopes($this->user, $role, $center)
);
$whereElement->add(
diff --git a/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php b/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
index ed4dde1b7..be24a37f7 100644
--- a/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
+++ b/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
@@ -12,13 +12,13 @@ declare(strict_types=1);
namespace Chill\ReportBundle\Security\Authorization;
use Chill\MainBundle\Entity\Center;
-
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\ReportBundle\Entity\Report;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+
use function in_array;
class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
diff --git a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
index 97bca3bd4..afff2c049 100644
--- a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
+++ b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
@@ -21,6 +21,7 @@ use Doctrine\ORM\EntityManager;
use LogicException;
use Symfony\Component\Security\Core\Security;
use UnexpectedValueException;
+
use function array_fill;
use function array_key_exists;
use function array_merge;
@@ -121,28 +122,34 @@ class TimelineReportProvider implements TimelineProviderInterface
$subtitle = null;
foreach ($entity->getCFGroup()->getCustomFields() as $customField) {
- if (in_array(
- $customField->getSlug(),
- $entity->getCFGroup()->getOptions()['summary_fields'],
- true
- )) {
+ if (
+ in_array(
+ $customField->getSlug(),
+ $entity->getCFGroup()->getOptions()['summary_fields'],
+ true
+ )
+ ) {
// if we do not want to show empty values
if (false === $this->showEmptyValues) {
if ($customField->getType() === 'title') {
$options = $customField->getOptions();
switch ($options['type']) {
- case 'title': $title = $customField;
+ case 'title':
+ $title = $customField;
-break;
+ break;
- case 'subtitle': $subtitle = $customField;
+ case 'subtitle':
+ $subtitle = $customField;
-break;
+ break;
}
} else {
- if ($this->customFieldsHelper->isEmptyValue($entity->getCFData(), $customField)
- === false) {
+ if (
+ $this->customFieldsHelper->isEmptyValue($entity->getCFData(), $customField)
+ === false
+ ) {
if (null !== $title) {
$gatheredFields[] = $title;
$title = null;
diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
index bc4fe9d04..490d50da1 100644
--- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
+++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
@@ -37,6 +37,7 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_map;
use function array_merge;
diff --git a/src/Bundle/ChillTaskBundle/Controller/TaskController.php b/src/Bundle/ChillTaskBundle/Controller/TaskController.php
index 761bc5fa4..82fe507a2 100644
--- a/src/Bundle/ChillTaskBundle/Controller/TaskController.php
+++ b/src/Bundle/ChillTaskBundle/Controller/TaskController.php
@@ -25,6 +25,7 @@ use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\Transition;
+
use function array_filter;
use function array_values;
@@ -96,7 +97,8 @@ class TaskController extends AbstractController
static function (Transition $t) use ($transition) {
return $t->getName() === $transition;
}
- ))[0];
+ )
+ )[0];
$form = $this->createTransitionForm($task);
diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php
index 6bd251a60..8d10926cd 100644
--- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php
+++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php
@@ -18,6 +18,7 @@ use Chill\TaskBundle\Security\Authorization\TaskVoter;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php
index 6513b71b6..8b44ebf8f 100644
--- a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php
+++ b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php
@@ -19,6 +19,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
+
use function array_fill_keys;
use function array_keys;
diff --git a/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php b/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php
index 9d74e9180..fa497c8cb 100644
--- a/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php
+++ b/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php
@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\TaskBundle\Entity;
use DateTime;
-
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
index c9bb3ab09..b762a6b88 100644
--- a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
+++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
@@ -29,6 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
+
use function array_combine;
use function array_map;
use function count;
@@ -217,9 +218,13 @@ class SingleTaskListType extends AbstractType
$users = $this->getUsersAssigneedToTask($options);
$choices = array_combine(
// get usernames
- array_map(static function (User $user) { return $user->getUsername(); }, $users),
+ array_map(static function (User $user) {
+ return $user->getUsername();
+ }, $users),
// get ids
- array_map(static function (User $user) { return $user->getId(); }, $users)
+ array_map(static function (User $user) {
+ return $user->getId();
+ }, $users)
);
$choices['Unassigned'] = '_unassigned';
diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php
index 3880a0a48..d2dd7fc18 100644
--- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php
+++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php
@@ -23,6 +23,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Security\Core\Security;
+
use function count;
use function substr;
@@ -68,69 +69,69 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository
foreach ($flags as $key => $flag) {
switch ($flag) {
- case 'no-alert':
- $orXDate
- ->add(
- $qb->expr()->orX(
- $qb->expr()->isNull('t.endDate'),
- $qb->expr()->gte('t.endDate - COALESCE(t.warningInterval, :intervalBlank)', ':now')
- )
- );
- $qb
- ->setParameter('intervalBlank', new DateInterval('P0D'))
- ->setParameter('now', $now);
+ case 'no-alert':
+ $orXDate
+ ->add(
+ $qb->expr()->orX(
+ $qb->expr()->isNull('t.endDate'),
+ $qb->expr()->gte('t.endDate - COALESCE(t.warningInterval, :intervalBlank)', ':now')
+ )
+ );
+ $qb
+ ->setParameter('intervalBlank', new DateInterval('P0D'))
+ ->setParameter('now', $now);
- break;
+ break;
- case 'warning':
- $orXDate
- ->add(
- $qb->expr()->andX(
- $qb->expr()->not($qb->expr()->isNull('t.endDate')),
- $qb->expr()->not($qb->expr()->isNull('t.warningInterval')),
- $qb->expr()->lte('t.endDate - t.warningInterval', ':now'),
- $qb->expr()->gt('t.endDate', ':now')
- )
- );
- $qb
- ->setParameter('now', $now);
+ case 'warning':
+ $orXDate
+ ->add(
+ $qb->expr()->andX(
+ $qb->expr()->not($qb->expr()->isNull('t.endDate')),
+ $qb->expr()->not($qb->expr()->isNull('t.warningInterval')),
+ $qb->expr()->lte('t.endDate - t.warningInterval', ':now'),
+ $qb->expr()->gt('t.endDate', ':now')
+ )
+ );
+ $qb
+ ->setParameter('now', $now);
- break;
+ break;
- case 'alert':
- $orXDate
- ->add(
- $qb->expr()->andX(
- $qb->expr()->not($qb->expr()->isNull('t.endDate')),
- $qb->expr()->lte('t.endDate', ':now')
- )
- );
- $qb
- ->setParameter('now', $now);
+ case 'alert':
+ $orXDate
+ ->add(
+ $qb->expr()->andX(
+ $qb->expr()->not($qb->expr()->isNull('t.endDate')),
+ $qb->expr()->lte('t.endDate', ':now')
+ )
+ );
+ $qb
+ ->setParameter('now', $now);
- break;
+ break;
- case 'state_new':
- $orXState
- ->add(
- 'JSONB_ARRAY_LENGTH(t.currentStates) = 0'
- );
+ case 'state_new':
+ $orXState
+ ->add(
+ 'JSONB_ARRAY_LENGTH(t.currentStates) = 0'
+ );
- break;
+ break;
- case substr($flag, 0, 6) === 'state_':
- $state = substr($flag, 6);
- $orXState
- ->add(
- "JSONB_EXISTS_IN_ARRAY(t.currentStates, :state_{$key}) = 'TRUE'"
- );
- $qb->setParameter("state_{$key}", $state);
+ case substr($flag, 0, 6) === 'state_':
+ $state = substr($flag, 6);
+ $orXState
+ ->add(
+ "JSONB_EXISTS_IN_ARRAY(t.currentStates, :state_{$key}) = 'TRUE'"
+ );
+ $qb->setParameter("state_{$key}", $state);
- break;
+ break;
- default:
- throw new LogicException("this flag is not supported: {$flag}");
- }
+ default:
+ throw new LogicException("this flag is not supported: {$flag}");
+ }
}
if ($orXDate->count() > 0) {
diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
index 563f269cf..b4c5b6833 100644
--- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
+++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
@@ -22,6 +22,7 @@ use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Security\Core\Role\Role;
use UnexpectedValueException;
+
use function array_key_exists;
use function count;
diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php
index c1df4e743..06953a107 100644
--- a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php
+++ b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php
@@ -25,6 +25,7 @@ use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
+
use function in_array;
final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
diff --git a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php
index 2990d8810..2ba4bef2f 100644
--- a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php
+++ b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php
@@ -17,6 +17,7 @@ use Chill\TaskBundle\Repository\SingleTaskRepository;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Workflow\Event\Event;
+
use function array_merge;
class CountNotificationTask implements NotificationCounterInterface
@@ -69,10 +70,12 @@ class CountNotificationTask implements NotificationCounterInterface
$task = $e->getSubject();
if (null !== $task->getAssignee()) {
- foreach ([
- SingleTaskRepository::DATE_STATUS_ENDED,
- SingleTaskRepository::DATE_STATUS_WARNING,
- ] as $status) {
+ foreach (
+ [
+ SingleTaskRepository::DATE_STATUS_ENDED,
+ SingleTaskRepository::DATE_STATUS_WARNING,
+ ] as $status
+ ) {
$key = $this->getCacheKey($task->getAssignee(), $status);
$sumCache = $this->cachePool->getItem($key);
diff --git a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php
index 09cce9e61..8ea0c2010 100644
--- a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php
+++ b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php
@@ -19,6 +19,7 @@ use Doctrine\ORM\EntityManagerInterface;
use LogicException;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\Workflow;
+
use function array_combine;
use function array_map;
@@ -85,7 +86,9 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn
->findBy(['id' => $ids]);
return array_combine(
- array_map(static function ($e) { return $e->getId(); }, $events),
+ array_map(static function ($e) {
+ return $e->getId();
+ }, $events),
$events
);
}
diff --git a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
index 16e2e945d..8cf302303 100644
--- a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
+++ b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
@@ -24,6 +24,7 @@ use Symfony\Component\Security\Core\Security;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\Workflow;
use UnexpectedValueException;
+
use function array_combine;
use function array_fill;
use function array_map;
@@ -96,7 +97,9 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
->findBy(['id' => $ids]);
return array_combine(
- array_map(static function ($e) { return $e->getId(); }, $events),
+ array_map(static function ($e) {
+ return $e->getId();
+ }, $events),
$events
);
}
@@ -189,10 +192,12 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
$clauses = [];
// loop over centers
- foreach ($this->authorizationHelper->getReachableCenters(
- $this->security->getUser(),
- new Role(ActivityVoter::SEE_DETAILS)
- ) as $center) {
+ foreach (
+ $this->authorizationHelper->getReachableCenters(
+ $this->security->getUser(),
+ new Role(ActivityVoter::SEE_DETAILS)
+ ) as $center
+ ) {
if (false === in_array($center, $centers, true)) {
continue;
}
diff --git a/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php b/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php
index 6f0577ce2..62073175c 100644
--- a/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php
+++ b/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php
@@ -15,6 +15,7 @@ use Chill\TaskBundle\Entity\AbstractTask;
use Chill\TaskBundle\Entity\SingleTask;
use LogicException;
use Symfony\Component\Workflow\Transition;
+
use function array_key_exists;
use function array_slice;
use function explode;
diff --git a/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php b/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php
index ca182afb8..a1f954c85 100644
--- a/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php
+++ b/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php
@@ -30,10 +30,12 @@ class DefaultTaskGuardEvent implements EventSubscriberInterface
public function checkACL(GuardEvent $event)
{
- if (false === $this->authorizationChecker->isGranted(
- TaskVoter::UPDATE,
- $event->getSubject()
- )) {
+ if (
+ false === $this->authorizationChecker->isGranted(
+ TaskVoter::UPDATE,
+ $event->getSubject()
+ )
+ ) {
$event->setBlocked(true);
}
}
diff --git a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php
index 2bec260d4..748e5bca6 100644
--- a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php
+++ b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php
@@ -16,6 +16,7 @@ use LogicException;
use Symfony\Component\Workflow\Event\Event;
use Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface;
use Symfony\Component\Workflow\WorkflowInterface;
+
use function count;
use function sprintf;
diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php
index 5a1923328..6da33bd52 100644
--- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php
+++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php
@@ -26,6 +26,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_merge;
final class ThirdPartyController extends CRUDController
diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php
index 9f163c815..a1015686f 100644
--- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php
+++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php
@@ -23,6 +23,7 @@ use Doctrine\Persistence\ObjectManager;
use Iterator;
use Nelmio\Alice\Loader\NativeLoader;
use Nelmio\Alice\ObjectSet;
+
use function array_map;
use function count;
@@ -76,7 +77,9 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
private function getCenters(): Iterator
{
$references = array_map(
- static function ($a) { return $a['ref']; },
+ static function ($a) {
+ return $a['ref'];
+ },
LoadCenters::$centers
);
$number = random_int(1, count($references));
diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php
index 086492e88..df7f29e54 100644
--- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php
+++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php
@@ -16,6 +16,7 @@ use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
+
use function in_array;
/**
diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
index c8167c89b..b0b7d3a98 100644
--- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
+++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
@@ -28,6 +28,7 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use UnexpectedValueException;
+
use function array_filter;
use function array_map;
use function array_merge;
diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php b/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
index fb19771fd..92e70c79e 100644
--- a/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
+++ b/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
@@ -17,6 +17,7 @@ use RuntimeException;
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
+
use function call_user_func;
use function in_array;
diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php
index 4146e98a3..b4ab8655d 100644
--- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php
+++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php
@@ -36,6 +36,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+
use function array_key_exists;
class ThirdPartyType extends AbstractType
diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php
index c7d8d94c0..f3e53cacf 100644
--- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php
+++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php
@@ -23,6 +23,7 @@ use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Translation\TranslatorInterface;
+
use function array_diff;
use function array_merge;
use function count;
diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php
index 25980f673..1965fff9c 100644
--- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php
+++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;
+
use function array_merge;
use function implode;
use function is_array;
diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
index ef9af3940..affb9db40 100644
--- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
+++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
@@ -18,6 +18,7 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ObjectRepository;
use DomainException;
+
use function array_key_exists;
final class ThirdPartyRepository implements ObjectRepository
diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
index 85f798424..994b9d65c 100644
--- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
+++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
@@ -14,6 +14,7 @@ namespace Chill\ThirdPartyBundle\Search;
use Chill\MainBundle\Search\SearchApiInterface;
use Chill\MainBundle\Search\SearchApiQuery;
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
+
use function array_merge;
use function explode;
use function implode;
diff --git a/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php b/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
index 93cdaff3a..0622a12cc 100644
--- a/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
+++ b/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
@@ -18,6 +18,7 @@ use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Role\Role;
+
use function array_intersect;
use function count;
use function in_array;
diff --git a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php
index 91592ffde..d95192f2a 100644
--- a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php
+++ b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php
@@ -30,8 +30,9 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
/**
* @param ThirdParty $thirdParty
+ * @param null|string $format
*/
- public function normalize($thirdParty, ?string $format = null, array $context = [])
+ public function normalize($thirdParty, $format = null, array $context = [])
{
return [
'type' => 'thirdparty',
@@ -49,7 +50,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
];
}
- public function supportsNormalization($data, ?string $format = null)
+ public function supportsNormalization($data, $format = null)
{
return $data instanceof ThirdParty && 'json' === $format;
}
diff --git a/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php b/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php
index 37a9e2fa6..da6fc0d0d 100644
--- a/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php
+++ b/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php
@@ -11,12 +11,14 @@ declare(strict_types=1);
namespace Chill\WopiBundle\DependencyInjection;
+use Ramsey\Uuid\Doctrine\UuidType;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
-final class ChillWopiExtension extends Extension
+final class ChillWopiExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
{
@@ -31,4 +33,17 @@ final class ChillWopiExtension extends Extension
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.php');
}
+
+ public function prepend(ContainerBuilder $container) {
+ $container->prependExtensionConfig(
+ 'doctrine',
+ [
+ 'dbal' => [
+ 'types' => [
+ 'uuid' => UuidType::class,
+ ],
+ ],
+ ]
+ );
+ }
}
diff --git a/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php b/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php
index 876509469..a2fd907e5 100644
--- a/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php
+++ b/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php
@@ -35,11 +35,12 @@ interface ResponderInterface
/**
* Returns a JsonResponse that uses the serializer component if enabled, or json_encode.
*
+ * @param mixed $data
* @param array|string> $headers
* @param array $context
*/
public function json(
- mixed $data,
+ $data,
int $status = 200,
array $headers = [],
array $context = []
diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php
index 4f6727598..19ff3c62e 100644
--- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php
+++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php
@@ -30,6 +30,7 @@ use Symfony\Component\Mime\MimeTypes;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Throwable;
+
use function strlen;
final class ChillDocumentManager implements DocumentManagerInterface