Merge remote-tracking branch 'origin/master' into features/docgen-widget-generate-template

This commit is contained in:
Julien Fastré 2021-11-30 16:38:36 +01:00
commit cf442461d6
1055 changed files with 5050 additions and 2165 deletions

View File

@ -21,52 +21,52 @@ $config
$rules = $config->getRules(); $rules = $config->getRules();
$riskyRules = [ $riskyRules = [
'final_internal_class' => false,
'no_useless_sprintf' => false,
'dir_constant' => false,
'no_alias_functions' => false,
'implode_call' => false,
'combine_nested_dirname' => false,
'pow_to_exponentiation' => false,
'comment_to_phpdoc' => false,
'no_unset_on_property' => false,
'strict_param' => false,
'native_constant_invocation' => false,
'php_unit_test_annotation' => false,
'php_unit_no_expectation_annotation' => false,
'declare_strict_types' => false,
'function_to_constant' => false,
'is_null' => false,
'native_function_invocation' => false,
'ternary_to_elvis_operator' => false, 'ternary_to_elvis_operator' => false,
'no_trailing_whitespace_in_string' => false,
'no_unreachable_default_argument_value' => false,
'php_unit_test_case_static_method_calls' => false,
'strict_comparison' => false,
'array_push' => false,
'ereg_to_preg' => false,
'error_suppression' => false,
'fopen_flag_order' => false,
'fopen_flags' => false,
'logical_operators' => false,
'modernize_types_casting' => false,
'no_homoglyph_names' => false,
'no_unneeded_final_method' => false,
'non_printable_character' => false,
'ordered_traits' => false,
'php_unit_mock_short_will_return' => false, 'php_unit_mock_short_will_return' => false,
'php_unit_set_up_tear_down_visibility' => false, 'php_unit_set_up_tear_down_visibility' => false,
'set_type_to_cast' => false, 'php_unit_construct' => false,
'string_line_ending' => false, 'php_unit_dedicate_assert' => false,
'ordered_interfaces' => false,
'php_unit_expectation' => false, 'php_unit_expectation' => false,
'php_unit_mock' => false, 'php_unit_mock' => false,
'php_unit_namespaced' => false, 'php_unit_namespaced' => false,
'random_api_migration' => false, 'php_unit_no_expectation_annotation' => false,
'static_lambda' => false, 'php_unit_test_case_static_method_calls' => false,
'php_unit_construct' => false, 'php_unit_test_annotation' => false,
'psr_autoloading' => false, // 'final_internal_class' => false,
'php_unit_dedicate_assert' => false, // 'strict_param' => false,
// 'declare_strict_types' => false,
// 'strict_comparison' => false,
// 'no_unreachable_default_argument_value' => false,
// 'ereg_to_preg' => false,
// 'ordered_interfaces' => false,
// 'error_suppression' => false,
// 'non_printable_character' => false,
// 'ordered_traits' => false,
// 'no_useless_sprintf' => false,
// 'dir_constant' => false,
// 'no_alias_functions' => false,
// 'implode_call' => false,
// 'combine_nested_dirname' => false,
// 'pow_to_exponentiation' => false,
// 'comment_to_phpdoc' => false,
// 'no_unset_on_property' => false,
// 'native_constant_invocation' => false,
// 'function_to_constant' => false,
// 'is_null' => false,
// 'native_function_invocation' => false,
// 'no_trailing_whitespace_in_string' => false,
// 'array_push' => false,
// 'fopen_flag_order' => false,
// 'fopen_flags' => false,
// 'logical_operators' => false,
// 'modernize_types_casting' => false,
// 'no_homoglyph_names' => false,
// 'no_unneeded_final_method' => false,
// 'random_api_migration' => false,
// 'static_lambda' => false,
// 'set_type_to_cast' => false,
// 'string_line_ending' => false,
// 'psr_autoloading' => false,
]; ];
$rules = array_merge( $rules = array_merge(

View File

@ -11,18 +11,44 @@ and this project adheres to
## Unreleased ## Unreleased
<!-- write down unreleased development here --> <!-- write down unreleased development here -->
* [person search] fix bug when using birthdate after and birthdate before
* [person search] increase pertinence when lastname begins with search pattern
## Test releases
### Test release 2021-11-19 - bis
* [household] do not allow to create two addresses on the same date
* [activity] handle case when there is no social action associated to social issue
* [activity] layout for issues / actions
* [activity][bugfix] in edit mode, the form will now load the social action list
### Test release 2021-11-29
* [person] suggest entities (person | thirdparty) when creating/editing the accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/119)
* [activity] add custom validation on the Activity class, based on what is required from the ActivityType (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/188)
* [main] translate multiselect messages when selecting/creating address * [main] translate multiselect messages when selecting/creating address
* [main] set the coordinates of the city when creating a new address OR choosing "pas d'adresse complète" * [main] set the coordinates of the city when creating a new address OR choosing "pas d'adresse complète"
* Use the user.label in accompanying course banner, instead of username; * Use the user.label in accompanying course banner, instead of username;
* fix: show validation message when closing accompanying course; * fix: show validation message when closing accompanying course;
* [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228) * [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228)
* [assets] new asset to style suggestions lists (with add/remove item link) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/258)
* [accompanyingCourseWorkEdit] improves hyphenation and line breaks for long badges
* [acompanyingCourse] improve Resume page
* complete all needed informations,
* actions and activities are clickables,
* better placement with js masonry blocks on top of content area,
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/101
* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/295
* [activity/calendar] on show page, concerned groups of persons table adapt itself to isVisibles options
* [activity] remove the "plus" button in activity list * [activity] remove the "plus" button in activity list
* [activity] check ACL on activity list in person context * [activity] check ACL on activity list in person context
* [list for accompanying course in person] filter list using ACL * [list for accompanying course in person] filter list using ACL
* [validation] toasts are displayed for errors when modifying accompanying course (generalization required). * [validation] toasts are displayed for errors when modifying accompanying course (generalization required).
* [period] only the user can enable confidentiality
* add an endpoint for checking permissions. See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232 * add an endpoint for checking permissions. See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232
* [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
## Test releases * [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
### Test release 2021-11-22 ### Test release 2021-11-22
@ -52,7 +78,7 @@ and this project adheres to
* [accompanyingCourse] Ability to close accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/296) * [accompanyingCourse] Ability to close accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/296)
* [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167) * [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167)
* [list result] show all courses, except ones with period closed * [list result] show all courses, except ones with period closed
* [accompanyingCourse] improve banner with small carousel to display slide social-issues or slide associated persons (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/69)
### Test release 2021-11-15 ### Test release 2021-11-15

View File

