mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-12 01:34:58 +00:00
Compare commits
230 Commits
phpstan-fi
...
rector-boo
Author | SHA1 | Date | |
---|---|---|---|
ea10565e17
|
|||
c5ec0e77ff
|
|||
2a303c7ba4
|
|||
e935bc20aa
|
|||
4f2355b313
|
|||
48772efd54
|
|||
331443ae12
|
|||
561d069a3e
|
|||
0133e202d2
|
|||
59147b2217
|
|||
a64d75ffc9
|
|||
27dbdbcd96
|
|||
2a3011d358
|
|||
5a1296724b | |||
f483a6f28a | |||
0dfa7f8cf7 | |||
54bb38bcda | |||
e159bde6b1 | |||
4319b0d804
|
|||
322ff32e5d
|
|||
77dc040034
|
|||
23951f1997
|
|||
1be4e43d31
|
|||
7585eff488
|
|||
88b4159ced | |||
782bda0744
|
|||
8d3888068d
|
|||
96ddc73e45
|
|||
b2789099be
|
|||
4eb7d10e45
|
|||
efa475df0f | |||
4edb8bd0c5 | |||
a8977729fe
|
|||
ecac409586
|
|||
df2480c47c
|
|||
97a4c39941
|
|||
c729a14304 | |||
06b7e84270 | |||
1cc80c8e6a
|
|||
c3558beee1
|
|||
44ecad2bca
|
|||
d1bdf41c4c
|
|||
eaea702454 | |||
de4cb1585b | |||
2e2c11a3c1 | |||
1a3d66213b | |||
67e68ac149 | |||
5319991a6f | |||
1198133a7f | |||
1195564adb | |||
4c7a16587b | |||
9c589b9296 | |||
3821bc3a70 | |||
bbddf7813e | |||
4a30f310b8 | |||
d893e3a664 | |||
d1e8e6c18e | |||
896b4cdfe3 | |||
4df6a6fc85 | |||
a272dabcaf | |||
3901fe2d32 | |||
244614a691
|
|||
78858e84f2
|
|||
cc98f64be5 | |||
6e812b54e1
|
|||
83e0a50b57
|
|||
3aac4d5d35
|
|||
23cee274a5
|
|||
aacb54037b | |||
57cb96320c | |||
5a2d80cb4d | |||
2e822a9486 | |||
f376b1af49 | |||
9d1703ccba | |||
ef3b41fa90 | |||
dd621186e8 | |||
1b15abe635 | |||
1965fc55f4 | |||
672418e70a
|
|||
a9290eb3fe | |||
e78eb8789d
|
|||
9911112e08 | |||
c0675aee9b
|
|||
03ee04978c
|
|||
15d68df8c6 | |||
1b2c0ecc87
|
|||
f15017ebd7
|
|||
9a56a1b115
|
|||
11e7f2179c
|
|||
e982e81900
|
|||
e50b02a8c7
|
|||
bea839663f
|
|||
ac4c821290
|
|||
c953da3fd0 | |||
f5d17eb38c
|
|||
8695099819
|
|||
4dbb195b45
|
|||
73f332927d | |||
ef75deda26 | |||
6264a95d62 | |||
26a6169b95 | |||
678defdee7 | |||
f07aaecc3d | |||
0efe43a4d9 | |||
88ccbd450a | |||
62532e0a90
|
|||
73fa585707
|
|||
21a16dcbe2 | |||
b30e966316
|
|||
9696a8194c
|
|||
6749758b46
|
|||
f1ebc089c3
|
|||
813adc70f4 | |||
95984eff6d | |||
c35ca3dbeb
|
|||
3db5b62d57
|
|||
cf1cc937ca
|
|||
14df8fe9ad
|
|||
b1d4334c0f
|
|||
d7737af4f3
|
|||
fe4388c884
|
|||
318599334e
|
|||
7dc07129f8
|
|||
dbcc425f5f
|
|||
77c545344c
|
|||
c13d672db2 | |||
a16244a3f5 | |||
c5fc6d4aad | |||
73af63a2b5 | |||
365df4f3ba | |||
9e6579a176 | |||
8b517f169f | |||
27f13e0dd1 | |||
f07ea3259e | |||
1f4438690e | |||
d62ba56cfe
|
|||
096e2f6e40
|
|||
542b6ccc83
|
|||
610f129cae
|
|||
c0526533cc
|
|||
16dd816a1a
|
|||
744b62184a | |||
5ee0ab5ab8 | |||
4370349f10 | |||
9ff116797a | |||
e528e4f57a | |||
8957f3fed4 | |||
08b3d476a7 | |||
f75f6719bc | |||
6254303392
|
|||
9676975cd8
|
|||
7c4bc8f46a
|
|||
a5f4eabc34 | |||
80a88fc00c | |||
4a62c2e167 | |||
881d76ea1d | |||
55a845fcd6
|
|||
91d21ba939
|
|||
55918bcafb
|
|||
bb05ba0f17
|
|||
8a6b2354bd | |||
bf4e036b7f | |||
eac3471cbb | |||
f653f8fd7a | |||
6d2c6fb6e1 | |||
950ca42f68
|
|||
aea6272c4d
|
|||
25cbb528ec
|
|||
2d013e110a
|
|||
38b50324b2 | |||
d6df16973a | |||
80835dd7c3 | |||
9e63480c70
|
|||
988495df27 | |||
cc62c9cc4a | |||
40924d9d39 | |||
8b505410ca | |||
d535ec6cfb | |||
9029426d03 | |||
9ae2e51819 | |||
68f7a832b4 | |||
3b255e8482
|
|||
af5f27ff49 | |||
5e58d36e79 | |||
8ccce12e54
|
|||
f57555dab4
|
|||
fa481fd795
|
|||
e5c183aa44
|
|||
afd2235254
|
|||
b0ab591cbd
|
|||
d8af7d455e
|
|||
5830c3e177
|
|||
1285100801 | |||
a4e21b7834 | |||
1a44a516c2 | |||
fb9b9b9226 | |||
0ace1c1f6a | |||
7d80507517 | |||
b5ec0919e7 | |||
068311d071 | |||
88eefa698b
|
|||
5756a37178 | |||
c83e8ad9a4 | |||
5bfd2aefe6 | |||
2165e04ec3 | |||
1a8e21a77f | |||
50bb8f10cf | |||
1c673db628 | |||
fa8a2c5cc5 | |||
d46304e229 | |||
4dd81da1ef | |||
882e72b609 | |||
bb7d072cc8 | |||
f76c031ff3 | |||
86b5f4dfac | |||
ded71c5997
|
|||
5ae4eb1bf7
|
|||
2f091a639b | |||
7f9e045d5d | |||
8e3a83de85 | |||
050a4feab5 | |||
de9d53936f | |||
6c1108b8aa | |||
5bbe5af124 | |||
2c5c815f68 | |||
44ef21f940 | |||
68998c9156 | |||
b93b78615b | |||
b2924ede70 | |||
fb51e44e45 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ composer.lock
|
|||||||
docs/build/
|
docs/build/
|
||||||
node_modules/*
|
node_modules/*
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
|
.cache/*
|
||||||
|
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
/.env.local
|
/.env.local
|
||||||
|
@@ -9,7 +9,7 @@ cache:
|
|||||||
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
||||||
# See http://docs.gitlab.com/ee/ci/services/README.html for examples.
|
# See http://docs.gitlab.com/ee/ci/services/README.html for examples.
|
||||||
services:
|
services:
|
||||||
- name: postgis/postgis:12-3.1-alpine
|
- name: postgis/postgis:14-3.3-alpine
|
||||||
alias: db
|
alias: db
|
||||||
- name: redis
|
- name: redis
|
||||||
alias: redis
|
alias: redis
|
||||||
@@ -21,7 +21,7 @@ variables:
|
|||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
# configure database access
|
# configure database access
|
||||||
DATABASE_URL: postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
DATABASE_URL: postgresql://postgres:postgres@db:5432/postgres?serverVersion=14&charset=utf8
|
||||||
# fetch the chill-app using git submodules
|
# fetch the chill-app using git submodules
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
@@ -37,12 +37,11 @@ stages:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
stage: Composer install
|
stage: Composer install
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
before_script:
|
before_script:
|
||||||
- curl -sS https://getcomposer.org/installer | php
|
- composer config -g cache-dir "$(pwd)/.cache"
|
||||||
- php -d memory_limit=2G composer.phar config -g cache-dir "$(pwd)/.cache"
|
|
||||||
script:
|
script:
|
||||||
- php -d memory_limit=2G composer.phar install --optimize-autoloader --no-ansi --no-interaction --no-progress
|
- composer install --optimize-autoloader --no-ansi --no-interaction --no-progress
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .cache/
|
- .cache/
|
||||||
@@ -54,9 +53,12 @@ build:
|
|||||||
|
|
||||||
code_style:
|
code_style:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
script:
|
script:
|
||||||
- bin/grumphp run --tasks=phpcsfixer
|
- php-cs-fixer fix --dry-run -v --show-progress=none
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
@@ -65,30 +67,47 @@ code_style:
|
|||||||
|
|
||||||
phpstan_tests:
|
phpstan_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
script:
|
script:
|
||||||
- bin/grumphp run --tasks=phpstan
|
- bin/phpstan analyze --memory-limit=2G
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- tests/app/vendor/
|
||||||
|
|
||||||
psalm_tests:
|
rector_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
script:
|
script:
|
||||||
- bin/grumphp run --tasks=psalm
|
- bin/rector --dry-run
|
||||||
allow_failure: true
|
cache:
|
||||||
|
paths:
|
||||||
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- tests/app/vendor/
|
||||||
|
|
||||||
|
# psalm_tests:
|
||||||
|
# stage: Tests
|
||||||
|
# image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
|
# script:
|
||||||
|
# - bin/psalm
|
||||||
|
# allow_failure: true
|
||||||
|
# artifacts:
|
||||||
|
# expire_in: 30 min
|
||||||
|
# paths:
|
||||||
|
# - bin
|
||||||
|
# - tests/app/vendor/
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
script:
|
script:
|
||||||
- php tests/app/bin/console doctrine:migrations:migrate -n
|
- php tests/app/bin/console doctrine:migrations:migrate -n
|
||||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
||||||
|
@@ -24,7 +24,7 @@ $config = new PhpCsFixer\Config();
|
|||||||
$config
|
$config
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setCacheFile('.php_cs.cache')
|
->setCacheFile('.cache/php-cs-fixer.cache')
|
||||||
->setUsingCache(true)
|
->setUsingCache(true)
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -82,9 +82,36 @@ $riskyRules = [
|
|||||||
$untilFullSwitchToPhp8 = [
|
$untilFullSwitchToPhp8 = [
|
||||||
'blank_line_between_import_groups' => false,
|
'blank_line_between_import_groups' => false,
|
||||||
'declare_strict_types' => true,
|
'declare_strict_types' => true,
|
||||||
|
'multiline_whitespace_before_semicolons' => false,
|
||||||
|
'phpdoc_no_empty_return' => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
$rules = array_merge(
|
$rules = array_merge(
|
||||||
|
[
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'@PhpCsFixer:risky' => false,
|
||||||
|
'@Symfony' => false,
|
||||||
|
'@Symfony:risky' => false,
|
||||||
|
'ordered_class_elements' => [
|
||||||
|
'order' => [
|
||||||
|
'use_trait',
|
||||||
|
'constant_public',
|
||||||
|
'constant_protected',
|
||||||
|
'constant_private',
|
||||||
|
'property_public',
|
||||||
|
'property_protected',
|
||||||
|
'property_private',
|
||||||
|
'construct',
|
||||||
|
'destruct',
|
||||||
|
'magic',
|
||||||
|
'phpunit',
|
||||||
|
'method_public',
|
||||||
|
'method_protected',
|
||||||
|
'method_private',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
]
|
||||||
|
],
|
||||||
$rules,
|
$rules,
|
||||||
$riskyRules,
|
$riskyRules,
|
||||||
$untilFullSwitchToPhp8,
|
$untilFullSwitchToPhp8,
|
||||||
|
@@ -75,6 +75,7 @@
|
|||||||
"phpunit/phpunit": ">= 7.5",
|
"phpunit/phpunit": ">= 7.5",
|
||||||
"psalm/plugin-phpunit": "^0.18.4",
|
"psalm/plugin-phpunit": "^0.18.4",
|
||||||
"psalm/plugin-symfony": "^4.0.2",
|
"psalm/plugin-symfony": "^4.0.2",
|
||||||
|
"rector/rector": "^0.15.23",
|
||||||
"symfony/debug-bundle": "^5.1",
|
"symfony/debug-bundle": "^5.1",
|
||||||
"symfony/dotenv": "^4.4",
|
"symfony/dotenv": "^4.4",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
|
@@ -129,12 +129,12 @@ This script will :
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
In some cases it can happen that an old image (chill_base_php or chill_php) stored in the docker cache will make the script fail. To solve this problem you have to delete the image and the container, before the make init :
|
In some cases it can happen that an old image (chill_base_php82 or chill_php82) stored in the docker cache will make the script fail. To solve this problem you have to delete the image and the container, before the make init :
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
docker-compose images php
|
docker-compose images php
|
||||||
docker rmi -f chill_php:prod
|
docker rmi -f chill_php82:prod
|
||||||
docker-compose rm php
|
docker-compose rm php
|
||||||
|
|
||||||
|
|
||||||
|
18
package.json
18
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "chill",
|
"name": "chill",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@alexlafroscia/yaml-merge": "^4.0.0",
|
"@alexlafroscia/yaml-merge": "^4.0.0",
|
||||||
"@apidevtools/swagger-cli": "^4.0.4",
|
"@apidevtools/swagger-cli": "^4.0.4",
|
||||||
"@babel/core": "^7.20.5",
|
"@babel/core": "^7.20.5",
|
||||||
@@ -34,12 +34,12 @@
|
|||||||
"webpack-cli": "^5.0.1"
|
"webpack-cli": "^5.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullcalendar/core": "^5.11.0",
|
"@fullcalendar/core": "^6.1.4",
|
||||||
"@fullcalendar/daygrid": "^5.11.0",
|
"@fullcalendar/daygrid": "^6.1.4",
|
||||||
"@fullcalendar/interaction": "^5.11.0",
|
"@fullcalendar/interaction": "^6.1.4",
|
||||||
"@fullcalendar/list": "^5.11.0",
|
"@fullcalendar/list": "^6.1.4",
|
||||||
"@fullcalendar/timegrid": "^5.11.0",
|
"@fullcalendar/timegrid": "^6.1.4",
|
||||||
"@fullcalendar/vue3": "^5.11.1",
|
"@fullcalendar/vue3": "^6.1.4",
|
||||||
"@popperjs/core": "^2.9.2",
|
"@popperjs/core": "^2.9.2",
|
||||||
"dropzone": "^5.7.6",
|
"dropzone": "^5.7.6",
|
||||||
"es6-promise": "^4.2.8",
|
"es6-promise": "^4.2.8",
|
||||||
|
@@ -235,11 +235,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to method Chill\\\\MainBundle\\\\Entity\\\\Address\\:\\:getPostcode\\(\\) with incorrect case\\: getPostCode$#"
|
|
||||||
count: 6
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Only booleans are allowed in a negated boolean, null given\\.$#"
|
message: "#^Only booleans are allowed in a negated boolean, null given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -10,41 +10,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php
|
path: src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\) of method Chill\\\\ActivityBundle\\\\Service\\\\DocGenerator\\\\ActivityContext\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\) of method Chill\\\\ActivityBundle\\\\Service\\\\DocGenerator\\\\ActivityContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\ActivityReason\\) of method Chill\\\\ActivityBundle\\\\Templating\\\\Entity\\\\ActivityReasonRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Return type \\(array\\<array\\<string\\>\\>\\) of method Chill\\\\AsideActivityBundle\\\\Security\\\\AsideActivityVoter\\:\\:getRolesWithHierarchy\\(\\) should be covariant with return type \\(array\\<string, array\\<int, string\\>\\>\\) of method Chill\\\\MainBundle\\\\Security\\\\ProvideRoleHierarchyInterface\\:\\:getRolesWithHierarchy\\(\\)$#"
|
message: "#^Return type \\(array\\<array\\<string\\>\\>\\) of method Chill\\\\AsideActivityBundle\\\\Security\\\\AsideActivityVoter\\:\\:getRolesWithHierarchy\\(\\) should be covariant with return type \\(array\\<string, array\\<int, string\\>\\>\\) of method Chill\\\\MainBundle\\\\Security\\\\ProvideRoleHierarchyInterface\\:\\:getRolesWithHierarchy\\(\\)$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php
|
path: src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$asideActivityCategory \\(Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\) of method Chill\\\\AsideActivityBundle\\\\Templating\\\\Entity\\\\CategoryRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$asideActivityCategory \\(Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\) of method Chill\\\\AsideActivityBundle\\\\Templating\\\\Entity\\\\CategoryRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$asideActivityCategory \\(Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\) of method Chill\\\\AsideActivityBundle\\\\Templating\\\\Entity\\\\CategoryRender\\:\\:supports\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:supports\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$criteria \\(array\\<string, mixed\\>\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepository\\:\\:findBy\\(\\) should be contravariant with parameter \\$criteria \\(array\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepositoryInterface\\:\\:findBy\\(\\)$#"
|
message: "#^Parameter \\#1 \\$criteria \\(array\\<string, mixed\\>\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepository\\:\\:findBy\\(\\) should be contravariant with parameter \\$criteria \\(array\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepositoryInterface\\:\\:findBy\\(\\)$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -80,70 +50,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php
|
path: src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:getFormData\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:getFormData\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:hasPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:hasPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$contextGenerationData \\(array\\{mainPerson\\?\\: Chill\\\\PersonBundle\\\\Entity\\\\Person, thirdParty\\?\\: Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty, title\\: string\\}\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:getData\\(\\) should be contravariant with parameter \\$contextGenerationData \\(array\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:getData\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$contextGenerationData \\(array\\{mainPerson\\?\\: Chill\\\\PersonBundle\\\\Entity\\\\Person, thirdParty\\?\\: Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty, title\\: string\\}\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:getData\\(\\) should be contravariant with parameter \\$contextGenerationData \\(array\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:getData\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#4 \\$contextGenerationData \\(array\\{mainPerson\\?\\: Chill\\\\PersonBundle\\\\Entity\\\\Person, thirdParty\\?\\: Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty, title\\: string\\}\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$contextGenerationData \\(array\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#4 \\$contextGenerationData \\(array\\{mainPerson\\?\\: Chill\\\\PersonBundle\\\\Entity\\\\Person, thirdParty\\?\\: Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty, title\\: string\\}\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$contextGenerationData \\(array\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:getData\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:getData\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:getFormData\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:getFormData\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:hasPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:hasPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContextInterface\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Return type \\(int\\|void\\|null\\) of method Chill\\\\CustomFieldsBundle\\\\Command\\\\CreateFieldsOnGroupCommand\\:\\:execute\\(\\) should be covariant with return type \\(int\\) of method Symfony\\\\Component\\\\Console\\\\Command\\\\Command\\:\\:execute\\(\\)$#"
|
message: "#^Return type \\(int\\|void\\|null\\) of method Chill\\\\CustomFieldsBundle\\\\Command\\\\CreateFieldsOnGroupCommand\\:\\:execute\\(\\) should be covariant with return type \\(int\\) of method Symfony\\\\Component\\\\Console\\\\Command\\\\Command\\:\\:execute\\(\\)$#"
|
||||||
@@ -505,20 +411,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\CommentRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\CommentRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\MainBundle\\\\Entity\\\\User\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\UserRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$value \\(string\\) of method Chill\\\\MainBundle\\\\Validation\\\\Validator\\\\ValidPhonenumber\\:\\:validate\\(\\) should be contravariant with parameter \\$value \\(mixed\\) of method Symfony\\\\Component\\\\Validator\\\\ConstraintValidatorInterface\\:\\:validate\\(\\)$#"
|
message: "#^Parameter \\#1 \\$value \\(string\\) of method Chill\\\\MainBundle\\\\Validation\\\\Validator\\\\ValidPhonenumber\\:\\:validate\\(\\) should be contravariant with parameter \\$value \\(mixed\\) of method Symfony\\\\Component\\\\Validator\\\\ConstraintValidatorInterface\\:\\:validate\\(\\)$#"
|
||||||
@@ -550,11 +442,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValidValidator.php
|
path: src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValidValidator.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Return type \\(int\\|void\\|null\\) of method Chill\\\\PersonBundle\\\\Command\\\\ImportPeopleFromCSVCommand\\:\\:execute\\(\\) should be covariant with return type \\(int\\) of method Symfony\\\\Component\\\\Console\\\\Command\\\\Command\\:\\:execute\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#3 \\$query \\(Doctrine\\\\ORM\\\\QueryBuilder\\) of method Chill\\\\PersonBundle\\\\Controller\\\\HouseholdCompositionTypeApiController\\:\\:customizeQuery\\(\\) should be contravariant with parameter \\$query \\(mixed\\) of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\AbstractCRUDController\\:\\:customizeQuery\\(\\)$#"
|
message: "#^Parameter \\#3 \\$query \\(Doctrine\\\\ORM\\\\QueryBuilder\\) of method Chill\\\\PersonBundle\\\\Controller\\\\HouseholdCompositionTypeApiController\\:\\:customizeQuery\\(\\) should be contravariant with parameter \\$query \\(mixed\\) of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\AbstractCRUDController\\:\\:customizeQuery\\(\\)$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -840,90 +727,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php
|
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\AccompanyingPeriodContext\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\AccompanyingPeriodContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluation\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\AccompanyingPeriodWorkEvaluationContext\\:\\:getData\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:getData\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluation\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\AccompanyingPeriodWorkEvaluationContext\\:\\:getFormData\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:getFormData\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluation\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\AccompanyingPeriodWorkEvaluationContext\\:\\:hasPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:hasPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluation\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\AccompanyingPeriodWorkEvaluationContext\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\PersonContext\\:\\:hasPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:hasPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\PersonContext\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\PersonContext\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\PersonContextInterface\\:\\:hasPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:hasPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\PersonContextInterface\\:\\:buildPublicForm\\(\\) should be contravariant with parameter \\$entity \\(mixed\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextWithPublicFormInterface\\:\\:buildPublicForm\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Service\\\\DocGenerator\\\\PersonContextInterface\\:\\:storeGenerated\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\DocGeneratorBundle\\\\Context\\\\DocGeneratorContextInterface\\:\\:storeGenerated\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\ClosingMotive\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$person \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\PersonRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$person \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\PersonRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$socialIssue \\(Chill\\\\PersonBundle\\\\Entity\\\\SocialWork\\\\SocialIssue\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\SocialIssueRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$socialIssue \\(Chill\\\\PersonBundle\\\\Entity\\\\SocialWork\\\\SocialIssue\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\SocialIssueRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$object \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationDocument\\) of method Chill\\\\PersonBundle\\\\Workflow\\\\AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler\\:\\:getRelatedObjects\\(\\) should be contravariant with parameter \\$object \\(object\\) of method Chill\\\\MainBundle\\\\Workflow\\\\EntityWorkflowHandlerInterface\\:\\:getRelatedObjects\\(\\)$#"
|
message: "#^Parameter \\#1 \\$object \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationDocument\\) of method Chill\\\\PersonBundle\\\\Workflow\\\\AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler\\:\\:getRelatedObjects\\(\\) should be contravariant with parameter \\$object \\(object\\) of method Chill\\\\MainBundle\\\\Workflow\\\\EntityWorkflowHandlerInterface\\:\\:getRelatedObjects\\(\\)$#"
|
||||||
@@ -980,26 +783,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
|
path: src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$thirdParty \\(Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\) of method Chill\\\\ThirdPartyBundle\\\\Serializer\\\\Normalizer\\\\ThirdPartyNormalizer\\:\\:normalize\\(\\) should be contravariant with parameter \\$object \\(mixed\\) of method Symfony\\\\Component\\\\Serializer\\\\Normalizer\\\\NormalizerInterface\\:\\:normalize\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#2 \\$format \\(string\\) of method Chill\\\\ThirdPartyBundle\\\\Serializer\\\\Normalizer\\\\ThirdPartyNormalizer\\:\\:supportsNormalization\\(\\) should be contravariant with parameter \\$format \\(string\\|null\\) of method Symfony\\\\Component\\\\Serializer\\\\Normalizer\\\\NormalizerInterface\\:\\:supportsNormalization\\(\\)$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\) of method Chill\\\\ThirdPartyBundle\\\\Templating\\\\Entity\\\\ThirdPartyRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\) of method Chill\\\\ThirdPartyBundle\\\\Templating\\\\Entity\\\\ThirdPartyRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$document \\(Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\) of method Chill\\\\WopiBundle\\\\Service\\\\Wopi\\\\ChillDocumentManager\\:\\:getBasename\\(\\) should be contravariant with parameter \\$document \\(ChampsLibres\\\\WopiLib\\\\Contract\\\\Entity\\\\Document\\) of method ChampsLibres\\\\WopiLib\\\\Contract\\\\Service\\\\DocumentManagerInterface\\:\\:getBasename\\(\\)$#"
|
message: "#^Parameter \\#1 \\$document \\(Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\) of method Chill\\\\WopiBundle\\\\Service\\\\Wopi\\\\ChillDocumentManager\\:\\:getBasename\\(\\) should be contravariant with parameter \\$document \\(ChampsLibres\\\\WopiLib\\\\Contract\\\\Entity\\\\Document\\) of method ChampsLibres\\\\WopiLib\\\\Contract\\\\Service\\\\DocumentManagerInterface\\:\\:getBasename\\(\\)$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -175,21 +175,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php
|
path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to method getCategory\\(\\) on an unknown class Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to method getName\\(\\) on an unknown class Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\ActivityBundle\\\\Templating\\\\Entity\\\\ActivityReasonRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\$context of method Chill\\\\ActivityBundle\\\\Timeline\\\\TimelineActivityProvider\\:\\:getEntityTemplate\\(\\) has invalid type Chill\\\\MainBundle\\\\Timeline\\\\type\\.$#"
|
message: "#^Parameter \\$context of method Chill\\\\ActivityBundle\\\\Timeline\\\\TimelineActivityProvider\\:\\:getEntityTemplate\\(\\) has invalid type Chill\\\\MainBundle\\\\Timeline\\\\type\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -255,11 +240,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php
|
path: src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\:\\:getName\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to method DateTimeImmutable\\:\\:add\\(\\) on a separate line has no effect\\.$#"
|
message: "#^Call to method DateTimeImmutable\\:\\:add\\(\\) on a separate line has no effect\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -275,11 +255,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
|
path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Instanceof between Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory and Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory will always evaluate to true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Static call to instance method Chill\\\\BudgetBundle\\\\Calculator\\\\CalculatorInterface\\:\\:getAlias\\(\\)\\.$#"
|
message: "#^Static call to instance method Chill\\\\BudgetBundle\\\\Calculator\\\\CalculatorInterface\\:\\:getAlias\\(\\)\\.$#"
|
||||||
count: 3
|
count: 3
|
||||||
@@ -430,11 +405,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php
|
path: src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\BudgetBundle\\\\Templating\\\\BudgetElementTypeRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Chill\\\\CalendarBundle\\\\Command\\\\AzureGrantAdminConsentAndAcquireToken\\:\\:\\$clientRegistry is never read, only written\\.$#"
|
message: "#^Property Chill\\\\CalendarBundle\\\\Command\\\\AzureGrantAdminConsentAndAcquireToken\\:\\:\\$clientRegistry is never read, only written\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -500,11 +470,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillCalendarBundle/Entity/Calendar.php
|
path: src/Bundle/ChillCalendarBundle/Entity/Calendar.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\CalendarBundle\\\\Entity\\\\Calendar\\:\\:getUsers\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection&iterable\\<Chill\\\\MainBundle\\\\Entity\\\\User\\> but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), Chill\\\\MainBundle\\\\Entity\\\\User\\|null\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Entity/Calendar.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Chill\\\\CalendarBundle\\\\Entity\\\\CalendarRange\\:\\:\\$id is never written, only read\\.$#"
|
message: "#^Property Chill\\\\CalendarBundle\\\\Entity\\\\CalendarRange\\:\\:\\$id is never written, only read\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -570,16 +535,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php
|
path: src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Default value of the parameter \\#3 \\$contextGenerationData \\(array\\{\\}\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:getData\\(\\) is incompatible with type array\\{mainPerson\\?\\: Chill\\\\PersonBundle\\\\Entity\\\\Person, thirdParty\\?\\: Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty, title\\: string\\}\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Offset 'trackDatetime' does not exist on array\\{askMainPerson\\: bool, mainPersonLabel\\: string\\|null, askThirdParty\\: bool, thirdPartyLabel\\: string\\|null, trackDateTime\\: bool\\}\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:ask\\(\\)\\.$#"
|
message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:ask\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -1155,11 +1110,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
|
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Property Chill\\\\DocGeneratorBundle\\\\Controller\\\\DocGeneratorTemplateController\\:\\:\\$client is never read, only written\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Strict comparison using \\=\\=\\= between null and int will always evaluate to false\\.$#"
|
message: "#^Strict comparison using \\=\\=\\= between null and int will always evaluate to false\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -1230,11 +1180,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocStoreBundle/Entity/Document.php
|
path: src/Bundle/ChillDocStoreBundle/Entity/Document.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\:\\:getCreationDate\\(\\) should return DateTime but returns DateTimeInterface\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\:\\:\\$id is never written, only read\\.$#"
|
message: "#^Property Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\:\\:\\$id is never written, only read\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -2120,15 +2065,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Entity/Country.php
|
path: src/Bundle/ChillMainBundle/Entity/Country.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\:\\:getUserId\\(\\) has invalid return type Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\interger\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\:\\:getUserId\\(\\) should return Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\interger but returns int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Chill\\\\MainBundle\\\\Entity\\\\GeographicalUnit\\:\\:\\$geom is unused\\.$#"
|
message: "#^Property Chill\\\\MainBundle\\\\Entity\\\\GeographicalUnit\\:\\:\\$geom is unused\\.$#"
|
||||||
@@ -2530,11 +2466,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php
|
path: src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Center\\\\GroupingCenterInterface\\:\\:getName\\(\\)\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Chill\\\\MainBundle\\\\Form\\\\Type\\\\Select2CountryType\\:\\:\\$requestStack is never read, only written\\.$#"
|
message: "#^Property Chill\\\\MainBundle\\\\Form\\\\Type\\\\Select2CountryType\\:\\:\\$requestStack is never read, only written\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -2860,11 +2791,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Strict comparison using \\=\\=\\= between null and Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\interger will always evaluate to false\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\MainBundle\\\\Serializer\\\\Normalizer\\\\DateNormalizer\\:\\:normalize\\(\\) should return array\\|ArrayObject\\|bool\\|float\\|int\\|string\\|null but return statement is missing\\.$#"
|
message: "#^Method Chill\\\\MainBundle\\\\Serializer\\\\Normalizer\\\\DateNormalizer\\:\\:normalize\\(\\) should return array\\|ArrayObject\\|bool\\|float\\|int\\|string\\|null but return statement is missing\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -2930,46 +2856,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
|
path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^PHPDoc tag @param for parameter \\$addr with type mixed is not subtype of native type Chill\\\\MainBundle\\\\Entity\\\\Address\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^PHPDoc tag @param has invalid value \\(Address addr\\)\\: Unexpected token \"addr\", expected variable at offset 26$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Strict comparison using \\!\\=\\= between null and Chill\\\\MainBundle\\\\Entity\\\\the will always evaluate to true\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Strict comparison using \\=\\=\\= between Chill\\\\MainBundle\\\\Entity\\\\the and 'FR' will always evaluate to false\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderInterface.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^If condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\UserRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^PHPDoc tag @return has invalid value \\(array\\<'to'\\: DateTimeImmutable, 'from'\\: DateTimeImmutable\\>\\)\\: Unexpected token \"\\:\", expected '\\>' at offset 29$#"
|
message: "#^PHPDoc tag @return has invalid value \\(array\\<'to'\\: DateTimeImmutable, 'from'\\: DateTimeImmutable\\>\\)\\: Unexpected token \"\\:\", expected '\\>' at offset 29$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -3140,111 +3026,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
|
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$force\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$headers\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$helperSet\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$input\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$output\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$person\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$rawHeaders\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$row\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:\\:\\$skipPerson\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:createQuery\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to method buildForm\\(\\) on an unknown class Chill\\\\CustomFieldsBundle\\\\Service\\\\CustomFieldInterface\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Elseif branch is unreachable because previous condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Instanceof between \\*NEVER\\* and Symfony\\\\Component\\\\Form\\\\ChoiceList\\\\View\\\\ChoiceGroupView will always evaluate to false\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Instanceof between Symfony\\\\Component\\\\Form\\\\ChoiceList\\\\View\\\\ChoiceView and Symfony\\\\Component\\\\Form\\\\ChoiceList\\\\View\\\\ChoiceView will always evaluate to true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Command\\\\ImportPeopleFromCSVCommand\\:\\:processTextType\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Command\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Symfony\\\\Component\\\\Console\\\\Helper\\\\Table\\:\\:render\\(\\) invoked with 1 parameter, 0 required\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^PHPDoc tag @var above foreach loop does not specify variable name\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$value of method Chill\\\\PersonBundle\\\\Command\\\\ImportPeopleFromCSVCommand\\:\\:processTextType\\(\\) has invalid type Chill\\\\PersonBundle\\\\Command\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Strict comparison using \\=\\=\\= between false and false will always evaluate to true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^PHPDoc tag @var for property Chill\\\\PersonBundle\\\\Command\\\\ImportSocialWorkMetadata\\:\\:\\$importer with type Psr\\\\Log\\\\LoggerInterface is not subtype of native type Chill\\\\PersonBundle\\\\Service\\\\Import\\\\ChillImporter\\.$#"
|
message: "#^PHPDoc tag @var for property Chill\\\\PersonBundle\\\\Command\\\\ImportSocialWorkMetadata\\:\\:\\$importer with type Psr\\\\Log\\\\LoggerInterface is not subtype of native type Chill\\\\PersonBundle\\\\Service\\\\Import\\\\ChillImporter\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -3505,31 +3286,12 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getAvailablePersonLocation\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection&iterable\\<Chill\\\\PersonBundle\\\\Entity\\\\Person\\> but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), Chill\\\\PersonBundle\\\\Entity\\\\Person\\|null\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getComments\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getCreatedAt\\(\\) should return DateTime\\|null but returns DateTimeInterface\\|null\\.$#"
|
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getCreatedAt\\(\\) should return DateTime\\|null but returns DateTimeInterface\\|null\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getOpenParticipations\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getParticipationsContainsPerson\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getRecursiveSocialActions\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Entity\\\\SocialAction\\.$#"
|
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:getRecursiveSocialActions\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Entity\\\\SocialAction\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -3655,26 +3417,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\:\\:getCurrentMembersIds\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), int\\|null\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\:\\:getCurrentPersons\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), Chill\\\\PersonBundle\\\\Entity\\\\Person\\|null\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\:\\:getMembersDuringMembership\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection&iterable\\<Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\HouseholdMember\\> but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\:\\:getMembersOnRange\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^PHPDoc tag @return with type array\\<Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\HouseholdMember\\> is incompatible with native type Doctrine\\\\Common\\\\Collections\\\\Collection\\.$#"
|
message: "#^PHPDoc tag @return with type array\\<Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\HouseholdMember\\> is incompatible with native type Doctrine\\\\Common\\\\Collections\\\\Collection\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -3960,21 +3702,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php
|
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Property Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingCourseFilters\\\\ReferrerFilter\\:\\:\\$userRender is never read, only written\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingCourseFilters\\\\SocialActionFilter\\:\\:\\$translatableStringHelper is never read, only written\\.$#"
|
message: "#^Property Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingCourseFilters\\\\SocialActionFilter\\:\\:\\$translatableStringHelper is never read, only written\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php
|
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingCourseFilters\\\\UserJobFilter\\:\\:getUserJob\\(\\) is unused\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingCourseFilters\\\\UserScopeFilter\\:\\:getUserMainScope\\(\\) is unused\\.$#"
|
message: "#^Method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingCourseFilters\\\\UserScopeFilter\\:\\:getUserMainScope\\(\\) is unused\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -4140,11 +3872,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php
|
path: src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Dead catch \\- Exception is never thrown in the try block\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but returns array\\<string, array\\<bool\\|Chill\\\\PersonBundle\\\\Entity\\\\Person\\>\\>\\.$#"
|
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but returns array\\<string, array\\<bool\\|Chill\\\\PersonBundle\\\\Entity\\\\Person\\>\\>\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -4320,11 +4047,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
|
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), Chill\\\\PersonBundle\\\\Entity\\\\Person\\|null\\>\\:\\:add\\(\\)\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to function array_key_exists\\(\\) with 'category' and array will always evaluate to true\\.$#"
|
message: "#^Call to function array_key_exists\\(\\) with 'category' and array will always evaluate to true\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -4375,26 +4097,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php
|
path: src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to method getTitle\\(\\) on an unknown class Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ResourceKindRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\$socialAction of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\SocialActionRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to method getId\\(\\) on an unknown class ChillPersonBundle\\:AccompanyingPeriod\\.$#"
|
message: "#^Call to method getId\\(\\) on an unknown class ChillPersonBundle\\:AccompanyingPeriod\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -5030,11 +4732,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillThirdPartyBundle/DependencyInjection/Configuration.php
|
path: src/Bundle/ChillThirdPartyBundle/DependencyInjection/Configuration.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\:\\:getActiveChildren\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\Collection but returns Doctrine\\\\Common\\\\Collections\\\\ReadableCollection\\<\\(int\\|string\\), mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^PHPDoc tag @return with type DateTime\\|null is not subtype of native type DateTimeImmutable\\|null\\.$#"
|
message: "#^PHPDoc tag @return with type DateTime\\|null is not subtype of native type DateTimeImmutable\\|null\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -25,21 +25,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php
|
path: src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$name of method Chill\\\\MainBundle\\\\Entity\\\\Country\\:\\:setName\\(\\) expects string, array\\<string, string\\> given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$title of method Chill\\\\MainBundle\\\\Entity\\\\LocationType\\:\\:setTitle\\(\\) expects array, string given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$status of method Chill\\\\CalendarBundle\\\\Entity\\\\Invite\\:\\:setStatus\\(\\) expects string, array\\<string, string\\> given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRemovedMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRemovedMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -440,21 +425,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
|
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$mobilenumber of method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:setMobilenumber\\(\\) expects libphonenumber\\\\PhoneNumber\\|null, string given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$phonenumber of method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:setPhonenumber\\(\\) expects libphonenumber\\\\PhoneNumber\\|null, string given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -570,11 +540,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
|
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#1 \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderString\\(\\) expects Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\ClosingMotive, Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$entityName of method Doctrine\\\\ORM\\\\EntityManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillPersonBundle\\:AccompanyingPeriod\\>, string given\\.$#"
|
message: "#^Parameter \\#1 \\$entityName of method Doctrine\\\\ORM\\\\EntityManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillPersonBundle\\:AccompanyingPeriod\\>, string given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -1,10 +1,5 @@
|
|||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
-
|
|
||||||
message: "#^Variable property access on \\$this\\(Chill\\\\ActivityBundle\\\\Entity\\\\ActivityType\\)\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillActivityBundle/Entity/ActivityType.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
|
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -20,11 +15,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
|
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Variable method call on object\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot unset offset '_token' on array\\{formatter\\: mixed, export\\: mixed, centers\\: mixed, alias\\: string\\}\\.$#"
|
message: "#^Cannot unset offset '_token' on array\\{formatter\\: mixed, export\\: mixed, centers\\: mixed, alias\\: string\\}\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -50,46 +40,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
|
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Variable \\$message on left side of \\?\\? always exists and is not nullable\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Variable \\$sqls on left side of \\?\\? always exists and is not nullable\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Class Chill\\\\PersonBundle\\\\Entity\\\\Person constructor invoked with 1 parameter, 0 required\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Variable \\$street1Value might not be defined\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Variable method call on mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
|
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
|
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
|
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -32,14 +32,6 @@ parameters:
|
|||||||
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
|
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
|
||||||
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Parameter \\$centerResolverDispatcher of method Chill\\\\ActivityBundle\\\\Repository\\\\ActivityACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
#^Parameter \\$centerResolverDispatcher of method Chill\\\\ActivityBundle\\\\Repository\\\\ActivityACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
@@ -199,14 +191,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
|
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Class Chill\\\\MainBundle\\\\Entity\\\\User implements deprecated interface Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\AdvancedUserInterface\\:
|
|
||||||
since Symfony 4\\.1$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Entity/User.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
@@ -329,22 +313,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Actions/ActionEvent.php
|
path: src/Bundle/ChillPersonBundle/Actions/ActionEvent.php
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\:
|
|
||||||
since 1\\.1 use `getOpenedAccompanyingPeriod instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
|
||||||
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
|
#^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
|
||||||
@@ -541,11 +509,3 @@ parameters:
|
|||||||
count: 3
|
count: 3
|
||||||
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
|
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
|
||||||
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php
|
|
||||||
|
|
||||||
|
@@ -100,11 +100,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php
|
path: src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Chill\\\\EventBundle\\\\Entity\\\\Participation\\:\\:offsetGet\\(\\) should return mixed but return statement is missing\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillEventBundle/Entity/Participation.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
|
||||||
@@ -315,11 +310,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
|
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
|
||||||
count: 6
|
|
||||||
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: 1
|
count: 1
|
||||||
@@ -340,21 +330,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
|
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
|
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
|
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.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
|
||||||
|
@@ -2,6 +2,7 @@ parameters:
|
|||||||
level: 5
|
level: 5
|
||||||
paths:
|
paths:
|
||||||
- src/
|
- src/
|
||||||
|
tmpDir: .cache/
|
||||||
reportUnmatchedIgnoredErrors: false
|
reportUnmatchedIgnoredErrors: false
|
||||||
excludePaths:
|
excludePaths:
|
||||||
- .php_cs*
|
- .php_cs*
|
||||||
|
25
rector.php
Normal file
25
rector.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
||||||
|
use Rector\Config\RectorConfig;
|
||||||
|
use Rector\Set\ValueObject\LevelSetList;
|
||||||
|
|
||||||
|
return static function (RectorConfig $rectorConfig): void {
|
||||||
|
$rectorConfig->paths([
|
||||||
|
__DIR__ . '/docs',
|
||||||
|
__DIR__ . '/src',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
||||||
|
$rectorConfig->cacheDirectory(__DIR__.'/.cache/rector');
|
||||||
|
|
||||||
|
// register a single rule
|
||||||
|
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
||||||
|
|
||||||
|
// define sets of rules
|
||||||
|
// $rectorConfig->sets([
|
||||||
|
// LevelSetList::UP_TO_PHP_74
|
||||||
|
// ]);
|
||||||
|
};
|
@@ -257,12 +257,10 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
/**
|
/**
|
||||||
* Add a social issue.
|
* Add a social issue.
|
||||||
*
|
*
|
||||||
* Note: the social issue consistency (the fact that only yougest social issues
|
* Note: the social issue consistency (the fact that only youngest social issues
|
||||||
* are kept) is processed by an entity listener:
|
* are kept) is processed by an entity listener:
|
||||||
*
|
*
|
||||||
* @see{\Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodSocialIssueConsistencyEntityListener}
|
* @see{\Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodSocialIssueConsistencyEntityListener}
|
||||||
*
|
|
||||||
* @return $this
|
|
||||||
*/
|
*/
|
||||||
public function addSocialIssue(SocialIssue $socialIssue): self
|
public function addSocialIssue(SocialIssue $socialIssue): self
|
||||||
{
|
{
|
||||||
@@ -270,6 +268,10 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
$this->socialIssues[] = $socialIssue;
|
$this->socialIssues[] = $socialIssue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->getAccompanyingPeriod() !== null) {
|
||||||
|
$this->getAccompanyingPeriod()->addSocialIssue($socialIssue);
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,6 +552,10 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
{
|
{
|
||||||
$this->accompanyingPeriod = $accompanyingPeriod;
|
$this->accompanyingPeriod = $accompanyingPeriod;
|
||||||
|
|
||||||
|
foreach ($this->getSocialIssues() as $issue) {
|
||||||
|
$this->accompanyingPeriod->addSocialIssue($issue);
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -380,6 +380,7 @@ class ActivityType
|
|||||||
throw new InvalidArgumentException('Field "' . $field . '" not found');
|
throw new InvalidArgumentException('Field "' . $field . '" not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
return $this->{$property};
|
return $this->{$property};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,6 +539,7 @@ class ActivityType
|
|||||||
throw new InvalidArgumentException('Field "' . $field . '" not found');
|
throw new InvalidArgumentException('Field "' . $field . '" not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
return self::FIELD_REQUIRED === $this->{$property};
|
return self::FIELD_REQUIRED === $this->{$property};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,6 +551,7 @@ class ActivityType
|
|||||||
throw new InvalidArgumentException('Field "' . $field . '" not found');
|
throw new InvalidArgumentException('Field "' . $field . '" not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @phpstan-ignore-next-line */
|
||||||
return self::FIELD_INVISIBLE !== $this->{$property};
|
return self::FIELD_INVISIBLE !== $this->{$property};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
|
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class LocationFilter implements FilterInterface
|
||||||
|
{
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
$qb->andWhere(
|
||||||
|
$qb->expr()->in('activity.location', ':location')
|
||||||
|
);
|
||||||
|
|
||||||
|
$qb->setParameter('location', $data['accepted_location']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn(): string
|
||||||
|
{
|
||||||
|
return Declarations::ACTIVITY_ACP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
$builder->add('accepted_location', PickUserLocationType::class, [
|
||||||
|
'multiple' => true,
|
||||||
|
'label' => 'pick location',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function describeAction($data, $format = 'string'): array
|
||||||
|
{
|
||||||
|
$locations = [];
|
||||||
|
|
||||||
|
foreach ($data['accepted_location'] as $location) {
|
||||||
|
$locations[] = $location->getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['Filtered activity by location: only %locations%', [
|
||||||
|
'%locations%' => implode(', ', $locations),
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle(): string
|
||||||
|
{
|
||||||
|
return 'Filter activity by location';
|
||||||
|
}
|
||||||
|
}
|
@@ -18,6 +18,9 @@ use Knp\Menu\MenuItem;
|
|||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements LocalMenuBuilderInterface<array{accompanyingCourse: AccompanyingPeriod}>
|
||||||
|
*/
|
||||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected Security $security;
|
protected Security $security;
|
||||||
|
@@ -15,6 +15,9 @@ 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements LocalMenuBuilderInterface<array>
|
||||||
|
*/
|
||||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
private Security $security;
|
private Security $security;
|
||||||
|
@@ -13,11 +13,15 @@ namespace Chill\ActivityBundle\Menu;
|
|||||||
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class PersonMenuBuilder implements LocalMenuBuilderInterface
|
/**
|
||||||
|
* @implements LocalMenuBuilderInterface<array{person: Person}>
|
||||||
|
*/
|
||||||
|
final class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var AuthorizationCheckerInterface
|
* @var AuthorizationCheckerInterface
|
||||||
|
@@ -88,3 +88,11 @@ div.flex-bloc.concerned-groups {
|
|||||||
font-size: 120%;
|
font-size: 120%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// DOCUMENT LIST IN ACTIVITY ITEM
|
||||||
|
li.document-list-item {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0.3rem;
|
||||||
|
}
|
||||||
|
@@ -68,7 +68,7 @@
|
|||||||
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
||||||
<div class="wl-col list">
|
<div class="wl-col list">
|
||||||
<p class="wl-item">
|
<p class="wl-item">
|
||||||
{{ activity.user|chill_entity_render_box }}
|
<span class="badge-user">{{ activity.user|chill_entity_render_box }}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -137,19 +137,42 @@
|
|||||||
{{ activity.comment|chill_entity_render_box({
|
{{ activity.comment|chill_entity_render_box({
|
||||||
'disable_markdown': false,
|
'disable_markdown': false,
|
||||||
'limit_lines': 3,
|
'limit_lines': 3,
|
||||||
'metadata': false
|
'metadata': false,
|
||||||
}) }}
|
}) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Only if ACL SEE_DETAILS AND/OR only on template SHOW ??
|
{% if is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) and activity.privateComment.hasCommentForUser(app.user) %}
|
||||||
durationTime
|
<div class="wl-row">
|
||||||
travelTime
|
<div class="wl-col title">
|
||||||
comment
|
<h3>{{ 'Private comment'|trans }}</h3>
|
||||||
documents
|
</div>
|
||||||
attendee
|
<div class="wl-col list">
|
||||||
#}
|
<section class="chill-entity entity-comment-embeddable">
|
||||||
|
<blockquote class="chill-user-quote private-quote">
|
||||||
|
{{ activity.privateComment.comments[app.user.id]|chill_markdown_to_html }}
|
||||||
|
</blockquote>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) and activity.documents|length > 0 %}
|
||||||
|
<div class="wl-row">
|
||||||
|
<div class="wl-col title">
|
||||||
|
<h3>{{ 'Documents'|trans }}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="wl-col list">
|
||||||
|
<ul>
|
||||||
|
{% for d in activity.documents %}
|
||||||
|
<li class="document-list-item">{{ d.title|chill_print_or_message('document.Any title') }} {{ d|chill_document_button_group(d.title, is_granted('CHILL_ACTIVITY_UPDATE', activity), {small: true}) }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -8,11 +8,13 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||||
|
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||||
|
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@@ -23,11 +23,13 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||||
|
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||||
|
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
{% 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>
|
||||||
<b>{{ activity.user|chill_entity_render_box}}</b>
|
<span class="badge-user">{{ activity.user|chill_entity_render_box }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@@ -35,7 +35,9 @@
|
|||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
<dl class="chill_view_data">
|
<dl class="chill_view_data">
|
||||||
<dt class="inline">{{ 'Referrer'|trans|capitalize }}</dt>
|
<dt class="inline">{{ 'Referrer'|trans|capitalize }}</dt>
|
||||||
<dd>{{ entity.user|chill_entity_render_box }}</dd>
|
<dd>
|
||||||
|
<span class="badge-user">{{ entity.user|chill_entity_render_box }}</span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
{%- if entity.scope -%}
|
{%- if entity.scope -%}
|
||||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
||||||
@@ -168,7 +170,7 @@
|
|||||||
{% if entity.documents|length > 0 %}
|
{% if entity.documents|length > 0 %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for d in entity.documents %}
|
{% for d in entity.documents %}
|
||||||
<li>{{ d.title }} {{ d|chill_document_button_group() }}</li>
|
<li class="document-list-item">{{ d.title|chill_print_or_message('document.Any title') }} {{ d|chill_document_button_group(d.title, is_granted('CHILL_ACTIVITY_UPDATE', entity), {small: true}) }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@@ -22,6 +22,7 @@ use Chill\DocStoreBundle\Repository\DocumentCategoryRepository;
|
|||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
|
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
@@ -31,6 +32,9 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements DocGeneratorContextWithPublicFormInterface<Activity>
|
||||||
|
*/
|
||||||
class ActivityContext implements
|
class ActivityContext implements
|
||||||
DocGeneratorContextWithAdminFormInterface,
|
DocGeneratorContextWithAdminFormInterface,
|
||||||
DocGeneratorContextWithPublicFormInterface
|
DocGeneratorContextWithPublicFormInterface
|
||||||
@@ -45,6 +49,8 @@ class ActivityContext implements
|
|||||||
|
|
||||||
private PersonRenderInterface $personRender;
|
private PersonRenderInterface $personRender;
|
||||||
|
|
||||||
|
private PersonRepository $personRepository;
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
private TranslatorInterface $translator;
|
||||||
@@ -55,6 +61,7 @@ class ActivityContext implements
|
|||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
PersonRenderInterface $personRender,
|
PersonRenderInterface $personRender,
|
||||||
|
PersonRepository $personRepository,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
BaseContextData $baseContextData
|
BaseContextData $baseContextData
|
||||||
) {
|
) {
|
||||||
@@ -63,6 +70,7 @@ class ActivityContext implements
|
|||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->personRender = $personRender;
|
$this->personRender = $personRender;
|
||||||
|
$this->personRepository = $personRepository;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->baseContextData = $baseContextData;
|
$this->baseContextData = $baseContextData;
|
||||||
}
|
}
|
||||||
@@ -147,7 +155,7 @@ class ActivityContext implements
|
|||||||
$options = $template->getOptions();
|
$options = $template->getOptions();
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data = array_merge($data, $this->baseContextData->getData());
|
$data = array_merge($data, $this->baseContextData->getData($contextGenerationData['creator'] ?? null));
|
||||||
$data['activity'] = $this->normalizer->normalize($entity, 'docgen', ['docgen:expects' => Activity::class, 'groups' => 'docgen:read']);
|
$data['activity'] = $this->normalizer->normalize($entity, 'docgen', ['docgen:expects' => Activity::class, 'groups' => 'docgen:read']);
|
||||||
|
|
||||||
$data['course'] = $this->normalizer->normalize($entity->getAccompanyingPeriod(), 'docgen', ['docgen:expects' => AccompanyingPeriod::class, 'groups' => 'docgen:read']);
|
$data['course'] = $this->normalizer->normalize($entity->getAccompanyingPeriod(), 'docgen', ['docgen:expects' => AccompanyingPeriod::class, 'groups' => 'docgen:read']);
|
||||||
@@ -206,9 +214,32 @@ class ActivityContext implements
|
|||||||
return $options['mainPerson'] || $options['person1'] || $options['person2'];
|
return $options['mainPerson'] || $options['person1'] || $options['person2'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
* @param Activity $entity
|
{
|
||||||
*/
|
$normalized = [];
|
||||||
|
|
||||||
|
foreach (['mainPerson', 'person1', 'person2'] as $k) {
|
||||||
|
$normalized[$k] = null === $data[$k] ? null : $data[$k]->getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$denormalized = [];
|
||||||
|
|
||||||
|
foreach (['mainPerson', 'person1', 'person2'] as $k) {
|
||||||
|
if (null !== ($id = ($data[$k] ?? null))) {
|
||||||
|
$denormalized[$k] = $this->personRepository->find($id);
|
||||||
|
} else {
|
||||||
|
$denormalized[$k] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $denormalized;
|
||||||
|
}
|
||||||
|
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||||
{
|
{
|
||||||
$storedObject->setTitle($this->translatableStringHelper->localize($template->getName()));
|
$storedObject->setTitle($this->translatableStringHelper->localize($template->getName()));
|
||||||
|
@@ -146,6 +146,16 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
return $this->accompanyingPeriodContext->hasPublicForm($template, $entity);
|
return $this->accompanyingPeriodContext->hasPublicForm($template, $entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
return $this->accompanyingPeriodContext->contextGenerationDataNormalize($template, $entity, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
return $this->accompanyingPeriodContext->contextGenerationDataDenormalize($template, $entity, $data);
|
||||||
|
}
|
||||||
|
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||||
{
|
{
|
||||||
$this->accompanyingPeriodContext->storeGenerated($template, $storedObject, $entity, $contextGenerationData);
|
$this->accompanyingPeriodContext->storeGenerated($template, $storedObject, $entity, $contextGenerationData);
|
||||||
|
@@ -13,13 +13,18 @@ namespace Chill\ActivityBundle\Templating\Entity;
|
|||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
|
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
|
||||||
|
use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
|
||||||
|
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render activity reason.
|
* Render activity reason.
|
||||||
|
*
|
||||||
|
* @implements ChillEntityRenderInterface<ActivityReason>
|
||||||
*/
|
*/
|
||||||
class ActivityReasonRender extends AbstractChillEntityRender
|
class ActivityReasonRender implements ChillEntityRenderInterface
|
||||||
{
|
{
|
||||||
|
use BoxUtilsChillEntityRenderTrait;
|
||||||
/**
|
/**
|
||||||
* @var TranslatableStringHelper
|
* @var TranslatableStringHelper
|
||||||
*/
|
*/
|
||||||
@@ -51,9 +56,6 @@ class ActivityReasonRender extends AbstractChillEntityRender
|
|||||||
$this->getDefaultClosingBox();
|
$this->getDefaultClosingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param ActivityReason $entity
|
|
||||||
*/
|
|
||||||
public function renderString($entity, array $options): string
|
public function renderString($entity, array $options): string
|
||||||
{
|
{
|
||||||
$category = '';
|
$category = '';
|
||||||
|
@@ -234,7 +234,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
$user = new \Chill\MainBundle\Entity\User();
|
$user = new \Chill\MainBundle\Entity\User();
|
||||||
$user
|
$user
|
||||||
->setPassword($container->get('security.password_encoder')
|
->setPassword($container->get('security.password_encoder')
|
||||||
->encodePassword($user, 'password'))
|
->encodePassword($user, 'password'))
|
||||||
->setUsername($username)
|
->setUsername($username)
|
||||||
->addGroupCenter($groupCenter);
|
->addGroupCenter($groupCenter);
|
||||||
|
|
||||||
|
@@ -79,6 +79,11 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: chill.export_filter, alias: 'accompanyingcourse_activitytype_filter' }
|
- { name: chill.export_filter, alias: 'accompanyingcourse_activitytype_filter' }
|
||||||
|
|
||||||
|
chill.activity.export.location_filter:
|
||||||
|
class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationFilter
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_filter, alias: 'activity_location_filter' }
|
||||||
|
|
||||||
chill.activity.export.locationtype_filter:
|
chill.activity.export.locationtype_filter:
|
||||||
class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter
|
class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter
|
||||||
tags:
|
tags:
|
||||||
|
@@ -77,7 +77,7 @@ Choose a type: Choisir un type
|
|||||||
4 hours: 4 heures
|
4 hours: 4 heures
|
||||||
4 hours 30: 4 heures 30
|
4 hours 30: 4 heures 30
|
||||||
5 hours: 5 heures
|
5 hours: 5 heures
|
||||||
Concerned groups: Parties concernées
|
Concerned groups: Parties concernées par l'échange
|
||||||
Persons in accompanying course: Usagers du parcours
|
Persons in accompanying course: Usagers du parcours
|
||||||
Third persons: Tiers non-pro.
|
Third persons: Tiers non-pro.
|
||||||
Others persons: Usagers
|
Others persons: Usagers
|
||||||
@@ -252,6 +252,8 @@ Activity reasons for those activities: Sujets de ces activités
|
|||||||
|
|
||||||
Filter by activity type: Filtrer les activités par type
|
Filter by activity type: Filtrer les activités par type
|
||||||
|
|
||||||
|
Filter activity by location: Filtrer les activités par localisation
|
||||||
|
'Filtered activity by location: only %locations%': "Filtré par localisation: uniquement %locations%"
|
||||||
Filter activity by locationtype: Filtrer les activités par type de localisation
|
Filter activity by locationtype: Filtrer les activités par type de localisation
|
||||||
'Filtered activity by locationtype: only %types%': "Filtré par type de localisation: uniquement %types%"
|
'Filtered activity by locationtype: only %types%': "Filtré par type de localisation: uniquement %types%"
|
||||||
Accepted locationtype: Types de localisation
|
Accepted locationtype: Types de localisation
|
||||||
|
@@ -55,7 +55,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
|||||||
$this->getReference('aside_activity_category_0')
|
$this->getReference('aside_activity_category_0')
|
||||||
)
|
)
|
||||||
->setDate((new DateTimeImmutable('today'))
|
->setDate((new DateTimeImmutable('today'))
|
||||||
->sub(new DateInterval('P' . random_int(1, 100) . 'D')));
|
->sub(new DateInterval('P' . random_int(1, 100) . 'D')));
|
||||||
|
|
||||||
$manager->persist($activity);
|
$manager->persist($activity);
|
||||||
}
|
}
|
||||||
|
@@ -53,19 +53,15 @@ class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
$this->asideActivityCategoryRepository->findBy(['id' => $values]);
|
|
||||||
|
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'export.aggregator.Aside activity type';
|
return 'export.aggregator.Aside activity type';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $value) {
|
if (null === $value || null === $t = $this->asideActivityCategoryRepository->find($value)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$t = $this->asideActivityCategoryRepository->find($value);
|
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize($t->getTitle());
|
return $this->translatableStringHelper->localize($t->getTitle());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
|
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
|
class ByUserJobAggregator implements AggregatorInterface
|
||||||
|
{
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
private UserJobRepositoryInterface $userJobRepository;
|
||||||
|
|
||||||
|
public function __construct(UserJobRepositoryInterface $userJobRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
|
$this->userJobRepository = $userJobRepository;
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
if (!in_array('aside_user', $qb->getAllAliases(), true)) {
|
||||||
|
$qb->leftJoin('aside.agent', 'aside_user');
|
||||||
|
}
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->addSelect('IDENTITY(aside_user.userJob) AS aside_activity_user_job_aggregator')
|
||||||
|
->addGroupBy('aside_activity_user_job_aggregator');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn()
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
// nothing to add in the form
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabels($key, array $values, $data)
|
||||||
|
{
|
||||||
|
return function ($value): string {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'Users \'s job';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value || '' === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$j = $this->userJobRepository->find($value);
|
||||||
|
|
||||||
|
return $this->translatableStringHelper->localize(
|
||||||
|
$j->getLabel()
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryKeys($data): array
|
||||||
|
{
|
||||||
|
return ['aside_activity_user_job_aggregator'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return 'export.aggregator.Aggregate by user job';
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
|
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
|
class ByUserScopeAggregator implements AggregatorInterface
|
||||||
|
{
|
||||||
|
private ScopeRepositoryInterface $scopeRepository;
|
||||||
|
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
public function __construct(ScopeRepositoryInterface $scopeRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
|
$this->scopeRepository = $scopeRepository;
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
if (!in_array('aside_user', $qb->getAllAliases(), true)) {
|
||||||
|
$qb->leftJoin('aside.agent', 'aside_user');
|
||||||
|
}
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->addSelect('IDENTITY(aside_user.mainScope) AS aside_activity_user_scope_aggregator')
|
||||||
|
->addGroupBy('aside_activity_user_scope_aggregator');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn()
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
// nothing to add in the form
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabels($key, array $values, $data)
|
||||||
|
{
|
||||||
|
return function ($value): string {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'Users \'s scope';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value || '' === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$s = $this->scopeRepository->find($value);
|
||||||
|
|
||||||
|
return $this->translatableStringHelper->localize(
|
||||||
|
$s->getName()
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryKeys($data): array
|
||||||
|
{
|
||||||
|
return ['aside_activity_user_scope_aggregator'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return 'export.aggregator.Aggregate by user scope';
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Export;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\AsideActivityBundle\Repository\AsideActivityRepository;
|
||||||
|
use Chill\AsideActivityBundle\Security\AsideActivityVoter;
|
||||||
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
|
use Doctrine\ORM\Query;
|
||||||
|
use LogicException;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
|
{
|
||||||
|
private AsideActivityRepository $repository;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
AsideActivityRepository $repository
|
||||||
|
) {
|
||||||
|
$this->repository = $repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllowedFormattersTypes(): array
|
||||||
|
{
|
||||||
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'export.Average aside activities duration';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'export.Exports of aside activities';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabels($key, array $values, $data)
|
||||||
|
{
|
||||||
|
if ('export_avg_aside_activity_duration' !== $key) {
|
||||||
|
throw new LogicException("the key {$key} is not used by this export");
|
||||||
|
}
|
||||||
|
|
||||||
|
return static fn ($value) => '_header' === $value ? 'Average duration aside activities' : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryKeys($data): array
|
||||||
|
{
|
||||||
|
return ['export_avg_aside_activity_duration'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResult($query, $data)
|
||||||
|
{
|
||||||
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle(): string
|
||||||
|
{
|
||||||
|
return 'export.Average aside activities duration';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(): string
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
|
{
|
||||||
|
$qb = $this->repository->createQueryBuilder('aside');
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->select('AVG(aside.duration) as export_avg_aside_activity_duration')
|
||||||
|
->andWhere($qb->expr()->isNotNull('aside.duration'));
|
||||||
|
|
||||||
|
return $qb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function requiredRole(): string
|
||||||
|
{
|
||||||
|
return AsideActivityVoter::STATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supportsModifiers(): array
|
||||||
|
{
|
||||||
|
return [Declarations::ASIDE_ACTIVITY_TYPE];
|
||||||
|
}
|
||||||
|
}
|
@@ -100,6 +100,8 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [
|
||||||
|
Declarations::ASIDE_ACTIVITY_TYPE,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,239 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Export;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Entity\AsideActivity;
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\AsideActivityBundle\Repository\AsideActivityCategoryRepository;
|
||||||
|
use Chill\AsideActivityBundle\Security\AsideActivityVoter;
|
||||||
|
use Chill\AsideActivityBundle\Templating\Entity\CategoryRender;
|
||||||
|
use Chill\MainBundle\Entity\Center;
|
||||||
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
|
use Chill\MainBundle\Export\Helper\DateTimeHelper;
|
||||||
|
use Chill\MainBundle\Export\Helper\UserHelper;
|
||||||
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
|
use Chill\MainBundle\Repository\CenterRepositoryInterface;
|
||||||
|
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use Doctrine\ORM\AbstractQuery;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use LogicException;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
final class ListAsideActivity implements ListInterface, GroupedExportInterface
|
||||||
|
{
|
||||||
|
private AsideActivityCategoryRepository $asideActivityCategoryRepository;
|
||||||
|
|
||||||
|
private CategoryRender $categoryRender;
|
||||||
|
|
||||||
|
private CenterRepositoryInterface $centerRepository;
|
||||||
|
|
||||||
|
private DateTimeHelper $dateTimeHelper;
|
||||||
|
|
||||||
|
private EntityManagerInterface $em;
|
||||||
|
|
||||||
|
private ScopeRepositoryInterface $scopeRepository;
|
||||||
|
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
private UserHelper $userHelper;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
EntityManagerInterface $em,
|
||||||
|
DateTimeHelper $dateTimeHelper,
|
||||||
|
UserHelper $userHelper,
|
||||||
|
ScopeRepositoryInterface $scopeRepository,
|
||||||
|
CenterRepositoryInterface $centerRepository,
|
||||||
|
AsideActivityCategoryRepository $asideActivityCategoryRepository,
|
||||||
|
CategoryRender $categoryRender,
|
||||||
|
TranslatableStringHelperInterface $translatableStringHelper
|
||||||
|
) {
|
||||||
|
$this->em = $em;
|
||||||
|
$this->dateTimeHelper = $dateTimeHelper;
|
||||||
|
$this->userHelper = $userHelper;
|
||||||
|
$this->scopeRepository = $scopeRepository;
|
||||||
|
$this->centerRepository = $centerRepository;
|
||||||
|
$this->asideActivityCategoryRepository = $asideActivityCategoryRepository;
|
||||||
|
$this->categoryRender = $categoryRender;
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllowedFormattersTypes()
|
||||||
|
{
|
||||||
|
return [FormatterInterface::TYPE_LIST];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription()
|
||||||
|
{
|
||||||
|
return 'export.aside_activity.List of aside activities';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'export.Exports of aside activities';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabels($key, array $values, $data)
|
||||||
|
{
|
||||||
|
switch ($key) {
|
||||||
|
case 'id':
|
||||||
|
case 'note':
|
||||||
|
return static function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.aside_activity.' . $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value ?? '';
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'duration':
|
||||||
|
return static function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.aside_activity.' . $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($value instanceof DateTimeInterface) {
|
||||||
|
return $value->format('H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'createdAt':
|
||||||
|
case 'updatedAt':
|
||||||
|
case 'date':
|
||||||
|
return $this->dateTimeHelper->getLabel('export.aside_activity.' . $key);
|
||||||
|
|
||||||
|
case 'agent_id':
|
||||||
|
case 'creator_id':
|
||||||
|
return $this->userHelper->getLabel($key, $values, 'export.aside_activity.' . $key);
|
||||||
|
|
||||||
|
case 'aside_activity_type':
|
||||||
|
return function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.aside_activity.aside_activity_type';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value || '' === $value || null === $c = $this->asideActivityCategoryRepository->find($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->categoryRender->renderString($c, []);
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'main_scope':
|
||||||
|
return function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.aside_activity.main_scope';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value || '' === $value || null === $c = $this->scopeRepository->find($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->translatableStringHelper->localize($c->getName());
|
||||||
|
};
|
||||||
|
|
||||||
|
case 'main_center':
|
||||||
|
return function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.aside_activity.main_center';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $value || '' === $value || null === $c = $this->centerRepository->find($value)) {
|
||||||
|
/** @var Center $c */
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $c->getName();
|
||||||
|
};
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new LogicException('this key is not supported : ' . $key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryKeys($data)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id',
|
||||||
|
'createdAt',
|
||||||
|
'updatedAt',
|
||||||
|
'agent_id',
|
||||||
|
'creator_id',
|
||||||
|
'main_scope',
|
||||||
|
'main_center',
|
||||||
|
'aside_activity_type',
|
||||||
|
'date',
|
||||||
|
'duration',
|
||||||
|
'note',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResult($query, $data): array
|
||||||
|
{
|
||||||
|
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return 'export.aside_activity.List of aside activities';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(): string
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
|
{
|
||||||
|
$qb = $this->em->createQueryBuilder()
|
||||||
|
->from(AsideActivity::class, 'aside')
|
||||||
|
->leftJoin('aside.agent', 'agent');
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->addSelect('aside.id AS id')
|
||||||
|
->addSelect('aside.createdAt AS createdAt')
|
||||||
|
->addSelect('aside.updatedAt AS updatedAt')
|
||||||
|
->addSelect('IDENTITY(aside.agent) AS agent_id')
|
||||||
|
->addSelect('IDENTITY(aside.createdBy) AS creator_id')
|
||||||
|
->addSelect('IDENTITY(agent.mainScope) AS main_scope')
|
||||||
|
->addSelect('IDENTITY(agent.mainCenter) AS main_center')
|
||||||
|
->addSelect('IDENTITY(aside.type) AS aside_activity_type')
|
||||||
|
->addSelect('aside.date')
|
||||||
|
->addSelect('aside.duration')
|
||||||
|
->addSelect('aside.note');
|
||||||
|
|
||||||
|
return $qb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function requiredRole(): string
|
||||||
|
{
|
||||||
|
return AsideActivityVoter::STATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supportsModifiers()
|
||||||
|
{
|
||||||
|
return [Declarations::ASIDE_ACTIVITY_TYPE];
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Export;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\AsideActivityBundle\Repository\AsideActivityRepository;
|
||||||
|
use Chill\AsideActivityBundle\Security\AsideActivityVoter;
|
||||||
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
|
use Doctrine\ORM\Query;
|
||||||
|
use LogicException;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class SumAsideActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
|
{
|
||||||
|
private AsideActivityRepository $repository;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
AsideActivityRepository $repository
|
||||||
|
) {
|
||||||
|
$this->repository = $repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllowedFormattersTypes(): array
|
||||||
|
{
|
||||||
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'export.Sum aside activities duration';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'export.Exports of aside activities';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabels($key, array $values, $data)
|
||||||
|
{
|
||||||
|
if ('export_sum_aside_activity_duration' !== $key) {
|
||||||
|
throw new LogicException("the key {$key} is not used by this export");
|
||||||
|
}
|
||||||
|
|
||||||
|
return static fn ($value) => '_header' === $value ? 'Sum duration aside activities' : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryKeys($data): array
|
||||||
|
{
|
||||||
|
return ['export_sum_aside_activity_duration'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResult($query, $data)
|
||||||
|
{
|
||||||
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle(): string
|
||||||
|
{
|
||||||
|
return 'export.Sum aside activities duration';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(): string
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
|
{
|
||||||
|
$qb = $this->repository
|
||||||
|
->createQueryBuilder('aside');
|
||||||
|
|
||||||
|
$qb->select('SUM(aside.duration) as export_sum_aside_activity_duration')
|
||||||
|
->andWhere($qb->expr()->isNotNull('aside.duration'));
|
||||||
|
|
||||||
|
return $qb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function requiredRole(): string
|
||||||
|
{
|
||||||
|
return AsideActivityVoter::STATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supportsModifiers(): array
|
||||||
|
{
|
||||||
|
return [Declarations::ASIDE_ACTIVITY_TYPE];
|
||||||
|
}
|
||||||
|
}
|
@@ -80,8 +80,8 @@ class ByActivityTypeFilter implements FilterInterface
|
|||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$types = array_map(
|
$types = array_map(
|
||||||
fn (AsideActivityCategory $t): string => $this->translatableStringHelper->localize($t->getName()),
|
fn (AsideActivityCategory $t): string => $this->translatableStringHelper->localize($t->getTitle()),
|
||||||
$this->asideActivityTypeRepository->findBy(['id' => $data['types']->toArray()])
|
$data['types']->toArray()
|
||||||
);
|
);
|
||||||
|
|
||||||
return ['export.filter.Filtered by aside activity type: only %type%', [
|
return ['export.filter.Filtered by aside activity type: only %type%', [
|
||||||
|
@@ -17,7 +17,6 @@ use Chill\MainBundle\Form\Type\Export\FilterType;
|
|||||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||||
use Doctrine\ORM\Query\Expr\Andx;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Form\FormError;
|
use Symfony\Component\Form\FormError;
|
||||||
@@ -46,25 +45,18 @@ class ByDateFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
|
||||||
$clause = $qb->expr()->between(
|
$clause = $qb->expr()->between(
|
||||||
'aside.date',
|
'aside.date',
|
||||||
':date_from',
|
':date_from',
|
||||||
':date_to'
|
':date_to'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($where instanceof Andx) {
|
$qb->andWhere($clause);
|
||||||
$where->add($clause);
|
|
||||||
} else {
|
|
||||||
$where = $qb->expr()->andX($clause);
|
|
||||||
}
|
|
||||||
|
|
||||||
$qb->add('where', $where);
|
|
||||||
$qb->setParameter(
|
$qb->setParameter(
|
||||||
'date_from',
|
'date_from',
|
||||||
$this->rollingDateConverter->convert($data['date_from'])
|
$this->rollingDateConverter->convert($data['date_from'])
|
||||||
);
|
)->setParameter(
|
||||||
$qb->setParameter(
|
|
||||||
'date_to',
|
'date_to',
|
||||||
$this->rollingDateConverter->convert($data['date_to'])
|
$this->rollingDateConverter->convert($data['date_to'])
|
||||||
);
|
);
|
||||||
|
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Filter;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
|
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||||
|
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class ByUserFilter implements FilterInterface
|
||||||
|
{
|
||||||
|
private UserRender $userRender;
|
||||||
|
|
||||||
|
public function __construct(UserRender $userRender)
|
||||||
|
{
|
||||||
|
$this->userRender = $userRender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
$clause = $qb->expr()->in('aside.agent', ':users');
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->andWhere($clause)
|
||||||
|
->setParameter('users', $data['accepted_users']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn(): string
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
|
'multiple' => true,
|
||||||
|
'label' => 'Creators',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function describeAction($data, $format = 'string'): array
|
||||||
|
{
|
||||||
|
$users = [];
|
||||||
|
|
||||||
|
foreach ($data['accepted_users'] as $u) {
|
||||||
|
$users[] = $this->userRender->renderString($u, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['export.filter.Filtered aside activity by user: only %users%', [
|
||||||
|
'%users%' => implode(', ', $users),
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle(): string
|
||||||
|
{
|
||||||
|
return 'export.filter.Filter aside activity by user';
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Filter;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Entity\AsideActivity;
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Entity\UserJob;
|
||||||
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class ByUserJobFilter implements FilterInterface
|
||||||
|
{
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
public function __construct(TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
$qb
|
||||||
|
->andWhere(
|
||||||
|
$qb->expr()->exists(
|
||||||
|
'SELECT 1 FROM ' . AsideActivity::class . ' aside_activity_user_job_filter_act
|
||||||
|
JOIN aside_activity_user_job_filter_act.agent aside_activity_user_job_filter_user WHERE aside_activity_user_job_filter_user.userJob IN (:aside_activity_user_job_filter_jobs) AND aside_activity_user_job_filter_act = aside'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
->setParameter('aside_activity_user_job_filter_jobs', $data['jobs']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn()
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
$builder->add('jobs', EntityType::class, [
|
||||||
|
'class' => UserJob::class,
|
||||||
|
'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
|
||||||
|
'multiple' => true,
|
||||||
|
'expanded' => true,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function describeAction($data, $format = 'string')
|
||||||
|
{
|
||||||
|
return ['export.filter.Filtered aside activities by user jobs: only %jobs%', [
|
||||||
|
'%jobs%' => implode(
|
||||||
|
', ',
|
||||||
|
array_map(
|
||||||
|
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
||||||
|
$data['jobs']->toArray()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return 'export.filter.Filter by user jobs';
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Export\Filter;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Entity\AsideActivity;
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Entity\Scope;
|
||||||
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
|
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
class ByUserScopeFilter implements FilterInterface
|
||||||
|
{
|
||||||
|
private ScopeRepositoryInterface $scopeRepository;
|
||||||
|
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
ScopeRepositoryInterface $scopeRepository,
|
||||||
|
TranslatableStringHelperInterface $translatableStringHelper
|
||||||
|
) {
|
||||||
|
$this->scopeRepository = $scopeRepository;
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
$qb
|
||||||
|
->andWhere(
|
||||||
|
$qb->expr()->exists(
|
||||||
|
'SELECT 1 FROM ' . AsideActivity::class . ' aside_activity_user_scope_filter_act
|
||||||
|
JOIN aside_activity_user_scope_filter_act.agent aside_activity_user_scope_filter_user WHERE aside_activity_user_scope_filter_user.mainScope IN (:aside_activity_user_scope_filter_scopes) AND aside_activity_user_scope_filter_act = aside '
|
||||||
|
)
|
||||||
|
)
|
||||||
|
->setParameter('aside_activity_user_scope_filter_scopes', $data['scopes']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn()
|
||||||
|
{
|
||||||
|
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
$builder->add('scopes', EntityType::class, [
|
||||||
|
'class' => Scope::class,
|
||||||
|
'choices' => $this->scopeRepository->findAllActive(),
|
||||||
|
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
||||||
|
'multiple' => true,
|
||||||
|
'expanded' => true,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function describeAction($data, $format = 'string')
|
||||||
|
{
|
||||||
|
return ['export.filter.Filtered aside activities by user scope: only %scopes%', [
|
||||||
|
'%scopes%' => implode(
|
||||||
|
', ',
|
||||||
|
array_map(
|
||||||
|
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
||||||
|
$data['scopes']->toArray()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return 'export.filter.Filter by user scope';
|
||||||
|
}
|
||||||
|
}
|
@@ -16,6 +16,9 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
|||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Symfony\Component\Templating\EngineInterface;
|
use Symfony\Component\Templating\EngineInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements ChillEntityRenderInterface<AsideActivityCategory>
|
||||||
|
*/
|
||||||
final class CategoryRender implements ChillEntityRenderInterface
|
final class CategoryRender implements ChillEntityRenderInterface
|
||||||
{
|
{
|
||||||
public const DEFAULT_ARGS = [
|
public const DEFAULT_ARGS = [
|
||||||
@@ -45,9 +48,6 @@ final class CategoryRender implements ChillEntityRenderInterface
|
|||||||
return $parents;
|
return $parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param AsideActivityCategory $asideActivityCategory
|
|
||||||
*/
|
|
||||||
public function renderBox($asideActivityCategory, array $options): string
|
public function renderBox($asideActivityCategory, array $options): string
|
||||||
{
|
{
|
||||||
$options = array_merge(self::DEFAULT_ARGS, $options);
|
$options = array_merge(self::DEFAULT_ARGS, $options);
|
||||||
@@ -63,9 +63,6 @@ final class CategoryRender implements ChillEntityRenderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param AsideActivityCategory $asideActivityCategory
|
|
||||||
*/
|
|
||||||
public function renderString($asideActivityCategory, array $options): string
|
public function renderString($asideActivityCategory, array $options): string
|
||||||
{
|
{
|
||||||
$options = array_merge(self::DEFAULT_ARGS, $options);
|
$options = array_merge(self::DEFAULT_ARGS, $options);
|
||||||
@@ -84,9 +81,6 @@ final class CategoryRender implements ChillEntityRenderInterface
|
|||||||
return implode($options[self::SEPERATOR_KEY], $titles);
|
return implode($options[self::SEPERATOR_KEY], $titles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param AsideActivityCategory $asideActivityCategory
|
|
||||||
*/
|
|
||||||
public function supports($asideActivityCategory, array $options): bool
|
public function supports($asideActivityCategory, array $options): bool
|
||||||
{
|
{
|
||||||
return $asideActivityCategory instanceof AsideActivityCategory;
|
return $asideActivityCategory instanceof AsideActivityCategory;
|
||||||
|
@@ -20,33 +20,3 @@ services:
|
|||||||
resource: "../Controller"
|
resource: "../Controller"
|
||||||
autowire: true
|
autowire: true
|
||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
|
|
||||||
|
|
||||||
## Exports
|
|
||||||
|
|
||||||
# indicators
|
|
||||||
Chill\AsideActivityBundle\Export\Export\CountAsideActivity:
|
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
tags:
|
|
||||||
- { name: chill.export, alias: count_asideactivity }
|
|
||||||
|
|
||||||
# filters
|
|
||||||
Chill\AsideActivityBundle\Export\Filter\ByDateFilter:
|
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
tags:
|
|
||||||
- { name: chill.export_filter, alias: asideactivity_bydate_filter }
|
|
||||||
|
|
||||||
Chill\AsideActivityBundle\Export\Filter\ByActivityTypeFilter:
|
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
tags:
|
|
||||||
- { name: chill.export_filter, alias: asideactivity_activitytype_filter }
|
|
||||||
|
|
||||||
# aggregators
|
|
||||||
Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator:
|
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
tags:
|
|
||||||
- { name: chill.export_aggregator, alias: asideactivity_activitytype_aggregator }
|
|
||||||
|
@@ -3,11 +3,23 @@ services:
|
|||||||
autowire: true
|
autowire: true
|
||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
|
|
||||||
|
Chill\AsideActivityBundle\Export\Export\ListAsideActivity:
|
||||||
|
tags:
|
||||||
|
- { name: chill.export, alias: 'list_aside_activity' }
|
||||||
|
|
||||||
## Indicators
|
## Indicators
|
||||||
Chill\AsideActivityBundle\Export\Export\CountAsideActivity:
|
Chill\AsideActivityBundle\Export\Export\CountAsideActivity:
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export, alias: 'count_aside_activity' }
|
- { name: chill.export, alias: 'count_aside_activity' }
|
||||||
|
|
||||||
|
Chill\AsideActivityBundle\Export\Export\SumAsideActivityDuration:
|
||||||
|
tags:
|
||||||
|
- { name: chill.export, alias: 'sum_aside_activity_duration' }
|
||||||
|
|
||||||
|
Chill\AsideActivityBundle\Export\Export\AvgAsideActivityDuration:
|
||||||
|
tags:
|
||||||
|
- { name: chill.export, alias: 'avg_aside_activity_duration' }
|
||||||
|
|
||||||
## Filters
|
## Filters
|
||||||
chill.aside_activity.export.date_filter:
|
chill.aside_activity.export.date_filter:
|
||||||
class: Chill\AsideActivityBundle\Export\Filter\ByDateFilter
|
class: Chill\AsideActivityBundle\Export\Filter\ByDateFilter
|
||||||
@@ -19,9 +31,34 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: chill.export_filter, alias: 'aside_activity_type_filter' }
|
- { name: chill.export_filter, alias: 'aside_activity_type_filter' }
|
||||||
|
|
||||||
|
chill.aside_activity.export.user_job_filter:
|
||||||
|
class: Chill\AsideActivityBundle\Export\Filter\ByUserJobFilter
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_filter, alias: 'aside_activity_user_job_filter' }
|
||||||
|
|
||||||
|
chill.aside_activity.export.user_scope_filter:
|
||||||
|
class: Chill\AsideActivityBundle\Export\Filter\ByUserScopeFilter
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_filter, alias: 'aside_activity_user_scope_filter' }
|
||||||
|
|
||||||
|
chill.aside_activity.export.user_filter:
|
||||||
|
class: Chill\AsideActivityBundle\Export\Filter\ByUserFilter
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_filter, alias: 'aside_activity_user_filter' }
|
||||||
|
|
||||||
## Aggregators
|
## Aggregators
|
||||||
|
|
||||||
chill.aside_activity.export.type_aggregator:
|
chill.aside_activity.export.type_aggregator:
|
||||||
class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator
|
class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: activity_type_aggregator }
|
- { name: chill.export_aggregator, alias: activity_type_aggregator }
|
||||||
|
|
||||||
|
chill.aside_activity.export.user_job_aggregator:
|
||||||
|
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserJobAggregator
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_aggregator, alias: aside_activity_user_job_aggregator }
|
||||||
|
|
||||||
|
chill.aside_activity.export.user_scope_aggregator:
|
||||||
|
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserScopeAggregator
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_aggregator, alias: aside_activity_user_scope_aggregator }
|
||||||
|
@@ -29,16 +29,16 @@ location: Lieu
|
|||||||
|
|
||||||
# Crud
|
# Crud
|
||||||
crud:
|
crud:
|
||||||
aside_activity:
|
aside_activity:
|
||||||
title_view: Détail de l'activité annexe
|
title_view: Détail de l'activité annexe
|
||||||
title_new: Nouvelle activité annexe
|
title_new: Nouvelle activité annexe
|
||||||
title_edit: Édition d'une activité annexe
|
title_edit: Édition d'une activité annexe
|
||||||
title_delete: Supprimer une activité annexe
|
title_delete: Supprimer une activité annexe
|
||||||
button_delete: Supprimer
|
button_delete: Supprimer
|
||||||
confirm_message_delete: Êtes-vous sûr de vouloir supprimer cette activité annexe?
|
confirm_message_delete: Êtes-vous sûr de vouloir supprimer cette activité annexe?
|
||||||
aside_activity_category:
|
aside_activity_category:
|
||||||
title_new: Nouvelle catégorie d'activité annexe
|
title_new: Nouvelle catégorie d'activité annexe
|
||||||
title_edit: Édition d'une catégorie de type d'activité
|
title_edit: Édition d'une catégorie de type d'activité
|
||||||
|
|
||||||
#forms
|
#forms
|
||||||
Create a new aside activity type: Nouvelle categorie d'activité annexe
|
Create a new aside activity type: Nouvelle categorie d'activité annexe
|
||||||
@@ -169,19 +169,43 @@ Aside activity configuration: Configuration des activités annexes
|
|||||||
|
|
||||||
# exports
|
# exports
|
||||||
export:
|
export:
|
||||||
Exports of aside activities: Exports des activités annexes
|
aside_activity:
|
||||||
Count aside activities: Nombre d'activités annexes
|
List of aside activities: Liste des activités annexes
|
||||||
Count aside activities by various parameters.: Compte le nombre d'activités annexes selon divers critères
|
createdAt: Création
|
||||||
filter:
|
updatedAt: Dernière mise à jour
|
||||||
Filter by aside activity date: Filtrer les activités annexes par date
|
agent_id: Utilisateur
|
||||||
Filter by aside activity type: Filtrer les activités annexes par type d'activité
|
creator_id: Créateur
|
||||||
'Filtered by aside activity type: only %type%': "Filtré par type d'activité annexe: uniquement %type%"
|
main_scope: Service principal de l'utilisateur
|
||||||
This date should be after the date given in "Implied in an aside activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "activités annexes après cette date"
|
main_center: Centre principal de l'utilisteur
|
||||||
Aside activities after this date: Actvitités annexes après cette date
|
aside_activity_type: Catégorie d'activité annexe
|
||||||
Aside activities before this date: Actvitités annexes avant cette date
|
date: Date
|
||||||
aggregator:
|
duration: Durée
|
||||||
Group by aside activity type: Grouper les activités annexes par type d'activité
|
note: Note
|
||||||
Aside activity type: Type d'activité annexe
|
|
||||||
|
Exports of aside activities: Exports des activités annexes
|
||||||
|
Count aside activities: Nombre d'activités annexes
|
||||||
|
Count aside activities by various parameters.: Compte le nombre d'activités annexes selon divers critères
|
||||||
|
Average aside activities duration: Durée moyenne des activités annexes
|
||||||
|
Sum aside activities duration: Durée des activités annexes
|
||||||
|
filter:
|
||||||
|
Filter by aside activity date: Filtrer les activités annexes par date
|
||||||
|
Filter by aside activity type: Filtrer les activités annexes par type d'activité
|
||||||
|
'Filtered by aside activity type: only %type%': "Filtré par type d'activité annexe: uniquement %type%"
|
||||||
|
Filtered by aside activities between %dateFrom% and %dateTo%: Filtré par date d'activité annexe, entre %dateFrom% et %dateTo%
|
||||||
|
This date should be after the date given in "Implied in an aside activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "activités annexes après cette date"
|
||||||
|
Aside activities after this date: Actvitités annexes après cette date
|
||||||
|
Aside activities before this date: Actvitités annexes avant cette date
|
||||||
|
'Filtered aside activity by user: only %users%': "Filtré par utilisateur: uniquement %users%"
|
||||||
|
Filter aside activity by user: Filtrer par utilisateur
|
||||||
|
'Filtered aside activities by user jobs: only %jobs%': "Filtré par métier des utilisateurs: uniquement %jobs%"
|
||||||
|
Filter by user jobs: Filtrer les activités annexes par métier des utilisateurs
|
||||||
|
'Filtered aside activities by user scope: only %scopes%': "Filtré par service des utilisateur: uniquement %scopes%"
|
||||||
|
Filter by user scope: Filtrer les activités annexes par service d'utilisateur
|
||||||
|
aggregator:
|
||||||
|
Group by aside activity type: Grouper les activités annexes par type d'activité
|
||||||
|
Aside activity type: Type d'activité annexe
|
||||||
|
Aggregate by user job: Grouper les activités annexes par métier des utilisateurs
|
||||||
|
Aggregate by user scope: Grouper les activités annexes par service des utilisateurs
|
||||||
|
|
||||||
# ROLES
|
# ROLES
|
||||||
CHILL_ASIDE_ACTIVITY_STATS: Statistiques pour les activités annexes
|
CHILL_ASIDE_ACTIVITY_STATS: Statistiques pour les activités annexes
|
||||||
|
@@ -11,12 +11,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Calculator;
|
namespace Chill\BudgetBundle\Calculator;
|
||||||
|
|
||||||
use Chill\BudgetBundle\Entity\AbstractElement;
|
use Chill\BudgetBundle\Entity\Charge;
|
||||||
|
use Chill\BudgetBundle\Entity\Resource;
|
||||||
|
|
||||||
interface CalculatorInterface
|
interface CalculatorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param AbstractElement[] $elements
|
* @param array<Charge|Resource> $elements
|
||||||
*/
|
*/
|
||||||
public function calculate(array $elements): ?CalculatorResult;
|
public function calculate(array $elements): ?CalculatorResult;
|
||||||
|
|
||||||
|
@@ -12,6 +12,8 @@ declare(strict_types=1);
|
|||||||
namespace Chill\BudgetBundle\Calculator;
|
namespace Chill\BudgetBundle\Calculator;
|
||||||
|
|
||||||
use Chill\BudgetBundle\Entity\AbstractElement;
|
use Chill\BudgetBundle\Entity\AbstractElement;
|
||||||
|
use Chill\BudgetBundle\Entity\Charge;
|
||||||
|
use Chill\BudgetBundle\Entity\Resource;
|
||||||
use OutOfBoundsException;
|
use OutOfBoundsException;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
@@ -21,23 +23,26 @@ use function implode;
|
|||||||
class CalculatorManager
|
class CalculatorManager
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var CalculatorInterface[]
|
* @var array<string, CalculatorInterface>
|
||||||
*/
|
*/
|
||||||
protected $calculators = [];
|
private array $calculators = [];
|
||||||
|
|
||||||
protected $defaultCalculator = [];
|
/**
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
private array $defaultCalculator = [];
|
||||||
|
|
||||||
public function addCalculator(CalculatorInterface $calculator, bool $default)
|
public function addCalculator(CalculatorInterface $calculator, bool $default)
|
||||||
{
|
{
|
||||||
$this->calculators[$calculator::getAlias()] = $calculator;
|
$this->calculators[$calculator->getAlias()] = $calculator;
|
||||||
|
|
||||||
if ($default) {
|
if ($default) {
|
||||||
$this->defaultCalculator[] = $calculator::getAlias();
|
$this->defaultCalculator[] = $calculator->getAlias();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param AbstractElement[] $elements
|
* @param array<Resource|Charge> $elements
|
||||||
*
|
*
|
||||||
* @return CalculatorResult[]
|
* @return CalculatorResult[]
|
||||||
*/
|
*/
|
||||||
@@ -46,23 +51,17 @@ class CalculatorManager
|
|||||||
$results = [];
|
$results = [];
|
||||||
|
|
||||||
foreach ($this->defaultCalculator as $alias) {
|
foreach ($this->defaultCalculator as $alias) {
|
||||||
$calculator = $this->calculators[$alias];
|
$result = $this->getCalculator($alias)->calculate($elements);
|
||||||
$result = $calculator->calculate($elements);
|
|
||||||
|
|
||||||
if (null !== $result) {
|
if (null !== $result) {
|
||||||
$results[$calculator::getAlias()] = $result;
|
$results[$alias] = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function getCalculator(string $alias): CalculatorInterface
|
||||||
* @param string $alias
|
|
||||||
*
|
|
||||||
* @return CalculatorInterface
|
|
||||||
*/
|
|
||||||
public function getCalculator($alias)
|
|
||||||
{
|
{
|
||||||
if (false === array_key_exists($alias, $this->calculators)) {
|
if (false === array_key_exists($alias, $this->calculators)) {
|
||||||
throw new OutOfBoundsException("The calculator with alias '{$alias}' does "
|
throw new OutOfBoundsException("The calculator with alias '{$alias}' does "
|
||||||
|
@@ -14,6 +14,8 @@ namespace Chill\BudgetBundle\Controller;
|
|||||||
use Chill\BudgetBundle\Calculator\CalculatorManager;
|
use Chill\BudgetBundle\Calculator\CalculatorManager;
|
||||||
use Chill\BudgetBundle\Entity\Charge;
|
use Chill\BudgetBundle\Entity\Charge;
|
||||||
use Chill\BudgetBundle\Entity\Resource;
|
use Chill\BudgetBundle\Entity\Resource;
|
||||||
|
use Chill\BudgetBundle\Repository\ChargeRepository;
|
||||||
|
use Chill\BudgetBundle\Repository\ResourceRepository;
|
||||||
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
|
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
|
||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
@@ -29,24 +31,20 @@ use function count;
|
|||||||
|
|
||||||
class ElementController extends AbstractController
|
class ElementController extends AbstractController
|
||||||
{
|
{
|
||||||
protected CalculatorManager $calculator;
|
private CalculatorManager $calculator;
|
||||||
|
|
||||||
protected LoggerInterface $chillMainLogger;
|
private ResourceRepository $resourceRepository;
|
||||||
|
|
||||||
protected EntityManagerInterface $em;
|
private ChargeRepository $chargeRepository;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
CalculatorManager $calculator,
|
||||||
TranslatorInterface $translator,
|
ResourceRepository $resourceRepository,
|
||||||
LoggerInterface $chillMainLogger,
|
ChargeRepository $chargeRepository,
|
||||||
CalculatorManager $calculator
|
|
||||||
) {
|
) {
|
||||||
$this->em = $em;
|
|
||||||
$this->translator = $translator;
|
|
||||||
$this->chillMainLogger = $chillMainLogger;
|
|
||||||
$this->calculator = $calculator;
|
$this->calculator = $calculator;
|
||||||
|
$this->resourceRepository = $resourceRepository;
|
||||||
|
$this->chargeRepository = $chargeRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,24 +57,10 @@ class ElementController extends AbstractController
|
|||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $person);
|
$this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $person);
|
||||||
|
|
||||||
$charges = $this->em
|
$charges = $this->chargeRepository->findAllByEntity($person);
|
||||||
->getRepository(Charge::class)
|
$resources = $this->resourceRepository->findAllByEntity($person);
|
||||||
->findByPerson($person);
|
|
||||||
|
|
||||||
$ressources = $this->em
|
$elements = array_merge($charges, $resources);
|
||||||
->getRepository(Resource::class)
|
|
||||||
->findByPerson($person);
|
|
||||||
|
|
||||||
$now = new DateTime('now');
|
|
||||||
|
|
||||||
$actualCharges = $this->em
|
|
||||||
->getRepository(Charge::class)
|
|
||||||
->findByEntityAndDate($person, $now);
|
|
||||||
$actualResources = $this->em
|
|
||||||
->getRepository(Resource::class)
|
|
||||||
->findByEntityAndDate($person, $now);
|
|
||||||
|
|
||||||
$elements = array_merge($actualCharges, $actualResources);
|
|
||||||
|
|
||||||
if (count($elements) > 0) {
|
if (count($elements) > 0) {
|
||||||
$results = $this->calculator->calculateDefault($elements);
|
$results = $this->calculator->calculateDefault($elements);
|
||||||
@@ -85,7 +69,7 @@ class ElementController extends AbstractController
|
|||||||
return $this->render('ChillBudgetBundle:Person:index.html.twig', [
|
return $this->render('ChillBudgetBundle:Person:index.html.twig', [
|
||||||
'person' => $person,
|
'person' => $person,
|
||||||
'charges' => $charges,
|
'charges' => $charges,
|
||||||
'resources' => $ressources,
|
'resources' => $resources,
|
||||||
'results' => $results ?? [],
|
'results' => $results ?? [],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -100,60 +84,19 @@ class ElementController extends AbstractController
|
|||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $household);
|
$this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $household);
|
||||||
|
|
||||||
$charges = $this->em
|
$charges = $this->chargeRepository->findAllByEntity($household);
|
||||||
->getRepository(Charge::class)
|
$resources = $this->resourceRepository->findAllByEntity($household);
|
||||||
->findByHousehold($household);
|
|
||||||
|
|
||||||
$ressources = $this->em
|
$elements = array_merge($charges, $resources);
|
||||||
->getRepository(Resource::class)
|
|
||||||
->findByHousehold($household);
|
|
||||||
|
|
||||||
$now = new DateTime('now');
|
|
||||||
|
|
||||||
$actualCharges = $this->em
|
|
||||||
->getRepository(Charge::class)
|
|
||||||
->findByEntityAndDate($household, $now);
|
|
||||||
$actualResources = $this->em
|
|
||||||
->getRepository(Resource::class)
|
|
||||||
->findByEntityAndDate($household, $now);
|
|
||||||
|
|
||||||
$elements = array_merge($actualCharges, $actualResources);
|
|
||||||
|
|
||||||
if (count($elements) > 0) {
|
if (count($elements) > 0) {
|
||||||
$results = $this->calculator->calculateDefault($elements);
|
$results = $this->calculator->calculateDefault($elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
// quick solution to calculate the sum, difference and amount from
|
|
||||||
// controller. This should be done from the calculators
|
|
||||||
// TODO replace this by calculators
|
|
||||||
$wholeCharges = $actualCharges;
|
|
||||||
$wholeResources = $actualResources;
|
|
||||||
|
|
||||||
foreach ($household->getCurrentPersons() as $person) {
|
|
||||||
$wholeCharges = array_merge(
|
|
||||||
$wholeCharges,
|
|
||||||
$this->em
|
|
||||||
->getRepository(Charge::class)
|
|
||||||
->findByEntityAndDate($person, $now)
|
|
||||||
);
|
|
||||||
$wholeResources = array_merge(
|
|
||||||
$wholeResources,
|
|
||||||
$this->em
|
|
||||||
->getRepository(Resource::class)
|
|
||||||
->findByEntityAndDate($person, $now)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('ChillBudgetBundle:Household:index.html.twig', [
|
return $this->render('ChillBudgetBundle:Household:index.html.twig', [
|
||||||
'household' => $household,
|
'household' => $household,
|
||||||
'charges' => $charges,
|
'charges' => $charges,
|
||||||
'resources' => $ressources,
|
'resources' => $resources,
|
||||||
'wholeResources' => array_filter($wholeResources, static function (Resource $r) use ($now) {
|
|
||||||
return $r->getStartDate() <= $now && ($r->getEndDate() === null || $r->getEndDate() >= $now);
|
|
||||||
}),
|
|
||||||
'wholeCharges' => array_filter($wholeCharges, static function (Charge $c) use ($now) {
|
|
||||||
return $c->getStartDate() <= $now && ($c->getEndDate() === null || $c->getEndDate() >= $now);
|
|
||||||
}),
|
|
||||||
'results' => $results ?? [],
|
'results' => $results ?? [],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -12,12 +12,17 @@ declare(strict_types=1);
|
|||||||
namespace Chill\BudgetBundle\Entity;
|
namespace Chill\BudgetBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of charge.
|
* Type of charge.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="chill_budget.charge_type")
|
* @ORM\Table(name="chill_budget.charge_type",
|
||||||
|
* uniqueConstraints={@ORM\UniqueConstraint(name="charge_kind_unique_type_idx", fields={"kind"})}
|
||||||
|
* )
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
|
* @UniqueEntity(fields={"kind"})
|
||||||
*/
|
*/
|
||||||
class ChargeKind
|
class ChargeKind
|
||||||
{
|
{
|
||||||
@@ -35,6 +40,8 @@ class ChargeKind
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=255, options={"default": ""}, nullable=false)
|
* @ORM\Column(type="string", length=255, options={"default": ""}, nullable=false)
|
||||||
|
* @Assert\Regex(pattern="/^[a-z0-9\-_]{1,}$/", message="budget.admin.form.kind.only_alphanumeric")
|
||||||
|
* @Assert\Length(min=3)
|
||||||
*/
|
*/
|
||||||
private string $kind = '';
|
private string $kind = '';
|
||||||
|
|
||||||
|
@@ -12,12 +12,17 @@ declare(strict_types=1);
|
|||||||
namespace Chill\BudgetBundle\Entity;
|
namespace Chill\BudgetBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of resource.
|
* Type of resource.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="chill_budget.resource_type")
|
* @ORM\Table(name="chill_budget.resource_type", uniqueConstraints={
|
||||||
|
* @ORM\UniqueConstraint(name="resource_kind_unique_type_idx", fields={"kind"})
|
||||||
|
* })
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
|
* @UniqueEntity(fields={"kind"})
|
||||||
*/
|
*/
|
||||||
class ResourceKind
|
class ResourceKind
|
||||||
{
|
{
|
||||||
@@ -35,6 +40,8 @@ class ResourceKind
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=255, nullable=false, options={"default": ""})
|
* @ORM\Column(type="string", length=255, nullable=false, options={"default": ""})
|
||||||
|
* @Assert\Regex(pattern="/^[a-z0-9\-_]{1,}$/", message="budget.admin.form.kind.only_alphanumeric")
|
||||||
|
* @Assert\Length(min=3)
|
||||||
*/
|
*/
|
||||||
private string $kind = '';
|
private string $kind = '';
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@@ -25,7 +26,11 @@ class ChargeKindType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('name', TranslatableStringFormType::class, [
|
->add('name', TranslatableStringFormType::class, [
|
||||||
'label' => 'Nom',
|
'label' => 'Title',
|
||||||
|
])
|
||||||
|
->add('kind', TextType::class, [
|
||||||
|
'label' => 'budget.admin.form.Charge_kind_key',
|
||||||
|
'help' => 'budget.admin.form.This kind must contains only alphabeticals characters, and dashes. This string is in use during document generation. Changes may have side effect on document',
|
||||||
])
|
])
|
||||||
->add('ordering', NumberType::class)
|
->add('ordering', NumberType::class)
|
||||||
->add('isActive', CheckboxType::class, [
|
->add('isActive', CheckboxType::class, [
|
||||||
|
@@ -16,6 +16,7 @@ use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@@ -25,7 +26,11 @@ class ResourceKindType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('name', TranslatableStringFormType::class, [
|
->add('name', TranslatableStringFormType::class, [
|
||||||
'label' => 'Nom',
|
'label' => 'Title',
|
||||||
|
])
|
||||||
|
->add('kind', TextType::class, [
|
||||||
|
'label' => 'budget.admin.form.Resource_kind_key',
|
||||||
|
'help' => 'budget.admin.form.This kind must contains only alphabeticals characters, and dashes. This string is in use during document generation. Changes may have side effect on document',
|
||||||
])
|
])
|
||||||
->add('ordering', NumberType::class)
|
->add('ordering', NumberType::class)
|
||||||
->add('isActive', CheckboxType::class, [
|
->add('isActive', CheckboxType::class, [
|
||||||
|
@@ -14,9 +14,8 @@ namespace Chill\BudgetBundle\Repository;
|
|||||||
use Chill\BudgetBundle\Entity\ChargeKind;
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\Persistence\ObjectRepository;
|
|
||||||
|
|
||||||
class ChargeKindRepository implements ObjectRepository
|
final class ChargeKindRepository implements ChargeKindRepositoryInterface
|
||||||
{
|
{
|
||||||
private EntityRepository $repository;
|
private EntityRepository $repository;
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ class ChargeKindRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ChargeType[]
|
* @return array<ChargeKind>
|
||||||
*/
|
*/
|
||||||
public function findAll(): array
|
public function findAll(): array
|
||||||
{
|
{
|
||||||
@@ -39,7 +38,7 @@ class ChargeKindRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ChargeType[]
|
* @return array<ChargeKind>
|
||||||
*/
|
*/
|
||||||
public function findAllActive(): array
|
public function findAllActive(): array
|
||||||
{
|
{
|
||||||
@@ -54,7 +53,7 @@ class ChargeKindRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ChargeType[]
|
* @return array<ChargeKind>
|
||||||
*/
|
*/
|
||||||
public function findAllByType(string $type): array
|
public function findAllByType(string $type): array
|
||||||
{
|
{
|
||||||
@@ -65,7 +64,7 @@ class ChargeKindRepository implements ObjectRepository
|
|||||||
* @param mixed|null $limit
|
* @param mixed|null $limit
|
||||||
* @param mixed|null $offset
|
* @param mixed|null $offset
|
||||||
*
|
*
|
||||||
* @return ChargeType[]
|
* @return array<ChargeKind>
|
||||||
*/
|
*/
|
||||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||||
{
|
{
|
||||||
@@ -77,6 +76,11 @@ class ChargeKindRepository implements ObjectRepository
|
|||||||
return $this->repository->findOneBy($criteria);
|
return $this->repository->findOneBy($criteria);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findOneByKind(string $kind): ?ChargeKind
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy(['kind' => $kind]);
|
||||||
|
}
|
||||||
|
|
||||||
public function getClassName(): string
|
public function getClassName(): string
|
||||||
{
|
{
|
||||||
return ChargeKind::class;
|
return ChargeKind::class;
|
||||||
|
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
|
interface ChargeKindRepositoryInterface extends ObjectRepository
|
||||||
|
{
|
||||||
|
public function find($id): ?ChargeKind;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<ChargeKind>
|
||||||
|
*/
|
||||||
|
public function findAll(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<ChargeKind>
|
||||||
|
*/
|
||||||
|
public function findAllActive(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<ChargeKind>
|
||||||
|
*/
|
||||||
|
public function findAllByType(string $type): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int|null $limit
|
||||||
|
* @param int|null $offset
|
||||||
|
*
|
||||||
|
* @return array<ChargeKind>
|
||||||
|
*/
|
||||||
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
||||||
|
|
||||||
|
public function findOneBy(array $criteria): ?ChargeKind;
|
||||||
|
|
||||||
|
public function findOneByKind(string $kind): ?ChargeKind;
|
||||||
|
|
||||||
|
public function getClassName(): string;
|
||||||
|
}
|
@@ -11,9 +11,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Repository;
|
namespace Chill\BudgetBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\Charge;
|
||||||
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ChargeRepository.
|
* ChargeRepository.
|
||||||
@@ -21,24 +24,44 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class ChargeRepository extends EntityRepository
|
class ChargeRepository extends ServiceEntityRepository
|
||||||
{
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Charge::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Charge[]
|
||||||
|
*/
|
||||||
|
public function findAllByEntity(Person|Household $entity): array
|
||||||
|
{
|
||||||
|
$qb = $this->createQueryBuilder('c');
|
||||||
|
|
||||||
|
$property = $entity instanceof Person ? 'person' : 'household';
|
||||||
|
|
||||||
|
$qb->where("c.{$property} = :entity")
|
||||||
|
->setParameter('entity', $entity);
|
||||||
|
|
||||||
|
return $qb->getQuery()->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
public function findByEntityAndDate($entity, DateTime $date, $sort = null)
|
public function findByEntityAndDate($entity, DateTime $date, $sort = null)
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('c');
|
$qb = $this->createQueryBuilder('c');
|
||||||
|
|
||||||
$entityStr = $entity instanceof Person ? 'person' : 'household';
|
$entityStr = $entity instanceof Person ? 'person' : 'household';
|
||||||
|
|
||||||
$qb->where("c.{$entityStr} = :{$entityStr}")
|
$qb->where("c.{$entityStr} = :entity")
|
||||||
->andWhere('c.startDate < :date')
|
->andWhere('c.startDate <= :date')
|
||||||
->andWhere('c.startDate < :date OR c.startDate IS NULL');
|
->andWhere('c.endDate > :date OR c.endDate IS NULL');
|
||||||
|
|
||||||
if (null !== $sort) {
|
if (null !== $sort) {
|
||||||
$qb->orderBy($sort);
|
$qb->orderBy($sort);
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->setParameters([
|
$qb->setParameters([
|
||||||
$entityStr => $entity,
|
'entity' => $entity,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@@ -14,9 +14,8 @@ namespace Chill\BudgetBundle\Repository;
|
|||||||
use Chill\BudgetBundle\Entity\ResourceKind;
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\Persistence\ObjectRepository;
|
|
||||||
|
|
||||||
class ResourceKindRepository implements ObjectRepository
|
final class ResourceKindRepository implements ResourceKindRepositoryInterface
|
||||||
{
|
{
|
||||||
private EntityRepository $repository;
|
private EntityRepository $repository;
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ class ResourceKindRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ResourceType[]
|
* @return list<ResourceKind>
|
||||||
*/
|
*/
|
||||||
public function findAll(): array
|
public function findAll(): array
|
||||||
{
|
{
|
||||||
@@ -39,7 +38,7 @@ class ResourceKindRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ResourceType[]
|
* @return list<ResourceKind>
|
||||||
*/
|
*/
|
||||||
public function findAllActive(): array
|
public function findAllActive(): array
|
||||||
{
|
{
|
||||||
@@ -59,7 +58,7 @@ class ResourceKindRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ResourceType[]
|
* @return list<ResourceKind>
|
||||||
*/
|
*/
|
||||||
public function findAllByType(string $type): array
|
public function findAllByType(string $type): array
|
||||||
{
|
{
|
||||||
@@ -70,7 +69,7 @@ class ResourceKindRepository implements ObjectRepository
|
|||||||
* @param mixed|null $limit
|
* @param mixed|null $limit
|
||||||
* @param mixed|null $offset
|
* @param mixed|null $offset
|
||||||
*
|
*
|
||||||
* @return ResourceType[]
|
* @return list<ResourceKind>
|
||||||
*/
|
*/
|
||||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||||
{
|
{
|
||||||
|
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
|
interface ResourceKindRepositoryInterface extends ObjectRepository
|
||||||
|
{
|
||||||
|
public function find($id): ?ResourceKind;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<ResourceKind>
|
||||||
|
*/
|
||||||
|
public function findAll(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<ResourceKind>
|
||||||
|
*/
|
||||||
|
public function findAllActive(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<ResourceKind>
|
||||||
|
*/
|
||||||
|
public function findAllByType(string $type): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int|null $limit
|
||||||
|
* @param int|null $offset
|
||||||
|
*
|
||||||
|
* @return list<ResourceKind>
|
||||||
|
*/
|
||||||
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
||||||
|
|
||||||
|
public function findOneBy(array $criteria): ?ResourceKind;
|
||||||
|
|
||||||
|
public function findOneByKind(string $kind): ?ResourceKind;
|
||||||
|
|
||||||
|
public function getClassName(): string;
|
||||||
|
}
|
@@ -11,9 +11,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Repository;
|
namespace Chill\BudgetBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\Resource;
|
||||||
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResourceRepository.
|
* ResourceRepository.
|
||||||
@@ -21,28 +25,45 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class ResourceRepository extends EntityRepository
|
class ResourceRepository extends ServiceEntityRepository
|
||||||
{
|
{
|
||||||
public function findByEntityAndDate($entity, DateTime $date, $sort = null)
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Resource::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Resource[]
|
||||||
|
*/
|
||||||
|
public function findAllByEntity(Person|Household $entity): array
|
||||||
|
{
|
||||||
|
$qb = $this->createQueryBuilder('r');
|
||||||
|
|
||||||
|
$property = $entity instanceof Person ? 'person' : 'household';
|
||||||
|
|
||||||
|
$qb->where("r.{$property} = :entity")
|
||||||
|
->setParameter('entity', $entity);
|
||||||
|
|
||||||
|
return $qb->getQuery()->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findByEntityAndDate(Person|Household $entity, DateTime $date, $sort = null)
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('c');
|
$qb = $this->createQueryBuilder('c');
|
||||||
|
|
||||||
$entityStr = $entity instanceof Person ? 'person' : 'household';
|
$entityStr = $entity instanceof Person ? 'person' : 'household';
|
||||||
|
|
||||||
$qb->where("c.{$entityStr} = :{$entityStr}")
|
$qb->where("c.{$entityStr} = :entity")
|
||||||
// TODO: in controller, the budget and charges asked are also for future and actual
|
->andWhere('c.startDate <= :date')
|
||||||
//->andWhere('c.startDate < :date')
|
->andWhere('c.endDate > :date OR c.endDate IS NULL');
|
||||||
// TODO: there is a misconception here, the end date must be lower or null. startDate are never null
|
|
||||||
//->andWhere('c.startDate < :date OR c.startDate IS NULL');
|
|
||||||
;
|
|
||||||
|
|
||||||
if (null !== $sort) {
|
if (null !== $sort) {
|
||||||
$qb->orderBy($sort);
|
$qb->orderBy($sort);
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->setParameters([
|
$qb->setParameters([
|
||||||
$entityStr => $entity,
|
'entity' => $entity,
|
||||||
//'date' => $date,
|
'date' => $date,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
|
@@ -19,7 +19,10 @@
|
|||||||
{% for entity in entities %}
|
{% for entity in entities %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ entity.ordering }}</td>
|
<td>{{ entity.ordering }}</td>
|
||||||
<td>{{ entity|chill_entity_render_box }}</td>
|
<td>
|
||||||
|
{{ entity|chill_entity_render_box }}<br/>
|
||||||
|
<strong>{{ 'budget.admin.form.Charge_kind_key'|trans }} :</strong> <code>{{ entity.kind }}</code>
|
||||||
|
</td>
|
||||||
<td style="text-align:center;">
|
<td style="text-align:center;">
|
||||||
{%- if entity.isActive -%}
|
{%- if entity.isActive -%}
|
||||||
<i class="fa fa-check-square-o"></i>
|
<i class="fa fa-check-square-o"></i>
|
||||||
@@ -39,6 +42,8 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{{ chill_pagination(paginator) }}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_crud_charge_kind_new') }}" class="btn btn-create">
|
<a href="{{ path('chill_crud_charge_kind_new') }}" class="btn btn-create">
|
||||||
|
@@ -19,7 +19,10 @@
|
|||||||
{% for entity in entities %}
|
{% for entity in entities %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ entity.ordering }}</td>
|
<td>{{ entity.ordering }}</td>
|
||||||
<td>{{ entity|chill_entity_render_box }}</td>
|
<td>
|
||||||
|
{{ entity|chill_entity_render_box }}<br/>
|
||||||
|
<strong>{{ 'budget.admin.form.Resource_kind_key'|trans }} :</strong> <code>{{ entity.kind }}</code>
|
||||||
|
</td>
|
||||||
<td style="text-align:center;">
|
<td style="text-align:center;">
|
||||||
{%- if entity.isActive -%}
|
{%- if entity.isActive -%}
|
||||||
<i class="fa fa-check-square-o"></i>
|
<i class="fa fa-check-square-o"></i>
|
||||||
@@ -39,6 +42,8 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{{ chill_pagination(paginator) }}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_crud_resource_kind_new') }}" class="btn btn-create">
|
<a href="{{ path('chill_crud_resource_kind_new') }}" class="btn btn-create">
|
||||||
|
@@ -13,8 +13,8 @@ namespace Chill\BudgetBundle\Service\Summary;
|
|||||||
|
|
||||||
use Chill\BudgetBundle\Entity\ChargeKind;
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
use Chill\BudgetBundle\Entity\ResourceKind;
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
use Chill\BudgetBundle\Repository\ChargeKindRepository;
|
use Chill\BudgetBundle\Repository\ChargeKindRepositoryInterface;
|
||||||
use Chill\BudgetBundle\Repository\ResourceKindRepository;
|
use Chill\BudgetBundle\Repository\ResourceKindRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
@@ -27,7 +27,7 @@ use function count;
|
|||||||
/**
|
/**
|
||||||
* Helps to find a summary of the budget: the sum of resources and charges.
|
* Helps to find a summary of the budget: the sum of resources and charges.
|
||||||
*/
|
*/
|
||||||
class SummaryBudget implements SummaryBudgetInterface
|
final class SummaryBudget implements SummaryBudgetInterface
|
||||||
{
|
{
|
||||||
private const QUERY_CHARGE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id';
|
private const QUERY_CHARGE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id';
|
||||||
|
|
||||||
@@ -37,23 +37,19 @@ class SummaryBudget implements SummaryBudgetInterface
|
|||||||
|
|
||||||
private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id';
|
private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id';
|
||||||
|
|
||||||
private ChargeKindRepository $chargeKindRepository;
|
private ChargeKindRepositoryInterface $chargeKindRepository;
|
||||||
|
|
||||||
private array $chargeLabels;
|
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
private EntityManagerInterface $em;
|
||||||
|
|
||||||
private ResourceKindRepository $resourceKindRepository;
|
private ResourceKindRepositoryInterface $resourceKindRepository;
|
||||||
|
|
||||||
private array $resourcesLabels;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
ResourceKindRepository $resourceKindRepository,
|
ResourceKindRepositoryInterface $resourceKindRepository,
|
||||||
ChargeKindRepository $chargeKindRepository
|
ChargeKindRepositoryInterface $chargeKindRepository
|
||||||
) {
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
@@ -129,19 +125,19 @@ class SummaryBudget implements SummaryBudgetInterface
|
|||||||
|
|
||||||
private function getEmptyChargeArray(): array
|
private function getEmptyChargeArray(): array
|
||||||
{
|
{
|
||||||
$keys = array_map(static fn (ChargeKind $kind) => $kind->getId(), $this->chargeKindRepository->findAll());
|
$keys = array_map(static fn (ChargeKind $kind) => $kind->getKind(), $this->chargeKindRepository->findAll());
|
||||||
|
|
||||||
return array_combine($keys, array_map(function ($id) {
|
return array_combine($keys, array_map(function ($kind) {
|
||||||
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->chargeKindRepository->find($id)->getName()), 'comment' => ''];
|
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->chargeKindRepository->findOneByKind($kind)->getName()), 'comment' => ''];
|
||||||
}, $keys));
|
}, $keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getEmptyResourceArray(): array
|
private function getEmptyResourceArray(): array
|
||||||
{
|
{
|
||||||
$keys = array_map(static fn (ResourceKind $kind) => $kind->getId(), $this->resourceKindRepository->findAll());
|
$keys = array_map(static fn (ResourceKind $kind) => $kind->getKind(), $this->resourceKindRepository->findAll());
|
||||||
|
|
||||||
return array_combine($keys, array_map(function ($id) {
|
return array_combine($keys, array_map(function ($kind) {
|
||||||
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->resourceKindRepository->find($id)->getName()), 'comment' => ''];
|
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->resourceKindRepository->findOneByKind($kind)->getName()), 'comment' => ''];
|
||||||
}, $keys));
|
}, $keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +151,7 @@ class SummaryBudget implements SummaryBudgetInterface
|
|||||||
$chargeKind = $this->chargeKindRepository->find($row['kind_id']);
|
$chargeKind = $this->chargeKindRepository->find($row['kind_id']);
|
||||||
|
|
||||||
if (null === $chargeKind) {
|
if (null === $chargeKind) {
|
||||||
throw new RuntimeException('charge kind not found');
|
throw new RuntimeException('charge kind not found: ' . $row['kind_id']);
|
||||||
}
|
}
|
||||||
$result[$chargeKind->getKind()] = [
|
$result[$chargeKind->getKind()] = [
|
||||||
'sum' => (float) $row['sum'],
|
'sum' => (float) $row['sum'],
|
||||||
@@ -171,7 +167,7 @@ class SummaryBudget implements SummaryBudgetInterface
|
|||||||
$resourceKind = $this->resourceKindRepository->find($row['kind_id']);
|
$resourceKind = $this->resourceKindRepository->find($row['kind_id']);
|
||||||
|
|
||||||
if (null === $resourceKind) {
|
if (null === $resourceKind) {
|
||||||
throw new RuntimeException('charge kind not found');
|
throw new RuntimeException('charge kind not found: ' . $row['kind_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result[$resourceKind->getKind()] = [
|
$result[$resourceKind->getKind()] = [
|
||||||
|
@@ -17,6 +17,9 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
|||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Symfony\Component\Templating\EngineInterface;
|
use Symfony\Component\Templating\EngineInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements ChillEntityRenderInterface<ResourceKind|ChargeKind>
|
||||||
|
*/
|
||||||
final class BudgetElementTypeRender implements ChillEntityRenderInterface
|
final class BudgetElementTypeRender implements ChillEntityRenderInterface
|
||||||
{
|
{
|
||||||
private EngineInterface $engine;
|
private EngineInterface $engine;
|
||||||
|
@@ -0,0 +1,159 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Tests\Service\Summary;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Chill\BudgetBundle\Repository\ChargeKindRepositoryInterface;
|
||||||
|
use Chill\BudgetBundle\Repository\ResourceKindRepositoryInterface;
|
||||||
|
use Chill\BudgetBundle\Service\Summary\SummaryBudget;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
|
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||||
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use DateTimeImmutable;
|
||||||
|
use Doctrine\ORM\AbstractQuery;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\ORM\Query;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Prophecy\Argument;
|
||||||
|
use Prophecy\PhpUnit\ProphecyTrait;
|
||||||
|
use ReflectionClass;
|
||||||
|
use RuntimeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
|
final class SummaryBudgetTest extends TestCase
|
||||||
|
{
|
||||||
|
use ProphecyTrait;
|
||||||
|
|
||||||
|
public function testGenerateSummaryForPerson(): void
|
||||||
|
{
|
||||||
|
$queryCharges = $this->prophesize(AbstractQuery::class);
|
||||||
|
$queryCharges->getResult()->willReturn([
|
||||||
|
[
|
||||||
|
'sum' => 250.0,
|
||||||
|
'comment' => '',
|
||||||
|
'kind_id' => 1, // kind: rental
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
$queryCharges->setParameters(Argument::type('array'))
|
||||||
|
->will(static function ($args, $query) {
|
||||||
|
return $query;
|
||||||
|
});
|
||||||
|
|
||||||
|
$queryResources = $this->prophesize(AbstractQuery::class);
|
||||||
|
$queryResources->getResult()->willReturn([
|
||||||
|
[
|
||||||
|
'sum' => 1500.0,
|
||||||
|
'comment' => '',
|
||||||
|
'kind_id' => 2, // kind: 'salary',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
$queryResources->setParameters(Argument::type('array'))
|
||||||
|
->will(static function ($args, $query) {
|
||||||
|
return $query;
|
||||||
|
});
|
||||||
|
|
||||||
|
$em = $this->prophesize(EntityManagerInterface::class);
|
||||||
|
$em->createNativeQuery(Argument::type('string'), Argument::type(Query\ResultSetMapping::class))
|
||||||
|
->will(static function ($args) use ($queryResources, $queryCharges) {
|
||||||
|
if (false !== strpos($args[0], 'chill_budget.resource')) {
|
||||||
|
return $queryResources->reveal();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false !== strpos($args[0], 'chill_budget.charge')) {
|
||||||
|
return $queryCharges->reveal();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException('this query does not have a stub counterpart: ' . $args[0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$chargeRepository = $this->prophesize(ChargeKindRepositoryInterface::class);
|
||||||
|
$chargeRepository->findAll()->willReturn([
|
||||||
|
$rental = (new ChargeKind())->setKind('rental')->setName(['fr' => 'Rental']),
|
||||||
|
$other = (new ChargeKind())->setKind('other')->setName(['fr' => 'Other']),
|
||||||
|
]);
|
||||||
|
$chargeRepository->find(1)->willReturn($rental);
|
||||||
|
$chargeRepository->findOneByKind('rental')->willReturn($rental);
|
||||||
|
$chargeRepository->findOneByKind('other')->willReturn($other);
|
||||||
|
|
||||||
|
$resourceRepository = $this->prophesize(ResourceKindRepositoryInterface::class);
|
||||||
|
$resourceRepository->findAll()->willReturn([
|
||||||
|
$salary = (new ResourceKind())->setKind('salary')->setName(['fr' => 'Salary']),
|
||||||
|
$misc = (new ResourceKind())->setKind('misc')->setName(['fr' => 'Misc']),
|
||||||
|
]);
|
||||||
|
$resourceRepository->find(2)->willReturn($salary);
|
||||||
|
$resourceRepository->findOneByKind('salary')->willReturn($salary);
|
||||||
|
$resourceRepository->findOneByKind('misc')->willReturn($misc);
|
||||||
|
|
||||||
|
$translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class);
|
||||||
|
$translatableStringHelper->localize(Argument::type('array'))->will(static function ($arg) {
|
||||||
|
return $arg[0]['fr'];
|
||||||
|
});
|
||||||
|
|
||||||
|
$person = new Person();
|
||||||
|
$personReflection = new ReflectionClass($person);
|
||||||
|
$personIdReflection = $personReflection->getProperty('id');
|
||||||
|
$personIdReflection->setAccessible(true);
|
||||||
|
$personIdReflection->setValue($person, 1);
|
||||||
|
|
||||||
|
$household = new Household();
|
||||||
|
$householdReflection = new ReflectionClass($household);
|
||||||
|
$householdId = $householdReflection->getProperty('id');
|
||||||
|
$householdId->setAccessible(true);
|
||||||
|
$householdId->setValue($household, 1);
|
||||||
|
$householdMember = (new HouseholdMember())->setPerson($person)
|
||||||
|
->setStartDate(new DateTimeImmutable('1 month ago'));
|
||||||
|
$household->addMember($householdMember);
|
||||||
|
|
||||||
|
$summaryBudget = new SummaryBudget(
|
||||||
|
$em->reveal(),
|
||||||
|
$translatableStringHelper->reveal(),
|
||||||
|
$resourceRepository->reveal(),
|
||||||
|
$chargeRepository->reveal()
|
||||||
|
);
|
||||||
|
|
||||||
|
$summary = $summaryBudget->getSummaryForPerson($person);
|
||||||
|
$summaryForHousehold = $summaryBudget->getSummaryForHousehold($household);
|
||||||
|
|
||||||
|
// we check the structure for the summary. The structure is the same for household
|
||||||
|
// and persons
|
||||||
|
|
||||||
|
$expected = [
|
||||||
|
'charges' => [
|
||||||
|
'rental' => ['sum' => 250.0, 'comment' => '', 'label' => 'Rental'],
|
||||||
|
'other' => ['sum' => 0.0, 'comment' => '', 'label' => 'Other'],
|
||||||
|
],
|
||||||
|
'resources' => [
|
||||||
|
'salary' => ['sum' => 1500.0, 'comment' => '', 'label' => 'Salary'],
|
||||||
|
'misc' => ['sum' => 0.0, 'comment' => '', 'label' => 'Misc'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ([$summaryForHousehold, $summary] as $summary) {
|
||||||
|
$this->assertIsArray($summary);
|
||||||
|
$this->assertEqualsCanonicalizing(['charges', 'resources'], array_keys($summary));
|
||||||
|
$this->assertEqualsCanonicalizing(['rental', 'other'], array_keys($summary['charges']));
|
||||||
|
$this->assertEqualsCanonicalizing(['salary', 'misc'], array_keys($summary['resources']));
|
||||||
|
|
||||||
|
foreach ($expected as $resCha => $contains) {
|
||||||
|
foreach ($contains as $kind => $row) {
|
||||||
|
$this->assertEqualsCanonicalizing($row, $summary[$resCha][$kind]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20230209161546 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('DROP INDEX resource_kind_unique_type_idx');
|
||||||
|
$this->addSql('DROP INDEX charge_kind_unique_type_idx');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Budget: add unique constraint on kind for charge_kind and resource_kind';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql("UPDATE chill_budget.resource_type SET kind=md5(random()::text) WHERE kind = ''");
|
||||||
|
$this->addSql("UPDATE chill_budget.charge_type SET kind=md5(random()::text) WHERE kind = ''");
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX resource_kind_unique_type_idx ON chill_budget.resource_type (kind);');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX charge_kind_unique_type_idx ON chill_budget.charge_type (kind);');
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20230328155010 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'budget elements: restore the previous type to resource/charge kind if applicable';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql(<<<'SQL'
|
||||||
|
WITH type_to_id AS (
|
||||||
|
SELECT DISTINCT charge.charge_id AS id, charge.type
|
||||||
|
FROM chill_budget.charge
|
||||||
|
WHERE type <> ''
|
||||||
|
)
|
||||||
|
UPDATE chill_budget.charge_type
|
||||||
|
SET kind = type_to_id.type
|
||||||
|
FROM type_to_id
|
||||||
|
WHERE type_to_id.type <> '' AND type_to_id.id = charge_type.id
|
||||||
|
SQL);
|
||||||
|
|
||||||
|
$this->addSql(<<<'SQL'
|
||||||
|
WITH type_to_id AS (
|
||||||
|
SELECT DISTINCT resource.resource_id AS id, resource.type
|
||||||
|
FROM chill_budget. resource
|
||||||
|
WHERE type <> ''
|
||||||
|
)
|
||||||
|
UPDATE chill_budget.resource_type
|
||||||
|
SET kind = type_to_id.type
|
||||||
|
FROM type_to_id
|
||||||
|
WHERE type_to_id.type <> '' AND type_to_id.id = resource_type.id
|
||||||
|
SQL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql("UPDATE chill_budget.resource_type SET kind=md5(random()::text) WHERE kind = ''");
|
||||||
|
$this->addSql("UPDATE chill_budget.charge_type SET kind=md5(random()::text) WHERE kind = ''");
|
||||||
|
}
|
||||||
|
}
|
@@ -77,6 +77,13 @@ The balance: Différence entre ressources et charges
|
|||||||
Valid since %startDate% until %endDate%: Valide depuis le %startDate% jusqu'au %endDate%
|
Valid since %startDate% until %endDate%: Valide depuis le %startDate% jusqu'au %endDate%
|
||||||
Valid since %startDate%: Valide depuis le %startDate%
|
Valid since %startDate%: Valide depuis le %startDate%
|
||||||
|
|
||||||
|
budget:
|
||||||
|
admin:
|
||||||
|
form:
|
||||||
|
Charge_kind_key: Clé d'identification
|
||||||
|
Resource_kind_key: Clé d'identification
|
||||||
|
This kind must contains only alphabeticals characters, and dashes. This string is in use during document generation. Changes may have side effect on document: Cette clé sert à identifier le type de charge ou de revenu lors de la génération de document. Seuls les caractères alpha-numériques sont autorisés. Modifier cette clé peut avoir un effet lors de la génération de nouveaux documents.
|
||||||
|
|
||||||
# ROLES
|
# ROLES
|
||||||
Budget elements: Budget
|
Budget elements: Budget
|
||||||
CHILL_BUDGET_ELEMENT_CREATE: Créer une ressource/charge
|
CHILL_BUDGET_ELEMENT_CREATE: Créer une ressource/charge
|
||||||
|
@@ -2,8 +2,8 @@ Budget: Budget
|
|||||||
Resource: Inkomsten
|
Resource: Inkomsten
|
||||||
Charge: Onkosten
|
Charge: Onkosten
|
||||||
Budget for %name%: Budget van %name%
|
Budget for %name%: Budget van %name%
|
||||||
Budget for household %household%: Budget van gezin
|
Budget for household %household%: Budget van huishouden
|
||||||
Current budget household members: Actuele budget van gezinsleden
|
Current budget household members: Actuele budget van leden huishouden
|
||||||
Show budget of %name%: Toon budget van %name%
|
Show budget of %name%: Toon budget van %name%
|
||||||
See complete budget: Toon volledige budget
|
See complete budget: Toon volledige budget
|
||||||
Hide budget: Verbergen
|
Hide budget: Verbergen
|
||||||
|
@@ -1,2 +1,8 @@
|
|||||||
The amount cannot be empty: Le montant ne peut pas être vide ou égal à zéro
|
The amount cannot be empty: Le montant ne peut pas être vide ou égal à zéro
|
||||||
The budget element's end date must be after the start date: La date de fin doit être après la date de début
|
The budget element's end date must be after the start date: La date de fin doit être après la date de début
|
||||||
|
|
||||||
|
budget:
|
||||||
|
admin:
|
||||||
|
form:
|
||||||
|
kind:
|
||||||
|
only_alphanumeric
|
||||||
|
@@ -544,21 +544,6 @@ class CalendarController extends AbstractController
|
|||||||
return $filterOrder->build();
|
return $filterOrder->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildParamsToUrl(?User $user, ?AccompanyingPeriod $accompanyingPeriod): array
|
|
||||||
{
|
|
||||||
$params = [];
|
|
||||||
|
|
||||||
if (null !== $user) {
|
|
||||||
$params['user_id'] = $user->getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null !== $accompanyingPeriod) {
|
|
||||||
$params['id'] = $accompanyingPeriod->getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $params;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a form to delete a Calendar entity by id.
|
* Creates a form to delete a Calendar entity by id.
|
||||||
*/
|
*/
|
||||||
|
@@ -61,7 +61,7 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
|||||||
->setEmail('centreA@test.chill.social')
|
->setEmail('centreA@test.chill.social')
|
||||||
->setLocationType($type = new LocationType())
|
->setLocationType($type = new LocationType())
|
||||||
->setPhonenumber1(PhoneNumberUtil::getInstance()->parse('+3287653812'));
|
->setPhonenumber1(PhoneNumberUtil::getInstance()->parse('+3287653812'));
|
||||||
$type->setTitle('Service');
|
$type->setTitle(['fr' => 'Service']);
|
||||||
$address->setStreet('Rue des Épaules')->setStreetNumber('14')
|
$address->setStreet('Rue des Épaules')->setStreetNumber('14')
|
||||||
->setPostcode($postCode = new PostalCode());
|
->setPostcode($postCode = new PostalCode());
|
||||||
$postCode->setCode('4145')->setName('Houte-Si-Plout')->setCountry(
|
$postCode->setCode('4145')->setName('Houte-Si-Plout')->setCountry(
|
||||||
|
@@ -12,6 +12,8 @@ declare(strict_types=1);
|
|||||||
namespace Chill\CalendarBundle\DataFixtures\ORM;
|
namespace Chill\CalendarBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\CalendarBundle\Entity\Invite;
|
use Chill\CalendarBundle\Entity\Invite;
|
||||||
|
use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
|
||||||
|
use Chill\MainBundle\Entity\User;
|
||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
@@ -33,14 +35,21 @@ class LoadInvite extends Fixture implements FixtureGroupInterface
|
|||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$arr = [
|
$arr = [
|
||||||
['name' => ['fr' => 'Rendez-vous décliné']],
|
[
|
||||||
['name' => ['fr' => 'Rendez-vous accepté']],
|
'name' => ['fr' => 'Rendez-vous décliné'],
|
||||||
|
'status' => Invite::DECLINED,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => ['fr' => 'Rendez-vous accepté'],
|
||||||
|
'status' => Invite::ACCEPTED,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($arr as $a) {
|
foreach ($arr as $a) {
|
||||||
echo 'Creating calendar invite : ' . $a['name']['fr'] . "\n";
|
echo 'Creating calendar invite : ' . $a['name']['fr'] . "\n";
|
||||||
$invite = (new Invite())
|
$invite = (new Invite())
|
||||||
->setStatus($a['name']);
|
->setStatus($a['status'])
|
||||||
|
->setUser($this->getRandomUser());
|
||||||
$manager->persist($invite);
|
$manager->persist($invite);
|
||||||
$reference = 'Invite_' . $a['name']['fr'];
|
$reference = 'Invite_' . $a['name']['fr'];
|
||||||
$this->addReference($reference, $invite);
|
$this->addReference($reference, $invite);
|
||||||
@@ -49,4 +58,11 @@ class LoadInvite extends Fixture implements FixtureGroupInterface
|
|||||||
|
|
||||||
$manager->flush();
|
$manager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getRandomUser(): User
|
||||||
|
{
|
||||||
|
$userRef = array_rand(LoadUsers::$refs);
|
||||||
|
|
||||||
|
return $this->getReference($userRef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@ use DateTimeImmutable;
|
|||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\Common\Collections\Criteria;
|
use Doctrine\Common\Collections\Criteria;
|
||||||
|
use Doctrine\Common\Collections\ReadableCollection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||||
@@ -507,10 +508,10 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Collection|User[]
|
* @return ReadableCollection<(int|string), User>
|
||||||
* @Serializer\Groups({"calendar:read", "read"})
|
* @Serializer\Groups({"calendar:read", "read"})
|
||||||
*/
|
*/
|
||||||
public function getUsers(): Collection
|
public function getUsers(): ReadableCollection
|
||||||
{
|
{
|
||||||
return $this->getInvites()->map(static function (Invite $i) {
|
return $this->getInvites()->map(static function (Invite $i) {
|
||||||
return $i->getUser();
|
return $i->getUser();
|
||||||
|
@@ -44,14 +44,7 @@ class UrgencyAggregator implements AggregatorInterface
|
|||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb->addSelect('cal.urgent AS urgency_aggregator');
|
$qb->addSelect('cal.urgent AS urgency_aggregator');
|
||||||
|
$qb->addGroupBy('urgency_aggregator');
|
||||||
$groupBy = $qb->getDQLPart('groupBy');
|
|
||||||
|
|
||||||
if (!empty($groupBy)) {
|
|
||||||
$qb->addGroupBy('urgency_aggregator');
|
|
||||||
} else {
|
|
||||||
$qb->groupBy('urgency_aggregator');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@@ -52,7 +52,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface
|
|||||||
return 'Exports of calendar';
|
return 'Exports of calendar';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data): Closure
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_result' !== $key) {
|
if ('export_result' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new LogicException("the key {$key} is not used by this export");
|
||||||
|
@@ -49,23 +49,11 @@ class CalendarRangeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
if (null !== $data['hasCalendarRange']) {
|
||||||
|
$qb->andWhere($qb->expr()->isNotNull('cal.calendarRange'));
|
||||||
dump($data);
|
|
||||||
|
|
||||||
if ($data['hasCalendarRange']) {
|
|
||||||
$clause = $qb->expr()->isNotNull('cal.calendarRange');
|
|
||||||
} else {
|
} else {
|
||||||
$clause = $qb->expr()->isNull('cal.calendarRange');
|
$qb->andWhere($qb->expr()->isNull('cal.calendarRange'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($where instanceof Andx) {
|
|
||||||
$where->add($clause);
|
|
||||||
} else {
|
|
||||||
$where = $qb->expr()->andX($clause);
|
|
||||||
}
|
|
||||||
|
|
||||||
$qb->add('where', $where);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@@ -87,6 +75,8 @@ class CalendarRangeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
|
$choice = '';
|
||||||
|
|
||||||
foreach (self::CHOICES as $k => $v) {
|
foreach (self::CHOICES as $k => $v) {
|
||||||
if ($v === $data['hasCalendarRange']) {
|
if ($v === $data['hasCalendarRange']) {
|
||||||
$choice = $k;
|
$choice = $k;
|
||||||
|
@@ -22,6 +22,9 @@ use Chill\CalendarBundle\Entity\Calendar;
|
|||||||
use Chill\CalendarBundle\Messenger\Message\CalendarMessage;
|
use Chill\CalendarBundle\Messenger\Message\CalendarMessage;
|
||||||
use Chill\CalendarBundle\Messenger\Message\CalendarRemovedMessage;
|
use Chill\CalendarBundle\Messenger\Message\CalendarRemovedMessage;
|
||||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||||
|
use Doctrine\ORM\Event\PostPersistEventArgs;
|
||||||
|
use Doctrine\ORM\Event\PostRemoveEventArgs;
|
||||||
|
use Doctrine\ORM\Event\PostUpdateEventArgs;
|
||||||
use Symfony\Component\Messenger\MessageBusInterface;
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
@@ -37,7 +40,7 @@ class CalendarEntityListener
|
|||||||
$this->security = $security;
|
$this->security = $security;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postPersist(Calendar $calendar, LifecycleEventArgs $args): void
|
public function postPersist(Calendar $calendar, PostPersistEventArgs $args): void
|
||||||
{
|
{
|
||||||
if (!$calendar->preventEnqueueChanges) {
|
if (!$calendar->preventEnqueueChanges) {
|
||||||
$this->messageBus->dispatch(
|
$this->messageBus->dispatch(
|
||||||
@@ -50,7 +53,7 @@ class CalendarEntityListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postRemove(Calendar $calendar, LifecycleEventArgs $args): void
|
public function postRemove(Calendar $calendar, PostRemoveEventArgs $args): void
|
||||||
{
|
{
|
||||||
if (!$calendar->preventEnqueueChanges) {
|
if (!$calendar->preventEnqueueChanges) {
|
||||||
$this->messageBus->dispatch(
|
$this->messageBus->dispatch(
|
||||||
@@ -62,7 +65,7 @@ class CalendarEntityListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postUpdate(Calendar $calendar, LifecycleEventArgs $args): void
|
public function postUpdate(Calendar $calendar, PostUpdateEventArgs $args): void
|
||||||
{
|
{
|
||||||
if (!$calendar->preventEnqueueChanges) {
|
if (!$calendar->preventEnqueueChanges) {
|
||||||
$this->messageBus->dispatch(
|
$this->messageBus->dispatch(
|
||||||
|
@@ -22,6 +22,9 @@ use Chill\CalendarBundle\Entity\CalendarRange;
|
|||||||
use Chill\CalendarBundle\Messenger\Message\CalendarRangeMessage;
|
use Chill\CalendarBundle\Messenger\Message\CalendarRangeMessage;
|
||||||
use Chill\CalendarBundle\Messenger\Message\CalendarRangeRemovedMessage;
|
use Chill\CalendarBundle\Messenger\Message\CalendarRangeRemovedMessage;
|
||||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||||
|
use Doctrine\ORM\Event\PostPersistEventArgs;
|
||||||
|
use Doctrine\ORM\Event\PostRemoveEventArgs;
|
||||||
|
use Doctrine\ORM\Event\PostUpdateEventArgs;
|
||||||
use Symfony\Component\Messenger\MessageBusInterface;
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
@@ -37,7 +40,7 @@ class CalendarRangeEntityListener
|
|||||||
$this->security = $security;
|
$this->security = $security;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postPersist(CalendarRange $calendarRange, LifecycleEventArgs $eventArgs): void
|
public function postPersist(CalendarRange $calendarRange, PostPersistEventArgs $eventArgs): void
|
||||||
{
|
{
|
||||||
if (!$calendarRange->preventEnqueueChanges) {
|
if (!$calendarRange->preventEnqueueChanges) {
|
||||||
$this->messageBus->dispatch(
|
$this->messageBus->dispatch(
|
||||||
@@ -50,7 +53,7 @@ class CalendarRangeEntityListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postRemove(CalendarRange $calendarRange, LifecycleEventArgs $eventArgs): void
|
public function postRemove(CalendarRange $calendarRange, PostRemoveEventArgs $eventArgs): void
|
||||||
{
|
{
|
||||||
if (!$calendarRange->preventEnqueueChanges) {
|
if (!$calendarRange->preventEnqueueChanges) {
|
||||||
$this->messageBus->dispatch(
|
$this->messageBus->dispatch(
|
||||||
@@ -62,7 +65,7 @@ class CalendarRangeEntityListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postUpdate(CalendarRange $calendarRange, LifecycleEventArgs $eventArgs): void
|
public function postUpdate(CalendarRange $calendarRange, PostUpdateEventArgs $eventArgs): void
|
||||||
{
|
{
|
||||||
if (!$calendarRange->preventEnqueueChanges) {
|
if (!$calendarRange->preventEnqueueChanges) {
|
||||||
$this->messageBus->dispatch(
|
$this->messageBus->dispatch(
|
||||||
|
@@ -22,6 +22,7 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
@@ -74,9 +75,18 @@ class MapCalendarToUser
|
|||||||
|
|
||||||
public function getDefaultUserCalendar(string $idOrUserPrincipalName): ?array
|
public function getDefaultUserCalendar(string $idOrUserPrincipalName): ?array
|
||||||
{
|
{
|
||||||
$value = $this->machineHttpClient->request('GET', "users/{$idOrUserPrincipalName}/calendars", [
|
try {
|
||||||
'query' => ['$filter' => 'isDefaultCalendar eq true'],
|
$value = $this->machineHttpClient->request('GET', "users/{$idOrUserPrincipalName}/calendars", [
|
||||||
])->toArray()['value'];
|
'query' => ['$filter' => 'isDefaultCalendar eq true'],
|
||||||
|
])->toArray()['value'];
|
||||||
|
} catch (ClientExceptionInterface $e) {
|
||||||
|
$this->logger->error('[MapCalendarToUser] Error while listing calendars for a user', [
|
||||||
|
'http_status_code' => $e->getResponse()->getStatusCode(),
|
||||||
|
'id_user' => $idOrUserPrincipalName,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return $value[0] ?? null;
|
return $value[0] ?? null;
|
||||||
}
|
}
|
||||||
|
@@ -110,11 +110,11 @@ class CalendarSyncer
|
|||||||
$endDate = RemoteEventConverter::convertStringDateWithoutTimezone($new['end']['dateTime']);
|
$endDate = RemoteEventConverter::convertStringDateWithoutTimezone($new['end']['dateTime']);
|
||||||
|
|
||||||
if ($startDate->getTimestamp() !== $calendar->getStartDate()->getTimestamp()) {
|
if ($startDate->getTimestamp() !== $calendar->getStartDate()->getTimestamp()) {
|
||||||
$calendar->setStartDate($startDate)->setStatus(Calendar::STATUS_MOVED);
|
$calendar->setStartDate($startDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($endDate->getTimestamp() !== $calendar->getEndDate()->getTimestamp()) {
|
if ($endDate->getTimestamp() !== $calendar->getEndDate()->getTimestamp()) {
|
||||||
$calendar->setEndDate($endDate)->setStatus(Calendar::STATUS_MOVED);
|
$calendar->setEndDate($endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendar
|
$calendar
|
||||||
|
@@ -34,6 +34,7 @@ use Psr\Log\LoggerInterface;
|
|||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
@@ -64,6 +65,8 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
|
|
||||||
private OnBehalfOfUserHttpClient $userHttpClient;
|
private OnBehalfOfUserHttpClient $userHttpClient;
|
||||||
|
|
||||||
|
private Security $security;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CalendarRepository $calendarRepository,
|
CalendarRepository $calendarRepository,
|
||||||
CalendarRangeRepository $calendarRangeRepository,
|
CalendarRangeRepository $calendarRangeRepository,
|
||||||
@@ -74,7 +77,8 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
OnBehalfOfUserHttpClient $userHttpClient,
|
OnBehalfOfUserHttpClient $userHttpClient,
|
||||||
RemoteEventConverter $remoteEventConverter,
|
RemoteEventConverter $remoteEventConverter,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
UrlGeneratorInterface $urlGenerator
|
UrlGeneratorInterface $urlGenerator,
|
||||||
|
Security $security
|
||||||
) {
|
) {
|
||||||
$this->calendarRepository = $calendarRepository;
|
$this->calendarRepository = $calendarRepository;
|
||||||
$this->calendarRangeRepository = $calendarRangeRepository;
|
$this->calendarRangeRepository = $calendarRangeRepository;
|
||||||
@@ -86,6 +90,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->urlGenerator = $urlGenerator;
|
$this->urlGenerator = $urlGenerator;
|
||||||
$this->userHttpClient = $userHttpClient;
|
$this->userHttpClient = $userHttpClient;
|
||||||
|
$this->security = $security;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countEventsForUser(User $user, DateTimeImmutable $startDate, DateTimeImmutable $endDate): int
|
public function countEventsForUser(User $user, DateTimeImmutable $startDate, DateTimeImmutable $endDate): int
|
||||||
@@ -133,6 +138,24 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
|
|
||||||
public function isReady(): bool
|
public function isReady(): bool
|
||||||
{
|
{
|
||||||
|
$user = $this->security->getUser();
|
||||||
|
|
||||||
|
if (!$user instanceof User) {
|
||||||
|
// this is not a user from chill. This is not the role of this class to
|
||||||
|
// restrict access, so we will just say that we do not have to do anything more
|
||||||
|
// here...
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $this->mapCalendarToUser->getUserId($user)) {
|
||||||
|
// this user is not mapped with remote calendar. The user will have to wait for
|
||||||
|
// the next calendar subscription iteration
|
||||||
|
$this->logger->debug('mark user ready for msgraph calendar as he does not have any mapping', [
|
||||||
|
'userId' => $user->getId(),
|
||||||
|
]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->tokenStorage->hasToken();
|
return $this->tokenStorage->hasToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import {EventInput} from '@fullcalendar/vue3';
|
import {EventInput} from '@fullcalendar/core';
|
||||||
import {DateTime, Location, User, UserAssociatedInterface} from '../../../ChillMainBundle/Resources/public/types' ;
|
import {DateTime, Location, User, UserAssociatedInterface} from '../../../ChillMainBundle/Resources/public/types' ;
|
||||||
import {Person} from "../../../ChillPersonBundle/Resources/public/types";
|
import {Person} from "../../../ChillPersonBundle/Resources/public/types";
|
||||||
|
|
||||||
|
@@ -116,7 +116,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import ConcernedGroups from 'ChillActivityAssets/vuejs/Activity/components/ConcernedGroups.vue';
|
import ConcernedGroups from 'ChillActivityAssets/vuejs/Activity/components/ConcernedGroups.vue';
|
||||||
import Location from 'ChillActivityAssets/vuejs/Activity/components/Location.vue';
|
import Location from 'ChillActivityAssets/vuejs/Activity/components/Location.vue';
|
||||||
import '@fullcalendar/core/vdom'; // solves problem with Vite
|
|
||||||
import frLocale from '@fullcalendar/core/locales/fr';
|
import frLocale from '@fullcalendar/core/locales/fr';
|
||||||
import FullCalendar from '@fullcalendar/vue3';
|
import FullCalendar from '@fullcalendar/vue3';
|
||||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||||
|
@@ -3,7 +3,7 @@ import {ISOToDatetime} from '../../../../../../ChillMainBundle/Resources/public/
|
|||||||
import {DateTime, User} from '../../../../../../ChillMainBundle/Resources/public/types';
|
import {DateTime, User} from '../../../../../../ChillMainBundle/Resources/public/types';
|
||||||
import {CalendarLight, CalendarRange, CalendarRemote} from '../../../types';
|
import {CalendarLight, CalendarRange, CalendarRemote} from '../../../types';
|
||||||
import type {EventInputCalendarRange} from '../../../types';
|
import type {EventInputCalendarRange} from '../../../types';
|
||||||
import {EventInput} from '@fullcalendar/vue3';
|
import {EventInput} from '@fullcalendar/core';
|
||||||
|
|
||||||
export interface UserData {
|
export interface UserData {
|
||||||
user: User,
|
user: User,
|
||||||
|
@@ -116,13 +116,11 @@
|
|||||||
import type {
|
import type {
|
||||||
CalendarOptions,
|
CalendarOptions,
|
||||||
DatesSetArg,
|
DatesSetArg,
|
||||||
EventInput,
|
EventInput
|
||||||
EventInstance
|
} from '@fullcalendar/core';
|
||||||
} from '@fullcalendar/vue3';
|
|
||||||
import {reactive, computed, ref} from "vue";
|
import {reactive, computed, ref} from "vue";
|
||||||
import {useStore} from "vuex";
|
import {useStore} from "vuex";
|
||||||
import {key} from './store';
|
import {key} from './store';
|
||||||
import '@fullcalendar/core/vdom'; // solves problem with Vite
|
|
||||||
import FullCalendar from '@fullcalendar/vue3';
|
import FullCalendar from '@fullcalendar/vue3';
|
||||||
import frLocale from '@fullcalendar/core/locales/fr';
|
import frLocale from '@fullcalendar/core/locales/fr';
|
||||||
import interactionPlugin, {DropArg, EventResizeDoneArg} from "@fullcalendar/interaction";
|
import interactionPlugin, {DropArg, EventResizeDoneArg} from "@fullcalendar/interaction";
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Modal from "../../../../../../ChillMainBundle/Resources/public/vuejs/_components/Modal.vue";
|
import Modal from "../../../../../../ChillMainBundle/Resources/public/vuejs/_components/Modal.vue";
|
||||||
import {computed, ref} from "vue";
|
import {computed, ref} from "vue";
|
||||||
import {EventApi} from "@fullcalendar/vue3";
|
import {EventApi} from "@fullcalendar/core";
|
||||||
import {useStore} from "vuex";
|
import {useStore} from "vuex";
|
||||||
import {key} from "../store";
|
import {key} from "../store";
|
||||||
import {Location} from "../../../../../../ChillMainBundle/Resources/public/types";
|
import {Location} from "../../../../../../ChillMainBundle/Resources/public/types";
|
||||||
|
@@ -2,7 +2,7 @@ import {State} from './../index';
|
|||||||
import {ActionContext, Module} from 'vuex';
|
import {ActionContext, Module} from 'vuex';
|
||||||
import {CalendarLight} from '../../../../types';
|
import {CalendarLight} from '../../../../types';
|
||||||
import {fetchCalendarLocalForUser} from '../../../Calendar/api';
|
import {fetchCalendarLocalForUser} from '../../../Calendar/api';
|
||||||
import {EventInput} from '@fullcalendar/vue3';
|
import {EventInput} from '@fullcalendar/core';
|
||||||
import {localsToFullCalendarEvent} from "../../../Calendar/store/utils";
|
import {localsToFullCalendarEvent} from "../../../Calendar/store/utils";
|
||||||
import {TransportExceptionInterface} from "../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
import {TransportExceptionInterface} from "../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
||||||
import {COLORS} from "../../../Calendar/const";
|
import {COLORS} from "../../../Calendar/const";
|
||||||
|
@@ -4,7 +4,7 @@ import {CalendarRange, CalendarRangeCreate, CalendarRangeEdit, isEventInputCalen
|
|||||||
import {Location} from "../../../../../../../ChillMainBundle/Resources/public/types";
|
import {Location} from "../../../../../../../ChillMainBundle/Resources/public/types";
|
||||||
import {fetchCalendarRangeForUser} from '../../../Calendar/api';
|
import {fetchCalendarRangeForUser} from '../../../Calendar/api';
|
||||||
import {calendarRangeToFullCalendarEvent} from '../../../Calendar/store/utils';
|
import {calendarRangeToFullCalendarEvent} from '../../../Calendar/store/utils';
|
||||||
import {EventInput} from '@fullcalendar/vue3';
|
import {EventInput} from '@fullcalendar/core';
|
||||||
import {makeFetch} from "../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
import {makeFetch} from "../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
||||||
import {
|
import {
|
||||||
datetimeToISO,
|
datetimeToISO,
|
||||||
|
@@ -2,7 +2,7 @@ import {State} from './../index';
|
|||||||
import {ActionContext, Module} from 'vuex';
|
import {ActionContext, Module} from 'vuex';
|
||||||
import {CalendarRemote} from '../../../../types';
|
import {CalendarRemote} from '../../../../types';
|
||||||
import {fetchCalendarRemoteForUser} from '../../../Calendar/api';
|
import {fetchCalendarRemoteForUser} from '../../../Calendar/api';
|
||||||
import {EventInput, EventSource} from '@fullcalendar/vue3';
|
import {EventInput} from '@fullcalendar/core';
|
||||||
import {remoteToFullCalendarEvent} from "../../../Calendar/store/utils";
|
import {remoteToFullCalendarEvent} from "../../../Calendar/store/utils";
|
||||||
import {TransportExceptionInterface} from "../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
import {TransportExceptionInterface} from "../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
||||||
import {COLORS} from "../../../Calendar/const";
|
import {COLORS} from "../../../Calendar/const";
|
||||||
|
@@ -17,30 +17,20 @@
|
|||||||
<td class="eval">
|
<td class="eval">
|
||||||
<ul class="eval_title">
|
<ul class="eval_title">
|
||||||
<li>
|
<li>
|
||||||
{{ mm.mimeIcon(d.storedObject.type) }}
|
<div class="row">
|
||||||
{{ d.storedObject.title }}
|
<div class="col text-start">
|
||||||
{% if d.dateTimeVersion < d.calendar.dateTimeVersion %}
|
{{ d.storedObject.title }}
|
||||||
<span class="badge bg-danger">{{ 'chill_calendar.Document outdated'|trans }}</span>
|
{% if d.dateTimeVersion < d.calendar.dateTimeVersion %}
|
||||||
{% endif %}
|
<span class="badge bg-danger">{{ 'chill_calendar.Document outdated'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
<ul class="record_actions small inline">
|
</div>
|
||||||
{% if chill_document_is_editable(d.storedObject) and is_granted('CHILL_CALENDAR_DOC_EDIT', d) %}
|
<div class="col-md-auto text-center">
|
||||||
<li>
|
{{ mm.mimeIcon(d.storedObject.type) }}
|
||||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendardoc_delete', {'id': d.id})}}" class="btn btn-delete"></a>
|
</div>
|
||||||
</li>
|
<div class="col col-lg-4 text-end">
|
||||||
<li>
|
{{ d.storedObject|chill_document_button_group(d.storedObject.title, is_granted('CHILL_CALENDAR_DOC_EDIT', d), {'small': true}) }}
|
||||||
{{ d.storedObject|chill_document_edit_button }}
|
</div>
|
||||||
</li>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% if is_granted('CHILL_CALENDAR_DOC_EDIT', d) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendardoc_edit', {'id': d.id})}}" class="btn btn-edit"></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
<li>
|
|
||||||
{{ m.download_button(d.storedObject, d.storedObject.title) }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<div id="mainUser"></div> {# <=== vue component: mainUser #}
|
<div id="mainUser"></div> {# <=== vue component: mainUser #}
|
||||||
|
|
||||||
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Concerned groups calendar'|trans }}</h2>
|
||||||
|
|
||||||
{%- if form.persons is defined -%}
|
{%- if form.persons is defined -%}
|
||||||
{{ form_widget(form.persons) }}
|
{{ form_widget(form.persons) }}
|
||||||
|
@@ -10,13 +10,13 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_answer') }}
|
{{ encore_entry_script_tags('mod_answer') }}
|
||||||
{{ encore_entry_script_tags('mod_async_upload') }}
|
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_answer') }}
|
{{ encore_entry_link_tags('mod_answer') }}
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<div id="mainUser"></div> {# <=== vue component: mainUser #}
|
<div id="mainUser"></div> {# <=== vue component: mainUser #}
|
||||||
|
|
||||||
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Concerned groups calendar'|trans }}</h2>
|
||||||
|
|
||||||
{%- if form.mainUser is defined -%}
|
{%- if form.mainUser is defined -%}
|
||||||
{{ form_row(form.mainUser) }}
|
{{ form_row(form.mainUser) }}
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<dd>{{ entity.mainUser }}</dd>
|
<dd>{{ entity.mainUser }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Concerned groups calendar'|trans }}</h2>
|
||||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': 'calendar_' ~ context, 'render': 'bloc' } %}
|
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': 'calendar_' ~ context, 'render': 'bloc' } %}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -18,8 +18,10 @@ use Chill\DocGeneratorBundle\Service\Context\BaseContextData;
|
|||||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
use Chill\PersonBundle\Templating\Entity\PersonRender;
|
use Chill\PersonBundle\Templating\Entity\PersonRender;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
|
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
|
||||||
use Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender;
|
use Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
@@ -29,6 +31,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
final class CalendarContext implements CalendarContextInterface
|
final class CalendarContext implements CalendarContextInterface
|
||||||
{
|
{
|
||||||
private BaseContextData $baseContextData;
|
private BaseContextData $baseContextData;
|
||||||
@@ -39,6 +43,10 @@ final class CalendarContext implements CalendarContextInterface
|
|||||||
|
|
||||||
private PersonRender $personRender;
|
private PersonRender $personRender;
|
||||||
|
|
||||||
|
private PersonRepository $personRepository;
|
||||||
|
|
||||||
|
private ThirdPartyRepository $thirdPartyRepository;
|
||||||
|
|
||||||
private ThirdPartyRender $thirdPartyRender;
|
private ThirdPartyRender $thirdPartyRender;
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
@@ -48,14 +56,18 @@ final class CalendarContext implements CalendarContextInterface
|
|||||||
EntityManagerInterface $entityManager,
|
EntityManagerInterface $entityManager,
|
||||||
NormalizerInterface $normalizer,
|
NormalizerInterface $normalizer,
|
||||||
PersonRender $personRender,
|
PersonRender $personRender,
|
||||||
|
PersonRepository $personRepository,
|
||||||
ThirdPartyRender $thirdPartyRender,
|
ThirdPartyRender $thirdPartyRender,
|
||||||
|
ThirdPartyRepository $thirdPartyRepository,
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {
|
) {
|
||||||
$this->baseContextData = $baseContextData;
|
$this->baseContextData = $baseContextData;
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->normalizer = $normalizer;
|
$this->normalizer = $normalizer;
|
||||||
$this->personRender = $personRender;
|
$this->personRender = $personRender;
|
||||||
|
$this->personRepository = $personRepository;
|
||||||
$this->thirdPartyRender = $thirdPartyRender;
|
$this->thirdPartyRender = $thirdPartyRender;
|
||||||
|
$this->thirdPartyRepository = $thirdPartyRepository;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +150,7 @@ final class CalendarContext implements CalendarContextInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array{mainPerson?: Person, thirdParty?: ThirdParty, title: string} $contextGenerationData
|
* param array{mainPerson?: Person, thirdParty?: ThirdParty, title: string} $contextGenerationData
|
||||||
* @param mixed $entity
|
* @param mixed $entity
|
||||||
*/
|
*/
|
||||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
||||||
@@ -146,7 +158,7 @@ final class CalendarContext implements CalendarContextInterface
|
|||||||
$options = $this->getOptions($template);
|
$options = $this->getOptions($template);
|
||||||
|
|
||||||
$data = array_merge(
|
$data = array_merge(
|
||||||
$this->baseContextData->getData(),
|
$this->baseContextData->getData($contextGenerationData['creator'] ?? null),
|
||||||
[
|
[
|
||||||
'calendar' => $this->normalizer->normalize($entity, 'docgen', ['docgen:expects' => Calendar::class, 'groups' => ['docgen:read']]),
|
'calendar' => $this->normalizer->normalize($entity, 'docgen', ['docgen:expects' => Calendar::class, 'groups' => ['docgen:read']]),
|
||||||
]
|
]
|
||||||
@@ -226,8 +238,44 @@ final class CalendarContext implements CalendarContextInterface
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$normalized = [];
|
||||||
|
$normalized['title'] = $data['title'] ?? '';
|
||||||
|
|
||||||
|
foreach (['mainPerson', 'thirdParty'] as $k) {
|
||||||
|
if (isset($data[$k])) {
|
||||||
|
$normalized[$k] = $data[$k]->getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$denormalized = [];
|
||||||
|
$denormalized['title'] = $data['title'];
|
||||||
|
|
||||||
|
if (null !== ($data['mainPerson'] ?? null)) {
|
||||||
|
if (null === $person = $this->personRepository->find($data['mainPerson'])) {
|
||||||
|
throw new \RuntimeException('person not found');
|
||||||
|
}
|
||||||
|
$denormalized['mainPerson'] = $person;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== ($data['thirdParty'] ?? null)) {
|
||||||
|
if (null === $thirdParty = $this->thirdPartyRepository->find($data['thirdParty'])) {
|
||||||
|
throw new \RuntimeException('third party not found');
|
||||||
|
}
|
||||||
|
$denormalized['thirdParty'] = $thirdParty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $denormalized;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array{mainPerson?: Person, thirdParty?: ThirdParty, title: string} $contextGenerationData
|
* param array{mainPerson?: Person, thirdParty?: ThirdParty, title: string} $contextGenerationData
|
||||||
*/
|
*/
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||||
{
|
{
|
||||||
@@ -240,7 +288,7 @@ final class CalendarContext implements CalendarContextInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array{askMainPerson: bool, mainPersonLabel: ?string, askThirdParty: bool, thirdPartyLabel: ?string, trackDateTime: bool} $options
|
* return array{askMainPerson: bool, mainPersonLabel: ?string, askThirdParty: bool, thirdPartyLabel: ?string, trackDateTime: bool} $options
|
||||||
*/
|
*/
|
||||||
private function getOptions(DocGeneratorTemplate $template): array
|
private function getOptions(DocGeneratorTemplate $template): array
|
||||||
{
|
{
|
||||||
|
@@ -18,6 +18,9 @@ use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
|||||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template-extends DocGeneratorContextWithPublicFormInterface<Calendar>
|
||||||
|
*/
|
||||||
interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface
|
interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface
|
||||||
{
|
{
|
||||||
public function adminFormReverseTransform(array $data): array;
|
public function adminFormReverseTransform(array $data): array;
|
||||||
@@ -26,23 +29,14 @@ interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInte
|
|||||||
|
|
||||||
public function buildAdminForm(FormBuilderInterface $builder): void;
|
public function buildAdminForm(FormBuilderInterface $builder): void;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Calendar $entity
|
|
||||||
*/
|
|
||||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void;
|
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Calendar $entity
|
|
||||||
*/
|
|
||||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array;
|
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array;
|
||||||
|
|
||||||
public function getDescription(): string;
|
public function getDescription(): string;
|
||||||
|
|
||||||
public function getEntityClass(): string;
|
public function getEntityClass(): string;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Calendar $entity
|
|
||||||
*/
|
|
||||||
public function getFormData(DocGeneratorTemplate $template, $entity): array;
|
public function getFormData(DocGeneratorTemplate $template, $entity): array;
|
||||||
|
|
||||||
public static function getKey(): string;
|
public static function getKey(): string;
|
||||||
@@ -51,13 +45,11 @@ interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInte
|
|||||||
|
|
||||||
public function hasAdminForm(): bool;
|
public function hasAdminForm(): bool;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Calendar $entity
|
|
||||||
*/
|
|
||||||
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool;
|
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool;
|
||||||
|
|
||||||
/**
|
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array;
|
||||||
* @param Calendar $entity
|
|
||||||
*/
|
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array;
|
||||||
|
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void;
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user