@ -98,7 +98,7 @@ Finalement, il importe ici de définir ce qu'est un bloc, ce qu'est une zone d'a
Par exemple pour mettre un style au titre on précise juste h3 dans la cascade bloc. Par exemple pour mettre un style au titre on précise juste h3 dans la cascade bloc.
```sass ```scss
div.bloc { div.bloc {
// un bloc générique, utilisé à plusieurs endroits // un bloc générique, utilisé à plusieurs endroits
&.bloc-dark { &.bloc-dark {
@ -381,3 +381,31 @@ A chaque fois qu'un lien est indiqué, vérifier si on ne doit pas utiliser la f
* utiliser `chill_return_path_or` dans le bouton "Cancel"; * utiliser `chill_return_path_or` dans le bouton "Cancel";
* pour les boutons "enregistrer et voir" et "Enregistrer et fermer" => ? * pour les boutons "enregistrer et voir" et "Enregistrer et fermer" => ?
### Assets pour les listes de suggestion
Créer une liste de suggestions à ajouter (tout l'item est cliquable)
```html
<ul class="list-suggest add-items">
<li>
<span>item</span>
</li>
</ul>
```
Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'ancre a est vide)
```html
<ul class="list-suggest remove-items">
<li>
<span>
item
<a></a>
</span>
</li>
</ul>
```
Créer un titre enlevable (avec une croix rouge cliquable, l'ancre a est vide)
```html
<div class="item-title">
title
<a></a>
</div>
```

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\PersonBundle\Export\Filter; namespace Chill\PersonBundle\Export\Filter;
use Chill\MainBundle\Export\ExportElementValidatedInterface; use Chill\MainBundle\Export\ExportElementValidatedInterface;
@ -16,7 +18,7 @@ use Doctrine\ORM\Query\Expr;
use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
class BirthdateFilter implements FilterInterface, ExportElementValidatedInterface class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
{ {
// add specific role for this filter // add specific role for this filter
public function addRole() public function addRole()

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\PersonBundle\Export\Export; namespace Chill\PersonBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface; use Chill\MainBundle\Export\ExportInterface;
@ -89,7 +91,7 @@ class CountPerson implements ExportInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
// we gather all center the user choose. // we gather all center the user choose.
$centers = array_map(function ($el) { return $el['center']; }, $acl); $centers = array_map(static function ($el) { return $el['center']; }, $acl);
$qb = $this->entityManager->createQueryBuilder(); $qb = $this->entityManager->createQueryBuilder();

View File

@ -7,11 +7,13 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\MyBundle\Controller; namespace Chill\MyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ItemController extends Controller class example extends Controller
{ {
public function yourAction() public function yourAction()
{ {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\HealthBundle\Controller; namespace Chill\HealthBundle\Controller;
use Chill\HealthBundle\Security\Authorization\ConsultationVoter; use Chill\HealthBundle\Security\Authorization\ConsultationVoter;
@ -25,7 +27,7 @@ class ConsultationController extends Controller
*/ */
public function listAction($id) public function listAction($id)
{ {
/* @var $person \Chill\PersonBundle\Entity\Person */ /** @var \Chill\PersonBundle\Entity\Person $person */
$person = $this->get('chill.person.repository.person') $person = $this->get('chill.person.repository.person')
->find($id); ->find($id);
@ -35,7 +37,7 @@ class ConsultationController extends Controller
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person); $this->denyAccessUnlessGranted(PersonVoter::SEE, $person);
/* @var $authorizationHelper \Chill\MainBundle\Security\Authorization\AuthorizationHelper */ /** @var \Chill\MainBundle\Security\Authorization\AuthorizationHelper $authorizationHelper */
$authorizationHelper = $this->get('chill.main.security.' $authorizationHelper = $this->get('chill.main.security.'
. 'authorization.helper'); . 'authorization.helper');

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection; namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait; use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
@ -17,7 +19,7 @@ namespace Chill\MainBundle\DependencyInjection;
/** /**
* Configure the main bundle. * Configure the main bundle.
*/ */
class Configuration implements ConfigurationInterface class ChillMainConfiguration implements ConfigurationInterface
{ {
use AddWidgetConfigurationTrait; use AddWidgetConfigurationTrait;
@ -27,7 +29,7 @@ namespace Chill\MainBundle\DependencyInjection;
private $containerBuilder; private $containerBuilder;
public function __construct( public function __construct(
array $widgetFactories = [], array $widgetFactories,
ContainerBuilder $containerBuilder ContainerBuilder $containerBuilder
) { ) {
// we register here widget factories (see below) // we register here widget factories (see below)

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection; namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface; use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\PersonBundle\Widget; namespace Chill\PersonBundle\Widget;
use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory; use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory;
@ -16,7 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
/** /**
* add configuration for the person_list widget. * add configuration for the person_list widget.
*/ */
class PersonListWidgetFactory extends AbstractWidgetFactory class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
{ {
/* /*
* append the option to the configuration * append the option to the configuration
@ -36,8 +38,8 @@ class PersonListWidgetFactory extends AbstractWidgetFactory
->end(); ->end();
} }
/* /**
* return an array with the allowed places where the widget can be rendered * return an array with the allowed places where the widget can be rendered.
* *
* @return string[] * @return string[]
*/ */
@ -59,8 +61,8 @@ class PersonListWidgetFactory extends AbstractWidgetFactory
return 'chill_person.widget.person_list'; return 'chill_person.widget.person_list';
} }
/* /**
* return the widget alias * return the widget alias.
* *
* @return string * @return string
*/ */

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\PersonBundle\Widget; namespace Chill\PersonBundle\Widget;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
@ -27,7 +29,7 @@ use Twig_Environment;
* *
* The configuration is defined by `PersonListWidgetFactory` * The configuration is defined by `PersonListWidgetFactory`
*/ */
class PersonListWidget implements WidgetInterface class ChillPersonAddAPersonWidget implements WidgetInterface
{ {
/** /**
* the authorization helper. * the authorization helper.

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\PersonBundle\DependencyInjection; namespace Chill\PersonBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;

View File

@ -9,6 +9,6 @@ parameters:
tasks.license.holder: Champs-Libres tasks.license.holder: Champs-Libres
tasks.license.date_from: 2001 tasks.license.date_from: 2001
tasks.phpcsfixer.allow_risky: false tasks.phpcsfixer.allow_risky: true
tasks.phpcsfixer.diff: true tasks.phpcsfixer.diff: true
tasks.phpstan.level: 1 tasks.phpstan.level: 1

View File

@ -70,11 +70,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
-
message: "#^Undefined variable\\: \\$value$#"
count: 1
path: src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php
- -
message: "#^Undefined variable\\: \\$choiceSlug$#" message: "#^Undefined variable\\: \\$choiceSlug$#"
count: 1 count: 1

View File

@ -1,15 +1,5 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
message: "#^Call to deprecated method getType\\(\\) of class Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\.$#"
count: 3
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
-
message: "#^Call to deprecated method setType\\(\\) of class Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
- -
message: message:
""" """

View File

@ -1,15 +1,5 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/Activity.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -20,11 +10,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
- -
message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getDescription\\(\\) should return string but return statement is missing\\.$#" message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getDescription\\(\\) should return string but return statement is missing\\.$#"
count: 1 count: 1
@ -35,11 +20,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -55,36 +35,6 @@ parameters:
count: 2 count: 2
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php
- -
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 3 count: 3
@ -95,36 +45,16 @@ parameters:
count: 2 count: 2
path: src/Bundle/ChillBudgetBundle/Form/ResourceType.php path: src/Bundle/ChillBudgetBundle/Form/ResourceType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/Entity/Calendar.php
- -
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1 count: 1
path: src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php path: src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php path: src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 4 count: 4
@ -190,21 +120,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php path: src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Entity/Participation.php
- -
message: "#^Method Chill\\\\EventBundle\\\\Entity\\\\Participation\\:\\:offsetGet\\(\\) should return mixed but return statement is missing\\.$#" message: "#^Method Chill\\\\EventBundle\\\\Entity\\\\Participation\\:\\:offsetGet\\(\\) should return mixed but return statement is missing\\.$#"
count: 1 count: 1
path: src/Bundle/ChillEventBundle/Entity/Participation.php path: src/Bundle/ChillEventBundle/Entity/Participation.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -225,11 +145,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillEventBundle/Form/StatusType.php path: src/Bundle/ChillEventBundle/Form/StatusType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
@ -240,16 +155,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillEventBundle/Search/EventSearch.php path: src/Bundle/ChillEventBundle/Search/EventSearch.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php
- -
message: "#^Casting to string something that's already string\\.$#" message: "#^Casting to string something that's already string\\.$#"
count: 5 count: 5
@ -260,11 +165,6 @@ parameters:
count: 2 count: 2
path: src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php path: src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -285,16 +185,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php path: src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
- -
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\ChillImportUsersCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#" message: "#^Method Chill\\\\MainBundle\\\\Command\\\\ChillImportUsersCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1 count: 1
@ -305,11 +195,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -320,11 +205,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
- -
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadAndUpdateLanguagesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#" message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadAndUpdateLanguagesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1 count: 1
@ -360,36 +240,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Controller/PostalCodeController.php path: src/Bundle/ChillMainBundle/Controller/PostalCodeController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 5
path: src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -405,21 +255,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/User.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Entity/User.php path: src/Bundle/ChillMainBundle/Entity/User.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 6
path: src/Bundle/ChillMainBundle/Export/ExportManager.php
- -
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1 count: 1
@ -450,11 +290,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php path: src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3 count: 3
@ -465,51 +300,16 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
path: src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php path: src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Security/ParentRoleHelper.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -530,21 +330,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php path: src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -570,51 +360,16 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 6 count: 6
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/Person.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
path: src/Bundle/ChillPersonBundle/Entity/PersonPhone.php path: src/Bundle/ChillPersonBundle/Entity/PersonPhone.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Export/AbstractAccompanyingPeriodExportElement.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -625,26 +380,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -665,26 +405,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Household/MembersEditor.php
- -
message: "#^Method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:buildQueryBySocialActionWithDescendants\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\QueryBuilder\\.$#" message: "#^Method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:buildQueryBySocialActionWithDescendants\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\QueryBuilder\\.$#"
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3 count: 3
@ -695,71 +420,26 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
- -
message: "#^Method Chill\\\\ReportBundle\\\\DataFixtures\\\\ORM\\\\LoadReports\\:\\:getRandomChoice\\(\\) should return array\\<string\\>\\|string but return statement is missing\\.$#" message: "#^Method Chill\\\\ReportBundle\\\\DataFixtures\\\\ORM\\\\LoadReports\\:\\:getRandomChoice\\(\\) should return array\\<string\\>\\|string but return statement is missing\\.$#"
count: 1 count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
- -
message: "#^Method Chill\\\\ReportBundle\\\\Security\\\\Authorization\\\\ReportVoter\\:\\:supports\\(\\) should return bool but return statement is missing\\.$#" message: "#^Method Chill\\\\ReportBundle\\\\Security\\\\Authorization\\\\ReportVoter\\:\\:supports\\(\\) should return bool but return statement is missing\\.$#"
count: 1 count: 1
path: src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php path: src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php
- -
message: "#^Casting to string something that's already string\\.$#" message: "#^Casting to string something that's already string\\.$#"
count: 3 count: 3
@ -785,31 +465,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php path: src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
- -
message: "#^Method Chill\\\\TaskBundle\\\\Timeline\\\\TaskLifeCycleEventTimelineProvider\\:\\:getTransitionByName\\(\\) should return Symfony\\\\Component\\\\Workflow\\\\Transition but return statement is missing\\.$#" message: "#^Method Chill\\\\TaskBundle\\\\Timeline\\\\TaskLifeCycleEventTimelineProvider\\:\\:getTransitionByName\\(\\) should return Symfony\\\\Component\\\\Workflow\\\\Transition but return statement is missing\\.$#"
count: 1 count: 1
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -820,11 +480,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php path: src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -835,11 +490,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle; namespace Chill\ActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;

View File

@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Serializer\SerializerInterface; use Symfony\Component\Serializer\SerializerInterface;
use function array_key_exists;
final class ActivityController extends AbstractController final class ActivityController extends AbstractController
{ {
@ -105,18 +106,19 @@ final class ActivityController extends AbstractController
[$person, $accompanyingPeriod] = $this->getEntity($request); [$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
}
$activity = $this->activityRepository->find($id); $activity = $this->activityRepository->find($id);
if (!$activity) { if (!$activity) {
throw $this->createNotFoundException('Unable to find Activity entity.'); throw $this->createNotFoundException('Unable to find Activity entity.');
} }
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
$accompanyingPeriod = $activity->getAccompanyingPeriod();
} else {
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
}
// TODO // TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity); // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
@ -137,7 +139,7 @@ final class ActivityController extends AbstractController
static fn (ActivityReason $ar): int => $ar->getId() static fn (ActivityReason $ar): int => $ar->getId()
) )
->toArray(), ->toArray(),
'type_id' => $activity->getType()->getId(), 'type_id' => $activity->getActivityType()->getId(),
'duration' => $activity->getDurationTime() ? $activity->getDurationTime()->format('U') : null, 'duration' => $activity->getDurationTime() ? $activity->getDurationTime()->format('U') : null,
'date' => $activity->getDate()->format('Y-m-d'), 'date' => $activity->getDate()->format('Y-m-d'),
'attendee' => $activity->getAttendee(), 'attendee' => $activity->getAttendee(),
@ -176,25 +178,25 @@ final class ActivityController extends AbstractController
[$person, $accompanyingPeriod] = $this->getEntity($request); [$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
}
$entity = $this->activityRepository->find($id); $entity = $this->activityRepository->find($id);
if (null === $entity) { if (null === $entity) {
throw $this->createNotFoundException('Unable to find Activity entity.'); throw $this->createNotFoundException('Unable to find Activity entity.');
} }
if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
$accompanyingPeriod = $entity->getAccompanyingPeriod();
} else {
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
}
// TODO // TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
$form = $this->createForm(ActivityType::class, $entity, [ $form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(), 'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_UPDATE'), 'role' => new Role('CHILL_ACTIVITY_UPDATE'),
'activityType' => $entity->getType(), 'activityType' => $entity->getActivityType(),
'accompanyingPeriod' => $accompanyingPeriod, 'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request); ])->handleRequest($request);
@ -327,7 +329,7 @@ final class ActivityController extends AbstractController
$entity->setAccompanyingPeriod($accompanyingPeriod); $entity->setAccompanyingPeriod($accompanyingPeriod);
} }
$entity->setType($activityType); $entity->setActivityType($activityType);
$entity->setDate(new DateTime('now')); $entity->setDate(new DateTime('now'));
if ($request->query->has('activityData')) { if ($request->query->has('activityData')) {
@ -385,7 +387,7 @@ final class ActivityController extends AbstractController
$form = $this->createForm(ActivityType::class, $entity, [ $form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(), 'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_CREATE'), 'role' => new Role('CHILL_ACTIVITY_CREATE'),
'activityType' => $entity->getType(), 'activityType' => $entity->getActivityType(),
'accompanyingPeriod' => $accompanyingPeriod, 'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request); ])->handleRequest($request);
@ -408,7 +410,7 @@ final class ActivityController extends AbstractController
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']); $activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
$defaultLocationId = $this->getUser()->getCurrentLocation()->getId(); $defaultLocation = $this->getUser()->getCurrentLocation();
return $this->render($view, [ return $this->render($view, [
'person' => $person, 'person' => $person,
@ -416,7 +418,7 @@ final class ActivityController extends AbstractController
'entity' => $entity, 'entity' => $entity,
'form' => $form->createView(), 'form' => $form->createView(),
'activity_json' => $activity_array, 'activity_json' => $activity_array,
'default_location_id' => $defaultLocationId, 'default_location' => $defaultLocation,
]); ]);
} }

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Entity\ActivityReasonCategory; use Chill\ActivityBundle\Entity\ActivityReasonCategory;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;
@ -23,6 +25,7 @@ class AdminActivityTypeController extends CRUDController
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{ {
/** @var \Doctrine\ORM\QueryBuilder $query */ /** @var \Doctrine\ORM\QueryBuilder $query */
return $query->orderBy('e.ordering', 'ASC'); return $query->orderBy('e.ordering', 'ASC')
->addOrderBy('e.id', 'ASC');
} }
} }

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
@ -48,7 +50,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
->findAll(); ->findAll();
foreach ($persons as $person) { foreach ($persons as $person) {
$activityNbr = rand(0, 3); $activityNbr = mt_rand(0, 3);
for ($i = 0; $i < $activityNbr; ++$i) { for ($i = 0; $i < $activityNbr; ++$i) {
$activity = $this->newRandomActivity($person); $activity = $this->newRandomActivity($person);
@ -73,7 +75,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
// ->setAttendee($this->faker->boolean()) // ->setAttendee($this->faker->boolean())
for ($i = 0; rand(0, 4) > $i; ++$i) { for ($i = 0; mt_rand(0, 4) > $i; ++$i) {
$reason = $this->getRandomActivityReason(); $reason = $this->getRandomActivityReason();
if (null !== $reason) { if (null !== $reason) {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityReasonCategory; use Chill\ActivityBundle\Entity\ActivityReasonCategory;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Entity\ActivityType;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Chill\ActivityBundle\Entity\ActivityTypeCategory;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
@ -17,6 +19,7 @@ use Chill\MainBundle\Entity\RoleScope;
use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManager;
use function in_array;
/** /**
* Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative, * Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative,
@ -47,7 +50,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
case 'administrative': case 'administrative':
case 'direction': case 'direction':
if (in_array($scope->getName()['en'], ['administrative', 'social'])) { if (in_array($scope->getName()['en'], ['administrative', 'social'], true)) {
break 2; // we do not want any power on social or administrative break 2; // we do not want any power on social or administrative
} }

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DependencyInjection; namespace Chill\ActivityBundle\DependencyInjection;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
@ -67,7 +69,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
]); ]);
} }
/* (non-PHPdoc) /** (non-PHPdoc).
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
*/ */
public function prependRoutes(ContainerBuilder $container) public function prependRoutes(ContainerBuilder $container)

View File

@ -7,10 +7,13 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\DependencyInjection; namespace Chill\ActivityBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\ConfigurationInterface;
use function is_int;
/** /**
* This is the class that validates and merges configuration from your app/config files. * This is the class that validates and merges configuration from your app/config files.
@ -55,7 +58,7 @@ class Configuration implements ConfigurationInterface
->info('The number of seconds of this duration. Must be an integer.') ->info('The number of seconds of this duration. Must be an integer.')
->cannotBeEmpty() ->cannotBeEmpty()
->validate() ->validate()
->ifTrue(function ($data) { ->ifTrue(static function ($data) {
return !is_int($data); return !is_int($data);
})->thenInvalid('The value %s is not a valid integer') })->thenInvalid('The value %s is not a valid integer')
->end() ->end()

View File

@ -7,8 +7,11 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Chill\ActivityBundle\Validator\Constraints as ActivityValidator;
use Chill\DocStoreBundle\Entity\Document; use Chill\DocStoreBundle\Entity\Document;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
@ -17,6 +20,7 @@ use Chill\MainBundle\Entity\HasScopeInterface;
use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface; use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
@ -41,17 +45,14 @@ use Symfony\Component\Serializer\Annotation\SerializedName;
* @DiscriminatorMap(typeProperty="type", mapping={ * @DiscriminatorMap(typeProperty="type", mapping={
* "activity": Activity::class * "activity": Activity::class
* }) * })
*/ * @ActivityValidator\ActivityValidity
*
/*
* TODO : revoir
* @UserCircleConsistency( * @UserCircleConsistency(
* "CHILL_ACTIVITY_SEE_DETAILS", * "CHILL_ACTIVITY_SEE_DETAILS",
* getUserFunction="getUser", * getUserFunction="getUser",
* path="scope") * path="scope")
*/ */
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCenterInterface, HasScopeInterface
class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
{ {
public const SENTRECEIVED_RECEIVED = 'received'; public const SENTRECEIVED_RECEIVED = 'received';
@ -202,7 +203,9 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
public function addPerson(?Person $person): self public function addPerson(?Person $person): self
{ {
if (null !== $person) { if (null !== $person) {
$this->persons[] = $person; if (!$this->persons->contains($person)) {
$this->persons[] = $person;
}
} }
return $this; return $this;
@ -236,7 +239,9 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
public function addThirdParty(?ThirdParty $thirdParty): self public function addThirdParty(?ThirdParty $thirdParty): self
{ {
if (null !== $thirdParty) { if (null !== $thirdParty) {
$this->thirdParties[] = $thirdParty; if (!$this->thirdParties->contains($thirdParty)) {
$this->thirdParties[] = $thirdParty;
}
} }
return $this; return $this;
@ -245,7 +250,9 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
public function addUser(?User $user): self public function addUser(?User $user): self
{ {
if (null !== $user) { if (null !== $user) {
$this->users[] = $user; if (!$this->users->contains($user)) {
$this->users[] = $user;
}
} }
return $this; return $this;
@ -346,8 +353,9 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
if (null !== $this->accompanyingPeriod) { if (null !== $this->accompanyingPeriod) {
$personsNotAssociated = []; $personsNotAssociated = [];
// TODO better semantic with: return $this->persons->filter(...);
foreach ($this->persons as $person) { foreach ($this->persons as $person) {
if (!in_array($person, $this->getPersonsAssociated())) { if ($this->accompanyingPeriod->getOpenParticipationContainsPerson($person) === null) {
$personsNotAssociated[] = $person; $personsNotAssociated[] = $person;
} }
} }

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;

View File

@ -7,11 +7,14 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use InvalidArgumentException; use InvalidArgumentException;
use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/** /**
* Class ActivityType. * Class ActivityType.
@ -29,11 +32,13 @@ class ActivityType
public const FIELD_REQUIRED = 2; public const FIELD_REQUIRED = 2;
/** /**
* @deprecated not in use
* @ORM\Column(type="string", nullable=false, options={"default": ""}) * @ORM\Column(type="string", nullable=false, options={"default": ""})
*/ */
private string $accompanyingPeriodLabel = ''; private string $accompanyingPeriodLabel = '';
/** /**
* @deprecated not in use
* @ORM\Column(type="smallint", nullable=false, options={"default": 1}) * @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/ */
private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE; private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE;
@ -195,16 +200,21 @@ class ActivityType
/** /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1}) * @ORM\Column(type="smallint", nullable=false, options={"default": 1})
* @Assert\EqualTo(propertyPath="socialIssuesVisible", message="This parameter must be equal to social issue parameter")
*/ */
private int $socialActionsVisible = self::FIELD_INVISIBLE; private int $socialActionsVisible = self::FIELD_INVISIBLE;
/** /**
* @ORM\Column(type="string", nullable=false, options={"default": ""}) * @ORM\Column(type="string", nullable=false, options={"default": ""})
*
* @deprecated not in use
*/ */
private string $socialDataLabel = ''; private string $socialDataLabel = '';
/** /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1}) * @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*
* @deprecated not in use
*/ */
private int $socialDataVisible = self::FIELD_INVISIBLE; private int $socialDataVisible = self::FIELD_INVISIBLE;
@ -260,16 +270,6 @@ class ActivityType
*/ */
private int $userVisible = self::FIELD_REQUIRED; private int $userVisible = self::FIELD_REQUIRED;
public function getAccompanyingPeriodLabel(): string
{
return $this->accompanyingPeriodLabel;
}
public function getAccompanyingPeriodVisible(): int
{
return $this->accompanyingPeriodVisible;
}
/** /**
* Get active * Get active
* return true if the type is active. * return true if the type is active.
@ -446,16 +446,6 @@ class ActivityType
return $this->socialActionsVisible; return $this->socialActionsVisible;
} }
public function getSocialDataLabel(): string
{
return $this->socialDataLabel;
}
public function getSocialDataVisible(): int
{
return $this->socialDataVisible;
}
public function getSocialIssuesLabel(): ?string public function getSocialIssuesLabel(): ?string
{ {
return $this->socialIssuesLabel; return $this->socialIssuesLabel;
@ -537,20 +527,6 @@ class ActivityType
return self::FIELD_INVISIBLE !== $this->{$property}; return self::FIELD_INVISIBLE !== $this->{$property};
} }
public function setAccompanyingPeriodLabel(string $accompanyingPeriodLabel): self
{
$this->accompanyingPeriodLabel = $accompanyingPeriodLabel;
return $this;
}
public function setAccompanyingPeriodVisible(int $accompanyingPeriodVisible): self
{
$this->accompanyingPeriodVisible = $accompanyingPeriodVisible;
return $this;
}
/** /**
* Set active * Set active
* set to true if the type is active. * set to true if the type is active.
@ -768,20 +744,6 @@ class ActivityType
return $this; return $this;
} }
public function setSocialDataLabel(string $socialDataLabel): self
{
$this->socialDataLabel = $socialDataLabel;
return $this;
}
public function setSocialDataVisible(int $socialDataVisible): self
{
$this->socialDataVisible = $socialDataVisible;
return $this;
}
public function setSocialIssuesLabel(string $socialIssuesLabel): self public function setSocialIssuesLabel(string $socialIssuesLabel): self
{ {
$this->socialIssuesLabel = $socialIssuesLabel; $this->socialIssuesLabel = $socialIssuesLabel;

View File

@ -25,6 +25,8 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function array_key_exists;
use function count;
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
{ {
@ -72,7 +74,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
array_key_exists('activity', $join) array_key_exists('activity', $join)
&& !$this->checkJoinAlreadyDefined($join['activity'], 'reasons') && !$this->checkJoinAlreadyDefined($join['activity'], 'reasons')
) )
or (!array_key_exists('activity', $join)) || (!array_key_exists('activity', $join))
) { ) {
$qb->add( $qb->add(
'join', 'join',

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;

View File

@ -28,6 +28,8 @@ use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback; use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function array_key_exists; use function array_key_exists;
use function count;
use function in_array;
class ListActivity implements ListInterface class ListActivity implements ListInterface
{ {
@ -73,7 +75,7 @@ class ListActivity implements ListInterface
'choices' => array_combine($this->fields, $this->fields), 'choices' => array_combine($this->fields, $this->fields),
'label' => 'Fields to include in export', 'label' => 'Fields to include in export',
'constraints' => [new Callback([ 'constraints' => [new Callback([
'callback' => function ($selected, ExecutionContextInterface $context) { 'callback' => static function ($selected, ExecutionContextInterface $context) {
if (count($selected) === 0) { if (count($selected) === 0) {
$context->buildViolation('You must select at least one element') $context->buildViolation('You must select at least one element')
->atPath('fields') ->atPath('fields')
@ -187,7 +189,7 @@ class ListActivity implements ListInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(function ($el) { return $el['center']; }, $acl); $centers = array_map(static function ($el) { return $el['center']; }, $acl);
// throw an error if any fields are present // throw an error if any fields are present
if (!array_key_exists('fields', $data)) { if (!array_key_exists('fields', $data)) {
@ -204,7 +206,7 @@ class ListActivity implements ListInterface
->setParameter('authorized_centers', $centers); ->setParameter('authorized_centers', $centers);
foreach ($this->fields as $f) { foreach ($this->fields as $f) {
if (in_array($f, $data['fields'])) { if (in_array($f, $data['fields'], true)) {
switch ($f) { switch ($f) {
case 'id': case 'id':
$qb->addSelect('activity.id AS id'); $qb->addSelect('activity.id AS id');

View File

@ -89,7 +89,7 @@ class ActivityDateFilter implements FilterInterface
); );
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
/* @var $filterForm \Symfony\Component\Form\FormInterface */ /** @var \Symfony\Component\Form\FormInterface $filterForm */
$filterForm = $event->getForm()->getParent(); $filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData(); $enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();

View File

@ -25,8 +25,10 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function array_key_exists;
use function count;
class ActivityReasonFilter implements FilterInterface, ExportElementValidatedInterface class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
{ {
protected ActivityReasonRepository $activityReasonRepository; protected ActivityReasonRepository $activityReasonRepository;

View File

@ -24,8 +24,9 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function count;
class ActivityTypeFilter implements FilterInterface, ExportElementValidatedInterface class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
{ {
protected ActivityTypeRepository $activityTypeRepository; protected ActivityTypeRepository $activityTypeRepository;

View File

@ -31,8 +31,9 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function count;
class PersonHavingActivityBetweenDateFilter implements FilterInterface, ExportElementValidatedInterface class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
{ {
protected ActivityReasonRepository $activityReasonRepository; protected ActivityReasonRepository $activityReasonRepository;
@ -134,7 +135,7 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface, ExportEl
]); ]);
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
/* @var FormInterface $filterForm */ /** @var FormInterface $filterForm */
$filterForm = $event->getForm()->getParent(); $filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData(); $enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityPresence; use Chill\ActivityBundle\Entity\ActivityPresence;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Form\Type\TranslatableStringFormType;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory; use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
@ -46,6 +48,7 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use function in_array;
class ActivityType extends AbstractType class ActivityType extends AbstractType
{ {
@ -124,7 +127,7 @@ class ActivityType extends AbstractType
$builder->add('socialIssues', HiddenType::class); $builder->add('socialIssues', HiddenType::class);
$builder->get('socialIssues') $builder->get('socialIssues')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (iterable $socialIssuesAsIterable): string { static function (iterable $socialIssuesAsIterable): string {
$socialIssueIds = []; $socialIssueIds = [];
foreach ($socialIssuesAsIterable as $value) { foreach ($socialIssuesAsIterable as $value) {
@ -150,7 +153,7 @@ class ActivityType extends AbstractType
$builder->add('socialActions', HiddenType::class); $builder->add('socialActions', HiddenType::class);
$builder->get('socialActions') $builder->get('socialActions')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (iterable $socialActionsAsIterable): string { static function (iterable $socialActionsAsIterable): string {
$socialActionIds = []; $socialActionIds = [];
foreach ($socialActionsAsIterable as $value) { foreach ($socialActionsAsIterable as $value) {
@ -202,7 +205,7 @@ class ActivityType extends AbstractType
'choice_label' => function (ActivityPresence $activityPresence) { 'choice_label' => function (ActivityPresence $activityPresence) {
return $this->translatableStringHelper->localize($activityPresence->getName()); return $this->translatableStringHelper->localize($activityPresence->getName());
}, },
'query_builder' => function (EntityRepository $er) { 'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('a') return $er->createQueryBuilder('a')
->where('a.active = true'); ->where('a.active = true');
}, },
@ -228,7 +231,7 @@ class ActivityType extends AbstractType
return $this->translatableStringHelper->localize($activityReason->getName()); return $this->translatableStringHelper->localize($activityReason->getName());
}, },
'attr' => ['class' => 'select2 '], 'attr' => ['class' => 'select2 '],
'query_builder' => function (EntityRepository $er) { 'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('a') return $er->createQueryBuilder('a')
->where('a.active = true'); ->where('a.active = true');
}, },
@ -247,7 +250,7 @@ class ActivityType extends AbstractType
$builder->add('persons', HiddenType::class); $builder->add('persons', HiddenType::class);
$builder->get('persons') $builder->get('persons')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (iterable $personsAsIterable): string { static function (iterable $personsAsIterable): string {
$personIds = []; $personIds = [];
foreach ($personsAsIterable as $value) { foreach ($personsAsIterable as $value) {
@ -269,7 +272,7 @@ class ActivityType extends AbstractType
$builder->add('thirdParties', HiddenType::class); $builder->add('thirdParties', HiddenType::class);
$builder->get('thirdParties') $builder->get('thirdParties')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (iterable $thirdpartyAsIterable): string { static function (iterable $thirdpartyAsIterable): string {
$thirdpartyIds = []; $thirdpartyIds = [];
foreach ($thirdpartyAsIterable as $value) { foreach ($thirdpartyAsIterable as $value) {
@ -302,7 +305,7 @@ class ActivityType extends AbstractType
$builder->add('users', HiddenType::class); $builder->add('users', HiddenType::class);
$builder->get('users') $builder->get('users')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (iterable $usersAsIterable): string { static function (iterable $usersAsIterable): string {
$userIds = []; $userIds = [];
foreach ($usersAsIterable as $value) { foreach ($usersAsIterable as $value) {
@ -324,7 +327,7 @@ class ActivityType extends AbstractType
$builder->add('location', HiddenType::class) $builder->add('location', HiddenType::class)
->get('location') ->get('location')
->addModelTransformer(new CallbackTransformer( ->addModelTransformer(new CallbackTransformer(
function (?Location $location): string { static function (?Location $location): string {
if (null === $location) { if (null === $location) {
return ''; return '';
} }
@ -364,7 +367,7 @@ class ActivityType extends AbstractType
->addModelTransformer($durationTimeTransformer); ->addModelTransformer($durationTimeTransformer);
$builder->get($fieldName) $builder->get($fieldName)
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $formEvent) use ( ->addEventListener(FormEvents::PRE_SET_DATA, static function (FormEvent $formEvent) use (
$timeChoices, $timeChoices,
$builder, $builder,
$durationTimeTransformer, $durationTimeTransformer,
@ -374,7 +377,7 @@ class ActivityType extends AbstractType
// set the timezone to GMT, and fix the difference between current and GMT // set the timezone to GMT, and fix the difference between current and GMT
// the datetimetransformer will then handle timezone as GMT // the datetimetransformer will then handle timezone as GMT
$timezoneUTC = new DateTimeZone('GMT'); $timezoneUTC = new DateTimeZone('GMT');
/* @var $data \DateTime */ /** @var DateTime $data */
$data = $formEvent->getData() === null ? $data = $formEvent->getData() === null ?
DateTime::createFromFormat('U', 300) : DateTime::createFromFormat('U', 300) :
$formEvent->getData(); $formEvent->getData();
@ -384,7 +387,7 @@ class ActivityType extends AbstractType
// test if the timestamp is in the choices. // test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp // If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) { if (!in_array($data->getTimestamp(), $timeChoices, true)) {
// the data are not in the possible values. add them // the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp(); $timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create($fieldName, ChoiceType::class, array_merge( $form = $builder->create($fieldName, ChoiceType::class, array_merge(

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Chill\ActivityBundle\Entity\ActivityTypeCategory;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Chill\ActivityBundle\Entity\ActivityTypeCategory;
@ -56,7 +58,7 @@ class ActivityTypeType extends AbstractType
'persons', 'user', 'date', 'place', 'persons', 'persons', 'user', 'date', 'place', 'persons',
'thirdParties', 'durationTime', 'travelTime', 'attendee', 'thirdParties', 'durationTime', 'travelTime', 'attendee',
'reasons', 'comment', 'sentReceived', 'documents', 'reasons', 'comment', 'sentReceived', 'documents',
'emergency', 'accompanyingPeriod', 'socialData', 'users', 'emergency', 'socialIssues', 'socialActions', 'users',
]; ];
foreach ($fields as $field) { foreach ($fields as $field) {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type; namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Entity\ActivityType;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type; namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;
@ -55,7 +57,7 @@ class TranslatableActivityReason extends AbstractType
return null; return null;
}, },
'query_builder' => function (EntityRepository $er) { 'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('r') return $er->createQueryBuilder('r')
->where('r.active = true'); ->where('r.active = true');
}, },

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type; namespace Chill\ActivityBundle\Form\Type;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
@ -37,7 +39,7 @@ class TranslatableActivityReasonCategory extends AbstractType
[ [
'class' => 'ChillActivityBundle:ActivityReasonCategory', 'class' => 'ChillActivityBundle:ActivityReasonCategory',
'choice_label' => 'name[' . $locale . ']', 'choice_label' => 'name[' . $locale . ']',
'query_builder' => function (EntityRepository $er) { 'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('c') return $er->createQueryBuilder('c')
->where('c.active = true'); ->where('c.active = true');
}, },

View File

@ -37,7 +37,7 @@ class TranslatableActivityType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
/* @var QueryBuilder $qb */ /** @var QueryBuilder $qb */
$qb = $options['query_builder']; $qb = $options['query_builder'];
if (true === $options['active_only']) { if (true === $options['active_only']) {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Menu; namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;

View File

@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem; use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use function in_array;
final class AdminMenuBuilder implements LocalMenuBuilderInterface final class AdminMenuBuilder implements LocalMenuBuilderInterface
{ {
@ -30,7 +31,7 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface
return; return;
} }
if (in_array($menuId, ['admin_index', 'admin_section'])) { if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Activities', [ $menu->addChild('Activities', [
'route' => 'chill_admin_activity_index', 'route' => 'chill_admin_activity_index',
]) ])

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Menu; namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
@ -37,7 +39,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
public function buildMenu($menuId, MenuItem $menu, array $parameters) public function buildMenu($menuId, MenuItem $menu, array $parameters)
{ {
/* @var $person \Chill\PersonBundle\Entity\Person */ /** @var \Chill\PersonBundle\Entity\Person $person */
$person = $parameters['person']; $person = $parameters['person'];
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Notification; namespace Chill\ActivityBundle\Notification;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
@ -26,6 +28,6 @@ final class ActivityNotificationRenderer
public function supports(Notification $notification, array $options = []): bool public function supports(Notification $notification, array $options = []): bool
{ {
return $notification->getRelatedEntityClass() == Activity::class; return $notification->getRelatedEntityClass() === Activity::class;
} }
} }

View File

@ -22,6 +22,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use function count;
use function in_array; use function in_array;
final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
@ -159,14 +160,14 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
foreach ($reachableCenters as $center) { foreach ($reachableCenters as $center) {
// we pass if not in centers // we pass if not in centers
if (!in_array($center, $args['centers'])) { if (!in_array($center, $args['centers'], true)) {
continue; continue;
} }
// we get all the reachable scopes for this center // we get all the reachable scopes for this center
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center); $reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
// we get the ids for those scopes // we get the ids for those scopes
$reachablesScopesId = array_map( $reachablesScopesId = array_map(
function (Scope $scope) { return $scope->getId(); }, static function (Scope $scope) { return $scope->getId(); },
$reachableScopes $reachableScopes
); );

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository; namespace Chill\ActivityBundle\Repository;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;

View File

@ -1,7 +1,7 @@
<template> <template>
<concerned-groups></concerned-groups> <concerned-groups v-if="hasPerson"></concerned-groups>
<social-issues-acc></social-issues-acc> <social-issues-acc v-if="hasSocialIssues"></social-issues-acc>
<location></location> <location v-if="hasLocation"></location>
</template> </template>
<script> <script>
@ -11,6 +11,7 @@ import Location from './components/Location.vue';
export default { export default {
name: "App", name: "App",
props: ['hasSocialIssues', 'hasLocation', 'hasPerson'],
components: { components: {
ConcernedGroups, ConcernedGroups,
SocialIssuesAcc, SocialIssuesAcc,

View File

@ -1,4 +1,5 @@
import { getSocialIssues } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api.js'; import { getSocialIssues } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api.js';
import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods';
/* /*
* Load socialActions by socialIssue (id) * Load socialActions by socialIssue (id)
@ -12,33 +13,20 @@ const getSocialActionByIssue = (id) => {
}); });
}; };
/* const getLocations = () => fetchResults('/api/1.0/main/location.json');
* Load Locations
*/ const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
const getLocations = () => {
const url = `/api/1.0/main/location.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
/* /*
* Load Location Types * Load Location Type by defaultFor
* @param {string} entity - can be "person" or "thirdparty"
*/ */
const getLocationTypes = () => { const getLocationTypeByDefaultFor = (entity) => {
const url = `/api/1.0/main/location-type.json`; return getLocationTypes().then(results =>
return fetch(url) results.filter(t => t.defaultFor === entity)[0]
.then(response => { );
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
}; };
/*
* Post a Location
*/
const postLocation = (body) => { const postLocation = (body) => {
const url = `/api/1.0/main/location.json`; const url = `/api/1.0/main/location.json`;
return fetch(url, { return fetch(url, {
@ -59,5 +47,6 @@ export {
getSocialActionByIssue, getSocialActionByIssue,
getLocations, getLocations,
getLocationTypes, getLocationTypes,
getLocationTypeByDefaultFor,
postLocation postLocation
}; };

View File

@ -1,35 +1,33 @@
<template> <template>
<teleport to="#add-persons" v-if="isComponentVisible"> <teleport to="#add-persons" v-if="isComponentVisible">
<div class="flex-bloc concerned-groups" :class="getContext"> <div class="flex-bloc concerned-groups" :class="getContext">
<persons-bloc <persons-bloc
v-for="bloc in contextPersonsBlocs" v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key" v-bind:key="bloc.key"
v-bind:bloc="bloc" v-bind:bloc="bloc"
v-bind:setPersonsInBloc="setPersonsInBloc"> v-bind:blocWidth="getBlocWidth"
</persons-bloc> v-bind:setPersonsInBloc="setPersonsInBloc">
</div> </persons-bloc>
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0"> </div>
<ul class="list-unstyled"> <div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)"> <ul class="list-suggest add-items">
<span class="badge bg-primary" style="cursor: pointer;"> <li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
<i class="fa fa-plus fa-fw text-success"></i> <span>{{ p.text }}</span>
{{ p.text }} </li>
</span> </ul>
</li> </div>
</ul>
</div>
<add-persons <add-persons
buttonTitle="activity.add_persons" buttonTitle="activity.add_persons"
modalTitle="activity.add_persons" modalTitle="activity.add_persons"
v-bind:key="addPersons.key" v-bind:key="addPersons.key"
v-bind:options="addPersonsOptions" v-bind:options="addPersonsOptions"
@addNewPersons="addNewPersons" @addNewPersons="addNewPersons"
ref="addPersons"> ref="addPersons">
</add-persons> </add-persons>
</teleport> </teleport>
</template> </template>
<script> <script>
@ -122,6 +120,9 @@ export default {
} }
} }
}, },
getBlocWidth() {
return Math.round(100/(this.contextPersonsBlocs.length)) + '%';
}
}, },
mounted() { mounted() {
this.setPersonsInBloc(); this.setPersonsInBloc();

View File

@ -1,12 +1,8 @@
<template> <template>
<li> <li>
<span class="badge bg-primary" :title="person.text"> <span :title="person.text">
<span class="chill_denomination"> <span class="chill_denomination">{{ textCutted }}</span>
{{ textCutted }} <a @click.prevent="$emit('remove', person)"></a>
</span>
<a class="fa fa-fw fa-times text-danger text-decoration-none"
@click.prevent="$emit('remove', person)">
</a>
</span> </span>
</li> </li>
</template> </template>

View File

@ -1,11 +1,11 @@
<template> <template>
<div class="item-bloc"> <div class="item-bloc" :style="{ 'flex-basis': blocWidth }">
<div class="item-row"> <div class="item-row">
<div class="item-col"> <div class="item-col">
<h4>{{ $t(bloc.title) }}</h4> <h4>{{ $t(bloc.title) }}</h4>
</div> </div>
<div class="item-col"> <div class="item-col">
<ul class="list-content"> <ul class="list-suggest remove-items">
<person-badge <person-badge
v-for="person in bloc.persons" v-for="person in bloc.persons"
v-bind:key="person.id" v-bind:key="person.id"
@ -25,7 +25,7 @@ export default {
components: { components: {
PersonBadge PersonBadge
}, },
props: ['bloc', 'setPersonsInBloc'], props: ['bloc', 'setPersonsInBloc', 'blocWidth'],
methods: { methods: {
removePerson(item) { removePerson(item) {
console.log('@@ CLICK remove person: item', item); console.log('@@ CLICK remove person: item', item);

View File

@ -2,10 +2,9 @@
<teleport to="#location"> <teleport to="#location">
<div class="mb-3 row"> <div class="mb-3 row">
<label class="col-form-label col-sm-4"> <label class="col-form-label col-sm-4">
{{ $t('activity.location') }} {{ $t("activity.location") }}
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<VueMultiselect <VueMultiselect
name="selectLocation" name="selectLocation"
id="selectLocation" id="selectLocation"
@ -17,7 +16,10 @@
:placeholder="$t('activity.choose_location')" :placeholder="$t('activity.choose_location')"
:custom-label="customLabel" :custom-label="customLabel"
:options="locations" :options="locations"
v-model="location"> group-values="locations"
group-label="locationGroup"
v-model="location"
>
</VueMultiselect> </VueMultiselect>
<new-location v-bind:locations="locations"></new-location> <new-location v-bind:locations="locations"></new-location>
@ -27,49 +29,146 @@
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapState, mapGetters } from "vuex";
import VueMultiselect from 'vue-multiselect'; import VueMultiselect from "vue-multiselect";
import NewLocation from './Location/NewLocation.vue'; import NewLocation from "./Location/NewLocation.vue";
import { getLocations } from '../api.js'; import { getLocations, getLocationTypeByDefaultFor } from "../api.js";
export default { export default {
name: "Location", name: "Location",
components: { components: {
NewLocation, NewLocation,
VueMultiselect VueMultiselect,
}, },
data() { data() {
return { return {
locations: [] locations: [],
} };
}, },
computed: { computed: {
...mapState(['activity']), ...mapState(["activity"]),
...mapGetters(["suggestedEntities"]),
location: { location: {
get() { get() {
return this.activity.location; return this.activity.location;
}, },
set(value) { set(value) {
this.$store.dispatch('updateLocation', value); this.$store.dispatch("updateLocation", value);
} },
} },
}, },
mounted() { mounted() {
getLocations().then(response => new Promise(resolve => { getLocations().then(
console.log('getLocations', response); (results) => {
this.locations = response.results; getLocationTypeByDefaultFor('person').then(
if (window.default_location_id) { (personLocationType) => {
let location = this.locations.filter(l => l.id === window.default_location_id); if (personLocationType) {
this.$store.dispatch('updateLocation', location); const personLocation = this.makeAccompanyingPeriodLocation(personLocationType);
} const concernedPersonsLocation =
resolve(); this.makeConcernedPersonsLocation(personLocationType);
})) getLocationTypeByDefaultFor('thirdparty').then(
thirdpartyLocationType => {
const concernedThirdPartiesLocation =
this.makeConcernedThirdPartiesLocation(thirdpartyLocationType);
this.locations = [
{
locationGroup: 'Localisation du parcours',
locations: [personLocation]
},
{
locationGroup: 'Parties concernées',
locations: [...concernedPersonsLocation, ...concernedThirdPartiesLocation]
},
{
locationGroup: 'Autres localisations',
locations: results
}
];
}
)
} else {
this.locations = [
{
locationGroup: 'Localisations',
locations: response.results
}
];
}
if (window.default_location_id) {
let location = this.locations.filter(
(l) => l.id === window.default_location_id
);
this.$store.dispatch("updateLocation", location);
}
}
)
})
}, },
methods: { methods: {
labelAccompanyingCourseLocation(value) {
return `${value.address.text} (${value.locationType.title.fr})`
},
customLabel(value) { customLabel(value) {
return `${value.locationType.title.fr} ${value.name ? value.name : ''}`; return value.locationType
? value.name
? value.name === '__AccompanyingCourseLocation__'
? this.labelAccompanyingCourseLocation(value)
: `${value.name} (${value.locationType.title.fr})`
: value.locationType.title.fr
: '';
},
makeConcernedPersonsLocation(locationType) {
let locations = [];
this.suggestedEntities.forEach(
(e) => {
if (e.type === 'person' && e.current_household_address !== null){
locations.push({
type: 'location',
id: -this.suggestedEntities.indexOf(e)*10,
onthefly: true,
name: e.text,
address: {
id: e.current_household_address.address_id,
},
locationType: locationType
});
}
}
)
return locations;
},
makeConcernedThirdPartiesLocation(locationType) {
let locations = [];
this.suggestedEntities.forEach(
(e) => {
if (e.type === 'thirdparty' && e.address !== null){
locations.push({
type: 'location',
id: -this.suggestedEntities.indexOf(e)*10,
onthefly: true,
name: e.text,
address: { id: e.address.address_id },
locationType: locationType
});
}
}
)
return locations;
},
makeAccompanyingPeriodLocation(locationType) {
const accPeriodLocation = this.activity.accompanyingPeriod.location;
return {
type: 'location',
id: -1,
onthefly: true,
name: '__AccompanyingCourseLocation__',
address: {
id: accPeriodLocation.address_id,
text: `${accPeriodLocation.text} - ${accPeriodLocation.postcode.code} ${accPeriodLocation.postcode.name}`
},
locationType: locationType
}
} }
} },
} };
</script> </script>

View File

@ -214,11 +214,9 @@ export default {
return cond; return cond;
}, },
getLocationTypesList() { getLocationTypesList() {
getLocationTypes().then(response => new Promise(resolve => { getLocationTypes().then(results => {
console.log('getLocationTypes', response); this.locationTypes = results.filter(t => t.availableForUsers === true);
this.locationTypes = response.results.filter(t => t.availableForUsers === true); })
resolve();
}))
}, },
openModal() { openModal() {
this.modal.showModal = true; this.modal.showModal = true;
@ -247,7 +245,6 @@ export default {
postLocation(body) postLocation(body)
.then( .then(
location => new Promise(resolve => { location => new Promise(resolve => {
console.log('postLocation', location);
this.locations.push(location); this.locations.push(location);
this.$store.dispatch('updateLocation', location); this.$store.dispatch('updateLocation', location);
resolve(); resolve();

View File

@ -50,19 +50,26 @@
<i class="chill-green fa fa-circle-o-notch fa-spin fa-lg"></i> <i class="chill-green fa fa-circle-o-notch fa-spin fa-lg"></i>
</div> </div>
<check-social-action <span v-else-if="socialIssuesSelected.length === 0" class="inline-choice chill-no-data-statement mt-3">
v-if="socialIssuesSelected.length || socialActionsSelected.length"
v-for="action in socialActionsList"
v-bind:key="action.id"
v-bind:action="action"
v-bind:selection="socialActionsSelected"
@updateSelected="updateActionsSelected">
</check-social-action>
<span v-else class="inline-choice chill-no-data-statement mt-3">
{{ $t('activity.select_first_a_social_issue') }} {{ $t('activity.select_first_a_social_issue') }}
</span> </span>
<template v-else-if="socialActionsList.length > 0">
<check-social-action
v-if="socialIssuesSelected.length || socialActionsSelected.length"
v-for="action in socialActionsList"
v-bind:key="action.id"
v-bind:action="action"
v-bind:selection="socialActionsSelected"
@updateSelected="updateActionsSelected">
</check-social-action>
</template>
<span v-else-if="actionAreLoaded && socialActionsList.length === 0" class="inline-choice chill-no-data-statement mt-3">
{{ $t('activity.social_action_list_empty') }}
</span>
</div> </div>
</div> </div>
@ -85,7 +92,8 @@ export default {
data() { data() {
return { return {
issueIsLoading: false, issueIsLoading: false,
actionIsLoading: false actionIsLoading: false,
actionAreLoaded: false,
} }
}, },
computed: { computed: {
@ -109,6 +117,7 @@ export default {
/* Load others issues in multiselect /* Load others issues in multiselect
*/ */
this.issueIsLoading = true; this.issueIsLoading = true;
this.actionAreLoaded = false;
getSocialIssues().then(response => new Promise((resolve, reject) => { getSocialIssues().then(response => new Promise((resolve, reject) => {
this.$store.commit('updateIssuesOther', response.results); this.$store.commit('updateIssuesOther', response.results);
@ -141,6 +150,8 @@ export default {
this.$store.commit('filterList', 'actions'); this.$store.commit('filterList', 'actions');
this.issueIsLoading = false; this.issueIsLoading = false;
this.actionAreLoaded = true;
this.updateActionsList();
resolve(); resolve();
})); }));
}, },
@ -173,7 +184,6 @@ export default {
to get social actions concerned to get social actions concerned
*/ */
updateActionsList() { updateActionsList() {
//console.log('updateActionsList');
this.resetActionsList(); this.resetActionsList();
this.socialIssuesSelected.forEach(item => { this.socialIssuesSelected.forEach(item => {
@ -188,6 +198,7 @@ export default {
this.$store.commit('filterList', 'actions'); this.$store.commit('filterList', 'actions');
this.actionIsLoading = false; this.actionIsLoading = false;
this.actionAreLoaded = true;
resolve(); resolve();
})); }));
}, this); }, this);
@ -196,6 +207,7 @@ export default {
*/ */
resetActionsList() { resetActionsList() {
this.$store.commit('resetActionsList'); this.$store.commit('resetActionsList');
this.actionAreLoaded = false;
this.socialActionsSelected.forEach(item => { this.socialActionsSelected.forEach(item => {
this.$store.commit('addActionInList', item); this.$store.commit('addActionInList', item);
}, this); }, this);

View File

@ -10,7 +10,7 @@
v-bind:value="action" v-bind:value="action"
/> />
<label class="form-check-label" v-bind:for="action.id"> <label class="form-check-label" v-bind:for="action.id">
{{ action.text }} <span class="badge bg-light text-dark">{{ action.text }}</span>
</label> </label>
</div> </div>
@ -34,3 +34,15 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped>
@import 'ChillMainAssets/module/bootstrap/shared';
@import 'ChillPersonAssets/chill/scss/mixins';
@import 'ChillMainAssets/chill/scss/chill_variables';
span.badge {
@include badge_social($social-action-color);
font-size: 95%;
margin-bottom: 5px;
margin-right: 1em;
}
</style>

View File

@ -10,7 +10,7 @@
v-bind:value="issue" v-bind:value="issue"
/> />
<label class="form-check-label" v-bind:for="issue.id"> <label class="form-check-label" v-bind:for="issue.id">
{{ issue.text }} <span class="badge bg-chill-l-gray text-dark">{{ issue.text }}</span>
</label> </label>
</div> </div>
@ -34,3 +34,15 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped>
@import 'ChillMainAssets/module/bootstrap/shared';
@import 'ChillPersonAssets/chill/scss/mixins';
@import 'ChillMainAssets/chill/scss/chill_variables';
span.badge {
@include badge_social($social-issue-color);
font-size: 95%;
margin-bottom: 5px;
margin-right: 1em;
}
</style>

View File

@ -9,6 +9,7 @@ const activityMessages = {
choose_other_social_issue: "Ajouter une autre problématique sociale...", choose_other_social_issue: "Ajouter une autre problématique sociale...",
social_actions: "Actions d'accompagnement", social_actions: "Actions d'accompagnement",
select_first_a_social_issue: "Sélectionnez d'abord une problématique sociale", select_first_a_social_issue: "Sélectionnez d'abord une problématique sociale",
social_action_list_empty: "Aucune action sociale disponible",
// //
add_persons: "Ajouter des personnes concernées", add_persons: "Ajouter des personnes concernées",

View File

@ -7,8 +7,19 @@ import App from './App.vue';
const i18n = _createI18n(activityMessages); const i18n = _createI18n(activityMessages);
const hasSocialIssues = document.querySelector('#social-issues-acc') !== null;
const hasLocation = document.querySelector('#location') !== null;
const hasPerson = document.querySelector('#add-persons') !== null;
const app = createApp({ const app = createApp({
template: `<app></app>`, template: `<app :hasSocialIssues="hasSocialIssues", :hasLocation="hasLocation", :hasPerson="hasPerson"></app>`,
data() {
return {
hasSocialIssues,
hasLocation,
hasPerson,
};
}
}) })
.use(store) .use(store)
.use(i18n) .use(i18n)

View File

@ -1,5 +1,6 @@
import 'es6-promise/auto'; import 'es6-promise/auto';
import { createStore } from 'vuex'; import { createStore } from 'vuex';
import { postLocation } from './api';
const debug = process.env.NODE_ENV !== 'production'; const debug = process.env.NODE_ENV !== 'production';
//console.log('window.activity', window.activity); //console.log('window.activity', window.activity);
@ -27,7 +28,6 @@ const store = createStore({
}, },
getters: { getters: {
suggestedEntities(state) { suggestedEntities(state) {
console.log(state.activity);
if (typeof state.activity.accompanyingPeriod === "undefined") { if (typeof state.activity.accompanyingPeriod === "undefined") {
return []; return [];
} }
@ -303,7 +303,33 @@ const store = createStore({
let hiddenLocation = document.getElementById( let hiddenLocation = document.getElementById(
"chill_activitybundle_activity_location" "chill_activitybundle_activity_location"
); );
hiddenLocation.value = value.id; if (value.onthefly) {
const body = {
"type": "location",
"name": value.name === '__AccompanyingCourseLocation__' ? null : value.name,
"locationType": {
"id": value.locationType.id,
"type": "location-type"
}
};
if (value.address.id) {
Object.assign(body, {
"address": {
"id": value.address.id
},
})
}
postLocation(body)
.then(
location => hiddenLocation.value = location.id
).catch(
err => {
console.log(err.message);
}
);
} else {
hiddenLocation.value = value.id;
}
commit("updateLocation", value); commit("updateLocation", value);
}, },
}, },

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Kernel;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
use Composer\Autoload\ClassLoader; use Composer\Autoload\ClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Annotations\AnnotationRegistry;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
use Symfony\Component\Debug\Debug; use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -18,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request;
// Feel free to remove this, extend it, or make something more sophisticated. // 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']) || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') || !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
) { ) {
header('HTTP/1.0 403 Forbidden'); header('HTTP/1.0 403 Forbidden');

View File

@ -26,23 +26,45 @@
{{ activity.type.name | localize_translatable_string }} {{ activity.type.name | localize_translatable_string }}
<ul class="small_in_title"> {% if activity.emergency %}
{% if activity.location and t.locationVisible %} <span class="badge bg-danger rounded-pill fs-6">{{ 'Emergency'|trans|upper }}</span>
<li> {% endif %}
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span> <ul class="small_in_title mt-3">
{{ activity.location.name }}
</li> {% if activity.sentReceived is not empty and t.sentReceivedVisible %}
<li>
<span class="item-key">{{ 'Sent received'|trans ~ ' : ' }}</span>
<b>{{ activity.sentReceived|capitalize|trans }}</b>
</li>
{% endif %} {% endif %}
{% if activity.location and t.locationVisible %}
<li>
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
<b>
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
{{ activity.location.name }}
</b>
</li>
{% endif %}
{% if activity.user and t.userVisible %} {% if activity.user and t.userVisible %}
<li> <li>
<span class="item-key">{{ 'Referrer'|trans ~ ': ' }}</span> <span class="item-key">{{ 'Referrer'|trans ~ ': ' }}</span>
{{ activity.user.usernameCanonical }} <b>{{ activity.user.usernameCanonical }}</b>
</li> </li>
{% endif %} {% endif %}
<li class="associated-persons">
<span class="item-key">{{ 'Participants'|trans ~ ' : ' }}</span>
{% for p in activity.personsAssociated %}
<span class="badge-person">{{ p|chill_entity_render_box }}</span>
{% endfor %}
</li>
</ul> </ul>
<ul class="list-content"> <ul class="list-content my-3">
{%- if t.reasonsVisible -%} {%- if t.reasonsVisible -%}
{%- if activity.reasons is not empty -%} {%- if activity.reasons is not empty -%}
<li class="reasons"> <li class="reasons">
@ -71,11 +93,9 @@
{%- endif -%} {%- endif -%}
{% endif %} {% endif %}
</ul> </ul>
</span> </span>
</h2> </h2>
{#
{% if context == 'person' and activity.accompanyingPeriod is not empty %} {% if context == 'person' and activity.accompanyingPeriod is not empty %}
<div class="mt-3"> <div class="mt-3">
<a class="btn btn-sm btn-outline-primary" <a class="btn btn-sm btn-outline-primary"
@ -87,4 +107,4 @@
</a> </a>
</div> </div>
{% endif %} {% endif %}
#}

View File

@ -3,89 +3,93 @@
{{ path(pathname, parms) }} {{ path(pathname, parms) }}
{% endmacro %} {% endmacro %}
{% if context == 'person' %} {% macro computeWidth(nbBlocks) %}
{% set blocs = [ {{ 'flex-basis: ' ~ (100 / nbBlocks)|round(1) ~ '%;' }}
{ 'title': 'Others persons'|trans, {% endmacro %}
{% set blocks = [] %}
{% if entity.activityType.personsVisible %}
{% if context == 'person' %}
{% set blocks = blocks|merge([{
'title': 'Others persons'|trans,
'items': entity.persons, 'items': entity.persons,
'path' : 'chill_person_view', 'path' : 'chill_person_view',
'key' : 'person_id' 'key' : 'person_id'
}, }]) %}
{ 'title': 'Third parties'|trans, {% else %}
'items': entity.thirdParties, {% set blocks = blocks|merge([{
'path' : 'chill_crud_3party_3party_view', 'title': 'Persons in accompanying course'|trans,
'key' : 'id'
},
{ 'title': 'Users concerned'|trans,
'items': entity.users,
'key' : 'id'
},
] %}
{% else %}
{% set blocs = [
{ 'title': 'Persons in accompanying course'|trans,
'items': entity.personsAssociated, 'items': entity.personsAssociated,
'path' : 'chill_person_view', 'path' : 'chill_person_view',
'key' : 'person_id' 'key' : 'person_id'
}, },{
{ 'title': 'Third persons'|trans, 'title': 'Third persons'|trans,
'items': entity.personsNotAssociated, 'items': entity.personsNotAssociated,
'path' : 'chill_person_view', 'path' : 'chill_person_view',
'key' : 'person_id' 'key' : 'person_id',
}, }]) %}
{ 'title': 'Third parties'|trans, {% endif %}
'items': entity.thirdParties, {% endif %}
'path' : 'chill_crud_3party_3party_view', {% if entity.activityType.thirdPartiesVisible %}
'key' : 'id' {% set blocks = blocks|merge([{
}, 'title': 'Third parties'|trans,
{ 'title': 'Users concerned'|trans, 'items': entity.thirdParties,
'items': entity.users, 'path' : 'chill_crud_3party_3party_view',
'key' : 'id' 'key' : 'id',
}, }]) %}
] %} {% endif %}
{% if entity.activityType.usersVisible %}
{% set blocks = blocks|merge([{
'title': 'Users concerned'|trans,
'items': entity.users,
'key' : 'id',
}]) %}
{% endif %} {% endif %}
{% if (with_display == 'bloc') %} {% if (with_display == 'bloc') %}
<div class="{{ context }} flex-bloc concerned-groups"> <div class="{{ context }} flex-bloc concerned-groups">
{% for bloc in blocs %} {% for bloc in blocks %}
<div class="item-bloc">
<div class="item-row"> <div class="item-bloc" style="{{ _self.computeWidth(loop.length) }}">
<div class="item-col"> <div class="item-row">
<h4>{{ bloc.title }}</h4> <div class="item-col">
</div> <h4>{{ bloc.title }}</h4>
<div class="item-col"> </div>
<ul class="list-content"> <div class="item-col">
{% for item in bloc.items %} <ul class="list-content">
<li> {% for item in bloc.items %}
{% if bloc.path is defined %} <li>
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}"> {% if bloc.path is defined %}
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}"> <a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
{{ item|chill_entity_render_box({ <span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
'render': 'raw', {{ item|chill_entity_render_box({
'addAltNames': false 'render': 'raw',
}) }} 'addAltNames': false
</span> }) }}
</a> </span>
{% else %} </a>
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}"> {% else %}
{{ item|chill_entity_render_box({ <span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
'render': 'raw', {{ item|chill_entity_render_box({
'addAltNames': false 'render': 'raw',
}) }} 'addAltNames': false
</span> }) }}
{% endif %} </span>
</li> {% endif %}
{% endfor %} </li>
</ul> {% endfor %}
</ul>
</div>
</div> </div>
</div> </div>
</div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% if (with_display == 'row') %} {% if (with_display == 'row') %}
<div class="concerned-groups"> <div class="concerned-groups">
{% for bloc in blocs %} {% for bloc in blocks %}
<div class="group"> <div class="group">
{% if bloc.items|length > 0 %} {% if bloc.items|length > 0 %}
<h4>{{ bloc.title }}</h4> <h4>{{ bloc.title }}</h4>
@ -118,7 +122,7 @@
{% if (with_display == 'wrap-list') %} {% if (with_display == 'wrap-list') %}
<div class="concerned-groups wrap-list"> <div class="concerned-groups wrap-list">
{% for bloc in blocs %} {% for bloc in blocks %}
<div class="wl-row"> <div class="wl-row">
{% if bloc.items|length > 0 %} {% if bloc.items|length > 0 %}
<div class="wl-col title"> <div class="wl-col title">

View File

@ -28,7 +28,9 @@
{{ form_row(edit_form.socialActions) }} {{ form_row(edit_form.socialActions) }}
{% endif %} {% endif %}
{%- if edit_form.socialIssues is defined or edit_form.socialIssues is defined -%}
<div id="social-issues-acc"></div> <div id="social-issues-acc"></div>
{% endif %}
{%- if edit_form.reasons is defined -%} {%- if edit_form.reasons is defined -%}
{{ form_row(edit_form.reasons) }} {{ form_row(edit_form.reasons) }}
@ -46,9 +48,10 @@
{%- if edit_form.users is defined -%} {%- if edit_form.users is defined -%}
{{ form_widget(edit_form.users) }} {{ form_widget(edit_form.users) }}
{% endif %} {% endif %}
<div id="add-persons"></div>
{% endif %} {% endif %}
<div id="add-persons"></div>
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2> <h2 class="chill-red">{{ 'Activity data'|trans }}</h2>

View File

@ -2,9 +2,11 @@
{% for activity in activities | slice(0,5) %} {% for activity in activities | slice(0,5) %}
{% set t = activity.type %} {% set t = activity.type %}
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"></a> <a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
class="badge-link" title="{{ 'Show the activity'|trans }}">
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %} {% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
</a>
{% endfor %} {% endfor %}
</div> </div>

View File

@ -29,25 +29,31 @@
{{ form_row(form.socialActions) }} {{ form_row(form.socialActions) }}
{% endif %} {% endif %}
<div id="social-issues-acc"></div> {%- if form.socialIssues is defined or form.socialIssues is defined -%}
<div id="social-issues-acc"></div>
{% endif %}
{%- if form.reasons is defined -%} {%- if form.reasons is defined -%}
{{ form_row(form.reasons) }} {{ form_row(form.reasons) }}
{% endif %} {% endif %}
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2> {%- if form.persons is defined or form.thirdParties is defined or form.users is defined -%}
{%- if form.persons is defined -%} <h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
{{ form_widget(form.persons) }}
{% endif %}
{%- if form.thirdParties is defined -%}
{{ form_widget(form.thirdParties) }}
{% endif %}
{%- if form.users is defined -%}
{{ form_widget(form.users) }}
{% endif %}
<div id="add-persons"></div> {%- if form.persons is defined -%}
{{ form_widget(form.persons) }}
{% endif %}
{%- if form.thirdParties is defined -%}
{{ form_widget(form.thirdParties) }}
{% endif %}
{%- if form.users is defined -%}
{{ form_widget(form.users) }}
{% endif %}
<div id="add-persons"></div>
{% endif %}
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2> <h2 class="chill-red">{{ 'Activity data'|trans }}</h2>

View File

@ -22,7 +22,7 @@
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}'); '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
}); });
window.activity = {{ activity_json|json_encode|raw }}; window.activity = {{ activity_json|json_encode|raw }};
window.default_location_id = {{ default_location_id }}; {% if default_location is not null %}window.default_location_id = {{ default_location.id }}{% endif %};
</script> </script>
{{ encore_entry_script_tags('vue_activity') }} {{ encore_entry_script_tags('vue_activity') }}
{% endblock %} {% endblock %}

View File

@ -27,7 +27,7 @@
<dt class="inline">{{ 'Social issues'|trans }}</dt> <dt class="inline">{{ 'Social issues'|trans }}</dt>
<dd> <dd>
{% if entity.socialIssues|length == 0 %} {% if entity.socialIssues|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any social issues'|trans }}</p> <p class="chill-no-data-statement">{{ 'No social issues associated'|trans }}</p>
{% else %} {% else %}
{% for si in entity.socialIssues %}{{ si|chill_entity_render_box }}{% endfor %} {% for si in entity.socialIssues %}{{ si|chill_entity_render_box }}{% endfor %}
{% endif %} {% endif %}
@ -38,7 +38,7 @@
<dt class="inline">{{ 'Social actions'|trans }}</dt> <dt class="inline">{{ 'Social actions'|trans }}</dt>
<dd> <dd>
{% if entity.socialActions|length == 0 %} {% if entity.socialActions|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any social actions'|trans }}</p> <p class="chill-no-data-statement">{{ 'No social actions associated'|trans }}</p>
{% else %} {% else %}
{% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %} {% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %}
{% endif %} {% endif %}
@ -67,8 +67,8 @@
<dd> <dd>
{% if entity.location is not null %} {% if entity.location is not null %}
<p> <p>
<span>{{ entity.location.locationType.title|localize_translatable_string }}</span>
{{ entity.location.name }} {{ entity.location.name }}
<span> ({{ entity.location.locationType.title|localize_translatable_string }})</span>
</p> </p>
{{ entity.location.address|chill_entity_render_box }} {{ entity.location.address|chill_entity_render_box }}
{% else %} {% else %}

View File

@ -9,7 +9,7 @@
{% block content -%} {% block content -%}
<div class="activity-show"> <div class="activity-show">
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %} {% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
</div> </div>
{% endblock content %} {% endblock content %}

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Security\Authorization; namespace Chill\ActivityBundle\Security\Authorization;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
@ -63,7 +65,7 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
if ($subject instanceof Center if ($subject instanceof Center
&& in_array($attribute, $this->getAttributes())) { && in_array($attribute, $this->getAttributes(), true)) {
return true; return true;
} }

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Templating\Entity; namespace Chill\ActivityBundle\Templating\Entity;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Test; namespace Chill\ActivityBundle\Test;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;

View File

@ -7,21 +7,25 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use RuntimeException; use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use function count;
use function in_array;
/** /**
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityControllerTest extends WebTestCase final class ActivityControllerTest extends WebTestCase
{ {
public function getSecuredPagesAuthenticated() public function getSecuredPagesAuthenticated()
{ {
static::bootKernel(); self::bootKernel();
$person = $this->getPersonFromFixtures(); $person = $this->getPersonFromFixtures();
$activities = $this->getActivitiesForPerson($person); $activities = $this->getActivitiesForPerson($person);
@ -57,7 +61,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
public function getSecuredPagesUnauthenticated() public function getSecuredPagesUnauthenticated()
{ {
static::bootKernel(); self::bootKernel();
$person = $this->getPersonFromFixtures(); $person = $this->getPersonFromFixtures();
$activities = $this->getActivitiesForPerson($person); $activities = $this->getActivitiesForPerson($person);
@ -200,7 +204,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function createFakeUser() private function createFakeUser()
{ {
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$em = $container->get('doctrine.orm.entity_manager'); $em = $container->get('doctrine.orm.entity_manager');
//get the social PermissionGroup, and remove CHILL_ACTIVITY_* //get the social PermissionGroup, and remove CHILL_ACTIVITY_*
@ -242,7 +246,7 @@ class ActivityControllerTest extends WebTestCase
private function getActivitiesForPerson(\Chill\PersonBundle\Entity\Person $person) private function getActivitiesForPerson(\Chill\PersonBundle\Entity\Person $person)
{ {
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
$activities = $em->getRepository('ChillActivityBundle:Activity') $activities = $em->getRepository('ChillActivityBundle:Activity')
@ -263,7 +267,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getAuthenticatedClient($username = 'center a_social') private function getAuthenticatedClient($username = 'center a_social')
{ {
return static::createClient([], [ return self::createClient([], [
'PHP_AUTH_USER' => $username, 'PHP_AUTH_USER' => $username,
'PHP_AUTH_PW' => 'password', 'PHP_AUTH_PW' => 'password',
]); ]);
@ -274,7 +278,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getPersonFromFixtures() private function getPersonFromFixtures()
{ {
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
$person = $em->getRepository('ChillPersonBundle:Person') $person = $em->getRepository('ChillPersonBundle:Person')
@ -298,14 +302,14 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getRandomActivityReason(array $excludeIds = []) private function getRandomActivityReason(array $excludeIds = [])
{ {
$reasons = static::$kernel->getContainer() $reasons = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillActivityBundle:ActivityReason') ->getRepository('ChillActivityBundle:ActivityReason')
->findAll(); ->findAll();
$reason = $reasons[array_rand($reasons)]; $reason = $reasons[array_rand($reasons)];
if (in_array($reason->getId(), $excludeIds)) { if (in_array($reason->getId(), $excludeIds, true)) {
return $this->getRandomActivityReason($excludeIds); return $this->getRandomActivityReason($excludeIds);
} }
@ -317,7 +321,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getRandomActivityType() private function getRandomActivityType()
{ {
$types = static::$kernel->getContainer() $types = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillActivityBundle:ActivityType') ->getRepository('ChillActivityBundle:ActivityType')
->findAll(); ->findAll();
@ -333,7 +337,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getRandomScope($username, $centerName) private function getRandomScope($username, $centerName)
{ {
$user = static::$kernel->getContainer() $user = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillMainBundle:User') ->getRepository('ChillMainBundle:User')
->findOneByUsername($username); ->findOneByUsername($username);
@ -343,20 +347,20 @@ class ActivityControllerTest extends WebTestCase
. 'does not exists in database. Did you add fixtures ?'); . 'does not exists in database. Did you add fixtures ?');
} }
$center = static::$kernel->getContainer() $center = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillMainBundle:Center') ->getRepository('ChillMainBundle:Center')
->findOneByName($centerName); ->findOneByName($centerName);
// get scope reachable by both role UPDATE and DELETE // get scope reachable by both role UPDATE and DELETE
$reachableScopesUpdate = static::$kernel->getContainer() $reachableScopesUpdate = self::$kernel->getContainer()
->get('chill.main.security.authorization.helper') ->get('chill.main.security.authorization.helper')
->getReachableScopes( ->getReachableScopes(
$user, $user,
new Role('CHILL_ACTIVITY_UPDATE'), new Role('CHILL_ACTIVITY_UPDATE'),
$center $center
); );
$reachableScopesDelete = static::$kernel->getContainer() $reachableScopesDelete = self::$kernel->getContainer()
->get('chill.main.security.authorization.helper') ->get('chill.main.security.authorization.helper')
->getReachableScopes( ->getReachableScopes(
$user, $user,
@ -364,8 +368,8 @@ class ActivityControllerTest extends WebTestCase
$center $center
); );
$reachableScopesId = array_intersect( $reachableScopesId = array_intersect(
array_map(function ($s) { return $s->getId(); }, $reachableScopesDelete), array_map(static function ($s) { return $s->getId(); }, $reachableScopesDelete),
array_map(function ($s) { return $s->getId(); }, $reachableScopesUpdate) array_map(static function ($s) { return $s->getId(); }, $reachableScopesUpdate)
); );
if (count($reachableScopesId) === 0) { if (count($reachableScopesId) === 0) {
@ -374,7 +378,7 @@ class ActivityControllerTest extends WebTestCase
} }
foreach ($reachableScopesUpdate as $scope) { foreach ($reachableScopesUpdate as $scope) {
if (in_array($scope->getId(), $reachableScopesId)) { if (in_array($scope->getId(), $reachableScopesId, true)) {
$reachableScopes[] = $scope; $reachableScopes[] = $scope;
} }
} }

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonCategoryControllerTest extends WebTestCase final class ActivityReasonCategoryControllerTest extends WebTestCase
{ {
public function testToWrite() public function testToWrite()
{ {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonControllerTest extends WebTestCase final class ActivityReasonControllerTest extends WebTestCase
{ {
public function testToWrite() public function testToWrite()
{ {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityTypeControllerTest extends WebTestCase final class ActivityTypeControllerTest extends WebTestCase
{ {
public function testToWrite() public function testToWrite()
{ {

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Aggregator; namespace Chill\ActivityBundle\Tests\Aggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
@ -17,7 +19,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonAggregatorTest extends AbstractAggregatorTest final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator * @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator
@ -26,9 +28,9 @@ class ActivityReasonAggregatorTest extends AbstractAggregatorTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->aggregator = $container->get('chill.activity.export.reason_aggregator'); $this->aggregator = $container->get('chill.activity.export.reason_aggregator');
@ -57,11 +59,11 @@ class ActivityReasonAggregatorTest extends AbstractAggregatorTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Aggregator; namespace Chill\ActivityBundle\Tests\Aggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
@ -17,7 +19,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityTypeAggregatorTest extends AbstractAggregatorTest final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator * @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator
@ -26,9 +28,9 @@ class ActivityTypeAggregatorTest extends AbstractAggregatorTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->aggregator = $container->get('chill.activity.export.type_aggregator'); $this->aggregator = $container->get('chill.activity.export.type_aggregator');
@ -56,11 +58,11 @@ class ActivityTypeAggregatorTest extends AbstractAggregatorTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Aggregator; namespace Chill\ActivityBundle\Tests\Aggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
@ -17,7 +19,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityUserAggregatorTest extends AbstractAggregatorTest final class ActivityUserAggregatorTest extends AbstractAggregatorTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator * @var \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator
@ -26,9 +28,9 @@ class ActivityUserAggregatorTest extends AbstractAggregatorTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->aggregator = $container->get('chill.activity.export.user_aggregator'); $this->aggregator = $container->get('chill.activity.export.user_aggregator');
@ -56,11 +58,11 @@ class ActivityUserAggregatorTest extends AbstractAggregatorTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Export; namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest; use Chill\MainBundle\Test\Export\AbstractExportTest;
@ -15,7 +17,7 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class CountActivityTest extends AbstractExportTest final class CountActivityTest extends AbstractExportTest
{ {
/** /**
* @var * @var
@ -24,9 +26,9 @@ class CountActivityTest extends AbstractExportTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
/* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
$container = self::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->export = $container->get('chill.activity.export.count_activity'); $this->export = $container->get('chill.activity.export.count_activity');

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Export; namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest; use Chill\MainBundle\Test\Export\AbstractExportTest;
@ -15,7 +17,7 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ListActivityTest extends AbstractExportTest final class ListActivityTest extends AbstractExportTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Export\ListActivity * @var \Chill\ActivityBundle\Export\Export\ListActivity
@ -24,9 +26,9 @@ class ListActivityTest extends AbstractExportTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
/* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
$container = self::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->export = $container->get('chill.activity.export.list_activity'); $this->export = $container->get('chill.activity.export.list_activity');

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Export; namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest; use Chill\MainBundle\Test\Export\AbstractExportTest;
@ -17,7 +19,7 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class StatActivityDurationSumTest extends AbstractExportTest final class StatActivityDurationSumTest extends AbstractExportTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Export\StatActivityDuration * @var \Chill\ActivityBundle\Export\Export\StatActivityDuration
@ -26,9 +28,9 @@ class StatActivityDurationSumTest extends AbstractExportTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
/* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
$container = self::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->export = $container->get('chill.activity.export.sum_activity_duration'); $this->export = $container->get('chill.activity.export.sum_activity_duration');

View File

@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Filter; namespace Chill\ActivityBundle\Tests\Filter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
@ -16,7 +18,7 @@ use Doctrine\Common\Collections\ArrayCollection;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonFilterTest extends AbstractFilterTest final class ActivityReasonFilterTest extends AbstractFilterTest
{ {
/** /**
* @var \Chill\PersonBundle\Export\Filter\GenderFilter * @var \Chill\PersonBundle\Export\Filter\GenderFilter
@ -25,9 +27,9 @@ class ActivityReasonFilterTest extends AbstractFilterTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->filter = $container->get('chill.activity.export.reason_filter'); $this->filter = $container->get('chill.activity.export.reason_filter');
@ -48,11 +50,11 @@ class ActivityReasonFilterTest extends AbstractFilterTest
public function getFormData() public function getFormData()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
$reasons = $em->createQuery('SELECT reason ' $reasons = $em->createQuery('SELECT reason '
@ -69,11 +71,11 @@ class ActivityReasonFilterTest extends AbstractFilterTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

Some files were not shown because too many files have changed in this diff Show More