Compare commits

..

18 Commits

Author SHA1 Message Date
cea44d1788 Release 2.23.0 2024-07-19 14:03:53 +02:00
84069e03dc Add filename display on file upload
This update introduces a new feature to the DropFile component; now filenames are displayed when they are uploaded. This provides a user-friendly way to view the file being managed. Additionally, some styling adjustments were made to accommodate this new addition.
2024-07-19 13:55:22 +02:00
ad5e780936 Do not update the createdAt column when importing postal code which does not change
The conflict resolution clause in the SQL command of the PostalCodeBaseImporter service has been updated. It now only changes the 'updatedAt' timestamp if either the 'center' position or the 'label' actually differs from the existing entry. This ensures that the 'updatedAt' field reflects when meaningful changes occurred.
2024-07-19 13:42:48 +02:00
19accc4d00 Handle duplicate addresses in AddressReferenceBaseImporter
Refactored the AddressReferenceBaseImporter to optimize address import and reconciliation. The code now identifies duplicate addresses in the temporary table and handles them according to the 'allowRemoveDoubleRefId' flag. This enhances data consistency during import operations.
2024-07-19 13:41:17 +02:00
6cb085f5f7 fix cs 2024-07-19 13:39:36 +02:00
97239ada84 More documentation for cronjob 2024-07-18 10:09:12 +02:00
643156f822 Merge branch 'issue271_account_acp_closing_date' into 'master'
#271 Account for acp closing date inn action filters (export)

See merge request Chill-Projet/chill-bundles!707
2024-07-05 13:42:06 +00:00
ff0b205591 Merge branch '273-notif-all-read' into 'master'
added unread and read all function with endpoints for notifications

See merge request Chill-Projet/chill-bundles!671
2024-07-05 13:36:31 +00:00
2d67843901 added unread and read all function with endpoints for notifications 2024-07-05 13:36:31 +00:00
2b09e1459c Merge branch '274-active-status-filter' into 'master'
Resolve "Add active/inactive filter to user list in admin"

Closes #274

See merge request Chill-Projet/chill-bundles!694
2024-07-05 08:52:46 +00:00
029524ba2c Resolve "Add active/inactive filter to user list in admin" 2024-07-05 08:52:46 +00:00
fa91e9494d Merge branch 'issue123_duplicate_calendar_range_by_week' into 'master'
Add a button to duplicate calendar ranges from a week to another one

See merge request Chill-Projet/chill-bundles!706
2024-07-05 08:07:49 +00:00
4e72d6fea1 Update slot duration in calendar
The slot duration in the 'MyCalendarRange' module has been updated to a new time. The previous duration was 5 minutes, but it has now been increased to 15 minutes to provide users with longer time slots.
2024-07-05 10:01:09 +02:00
5666b8b647 Expand range of calendar weeks in App2.vue to get weeks int the future and in the past
The code has been altered to increase the range of weeks computed from 15 to 30, with a modification to the 'getMonday' method accordingly. This enhances the user calendar experience by providing a wider time array to choose from.
2024-07-05 09:58:49 +02:00
nobohan
0573f56782 copy week in my calendar - improve layout 2024-07-03 11:35:33 +02:00
nobohan
3bee18b0fa #271 Account for acp closing date inn action filters (export) 2024-07-02 16:31:18 +02:00
nobohan
843698a1d8 DX vuejs code style 2024-07-01 15:39:52 +02:00
nobohan
499640e48b Add a button to duplicate calendar ranges from a week to another one 2024-07-01 15:33:39 +02:00
2335 changed files with 14656 additions and 29779 deletions

View File

@@ -1,11 +1,12 @@
## v2.23.0 - 2024-07-23 ## v2.23.0 - 2024-07-19
### Feature ### Feature
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles * ([#123](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/123)) Add a button to duplicate calendar ranges from a week to another one
* Add job bundle (module emploi) * [admin] filter users by active / inactive in the admin user's list
* Upgrade import of address list to the last version of compiled addresses of belgian-best-address * ([#273](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/273)) Add the possibility to mark all notifications as read
* Upgrade CKEditor and refactor configuration with use of typescript
* Handle duplicate reference id in the import of reference addresses
* Do not update the "createdAt" column when importing postal code which does not change
* Display filename on file upload within the UI interface
### Fixed ### Fixed
* Fix resolving of centers for an household, which will fix in turn the access control * ([#271](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/271)) Take into account the acp closing date in the acp works date filter
* Resolved type hinting error in activity list export

94
.env
View File

@@ -1,94 +0,0 @@
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
## Locale
LOCALE=fr
###> symfony/framework-bundle ###
# this should be set in docker-compose.yml file
APP_ENV=prod
APP_SECRET=ChangeItf2b58287ef7f9976409d3f6c72529e99ChangeIt
TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
TRUSTED_HOSTS='^(localhost|example\.com|nginx)$'
###< symfony/framework-bundle ###
## Wopi server for editing documents online
WOPI_SERVER=http://collabora:9980
# must be manually set in .env.local
# ADMIN_PASSWORD=
###> symfony/mailer ###
# MAILER_DSN=null://null
###< symfony/mailer ###
## Notifications
NOTIFICATION_HOST=localhost:8001
NOTIFICATION_FROM_EMAIL=admin@chill.social
NOTIFICATION_FROM_NAME="Chill <admin@chill.social>"
## Pgadmin credential
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
## OVH OpenStack Storage Container
ASYNC_UPLOAD_TEMP_URL_KEY=
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
## Redis Cache
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
## Twilio
TWILIO_SID=~
TWILIO_SECRET=~
DEFAULT_CARRIER_CODE=BE
ADD_ADDRESS_DEFAULT_COUNTRY=BE
ADD_ADDRESS_MAP_CENTER_X=50.8443
ADD_ADDRESS_MAP_CENTER_Y=4.3523
ADD_ADDRESS_MAP_CENTER_Z=15
SHORT_MESSAGE_DSN=null://null
## DOCKER IMAGES REGISTRY
#IMAGE_PHP=
#IMAGE_NGINX=
## DOCKER IMAGES TAG
#VERSION=test
#VERSION=prod
###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
MESSENGER_TRANSPORT_DSN=sync://
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###
###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
DATABASE_URL="postgresql://postgres:postgres@db:5432/postgres?serverVersion=14&charset=utf8"
###< doctrine/doctrine-bundle ###
###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
###< lexik/jwt-authentication-bundle ###

View File

@@ -4,8 +4,6 @@
KERNEL_CLASS='App\Kernel' KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st' APP_SECRET='$ecretf0rt3st'
TRUSTED_HOSTS=
ADMIN_PASSWORD=password ADMIN_PASSWORD=password
LOCALE=fr LOCALE=fr

View File

@@ -20,7 +20,6 @@ services:
# Set any variables we need # Set any variables we need
variables: variables:
APP_ENV: test
GIT_DEPTH: 1 GIT_DEPTH: 1
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/) # Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
POSTGRES_USER: postgres POSTGRES_USER: postgres
@@ -36,7 +35,7 @@ variables:
# force a timezone # force a timezone
TZ: Europe/Brussels TZ: Europe/Brussels
# avoid direct deprecations (using symfony phpunit bridge: https://symfony.com/doc/4.x/components/phpunit_bridge.html#internal-deprecations # avoid direct deprecations (using symfony phpunit bridge: https://symfony.com/doc/4.x/components/phpunit_bridge.html#internal-deprecations
SYMFONY_DEPRECATIONS_HELPER: max[total]=99999999&max[self]=0&max[direct]=45&verbose=0 SYMFONY_DEPRECATIONS_HELPER: max[total]=99999999&max[self]=0&max[direct]=0&verbose=1
stages: stages:
- Composer install - Composer install
@@ -121,7 +120,7 @@ unit_tests:
- php tests/console doctrine:migrations:migrate -n --env=test - php tests/console doctrine:migrations:migrate -n --env=test
- php tests/console chill:db:sync-views --env=test - php tests/console chill:db:sync-views --env=test
- php -d memory_limit=2G tests/console cache:clear --env=test - php -d memory_limit=2G tests/console cache:clear --env=test
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n --env=test - php -d memory_limit=3G tests/console doctrine:fixtures:load -n
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive - php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive
artifacts: artifacts:
expire_in: 1 day expire_in: 1 day

View File

@@ -27,7 +27,6 @@ $config
->setRiskyAllowed(true) ->setRiskyAllowed(true)
->setCacheFile('.cache/php-cs-fixer.cache') ->setCacheFile('.cache/php-cs-fixer.cache')
->setUsingCache(true) ->setUsingCache(true)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
; ;
$rules = $config->getRules(); $rules = $config->getRules();
@@ -113,7 +112,6 @@ $rules = array_merge(
], ],
'sort_algorithm' => 'alpha', 'sort_algorithm' => 'alpha',
], ],
'single_line_empty_body' => true,
], ],
$rules, $rules,
$riskyRules, $riskyRules,

View File

@@ -6,17 +6,18 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie). and is generated by [Changie](https://github.com/miniscruff/changie).
## v2.23.0 - 2024-07-23 ## v2.23.0 - 2024-07-19
### Feature ### Feature
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles * ([#123](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/123)) Add a button to duplicate calendar ranges from a week to another one
* Add job bundle (module emploi) * [admin] filter users by active / inactive in the admin user's list
* Upgrade import of address list to the last version of compiled addresses of belgian-best-address * ([#273](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/273)) Add the possibility to mark all notifications as read
* Upgrade CKEditor and refactor configuration with use of typescript
* Handle duplicate reference id in the import of reference addresses
* Do not update the "createdAt" column when importing postal code which does not change
* Display filename on file upload within the UI interface
### Fixed ### Fixed
* Fix resolving of centers for an household, which will fix in turn the access control * ([#271](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/271)) Take into account the acp closing date in the acp works date filter
* Resolved type hinting error in activity list export
## v2.22.2 - 2024-07-03 ## v2.22.2 - 2024-07-03
### Fixed ### Fixed

View File

@@ -1,117 +0,0 @@
# Switch to symfony 5.0
- the tag `chill.role` is now renamed to `chill_main.provide_role`.
**Note**: It is not necessary to apply this tag on service definition: the tag is automatically applyied if the
service implements `\Chill\MainBundle\Security\ProvideRoleInterface`.
- those annotation can be converted to attribute:
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity`
- `Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential`
- `Chill\PersonBundle\Validator\Constraints\Household\MaxHolder`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck`
- `Chill\PersonBundle\Validator\Constraints\Person\Birthdate`
- `Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter`
- `Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate`
- `Chill\ActivityBundle\Validator\Constraints\ActivityValidity`
- `Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists`
- `Chill\MainBundle\Validation\Constraint\PhonenumberConstraint`
- `Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency`
- `Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation`
Here is the rector rule that can be used to switch attributes to annotations:
```php
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
]);
```
- to keep cleaner definition in container's dependency injection and framework bundle, the definition of crud or api
requires to define explicitly a controller.
Before:
```php
$container->prependExtensionConfig('chill_main', [
'apis' => [
[
'class' => ThirdParty::class,
'name' => 'thirdparty',
'base_path' => '/api/1.0/thirdparty/thirdparty',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_POST => true,
Request::METHOD_PUT => true,
Request::METHOD_PATCH => true,
],
'roles' => [
Request::METHOD_GET => ThirdPartyVoter::SHOW,
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
Request::METHOD_POST => ThirdPartyVoter::CREATE,
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
],
],
],
],
],
]);
After:
```php
$container->prependExtensionConfig('chill_main', [
'apis' => [
[
'class' => ThirdParty::class,
'controller' => ThirdPartyApiController::class,
'name' => 'thirdparty',
'base_path' => '/api/1.0/thirdparty/thirdparty',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_POST => true,
Request::METHOD_PUT => true,
Request::METHOD_PATCH => true,
],
'roles' => [
Request::METHOD_GET => ThirdPartyVoter::SHOW,
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
Request::METHOD_POST => ThirdPartyVoter::CREATE,
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
],
],
],
],
],
]);
```

View File

@@ -8,17 +8,19 @@
"social worker" "social worker"
], ],
"require": { "require": {
"php": "^8.3", "php": "^8.2",
"ext-dom": "*", "ext-dom": "*",
"ext-json": "*", "ext-json": "*",
"ext-openssl": "*", "ext-openssl": "*",
"ext-redis": "*", "ext-redis": "*",
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
"champs-libres/wopi-bundle": "dev-master@dev", "champs-libres/wopi-bundle": "dev-master@dev",
"champs-libres/wopi-lib": "dev-master@dev", "champs-libres/wopi-lib": "dev-master@dev",
"doctrine/doctrine-bundle": "^2.1", "doctrine/doctrine-bundle": "^2.1",
"doctrine/doctrine-migrations-bundle": "^3.0", "doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.13.0", "doctrine/orm": "^2.13.0",
"erusev/parsedown": "^1.7", "erusev/parsedown": "^1.7",
"graylog2/gelf-php": "^1.5",
"knplabs/knp-menu-bundle": "^3.0", "knplabs/knp-menu-bundle": "^3.0",
"knplabs/knp-time-bundle": "^1.12", "knplabs/knp-time-bundle": "^1.12",
"knpuniversity/oauth2-client-bundle": "^2.10", "knpuniversity/oauth2-client-bundle": "^2.10",
@@ -30,48 +32,29 @@
"ovh/ovh": "^3.0", "ovh/ovh": "^3.0",
"phpoffice/phpspreadsheet": "^1.16", "phpoffice/phpspreadsheet": "^1.16",
"ramsey/uuid-doctrine": "^1.7", "ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^6.0", "sensio/framework-extra-bundle": "^5.5",
"spomky-labs/base64url": "^2.0", "spomky-labs/base64url": "^2.0",
"symfony/asset": "6.0.*", "symfony/browser-kit": "^4.4",
"symfony/browser-kit": "6.0.*",
"symfony/cache": "6.0.*",
"symfony/clock": "^6.2", "symfony/clock": "^6.2",
"symfony/config": "^6.0", "symfony/css-selector": "^4.4",
"symfony/console": "6.0.*", "symfony/expression-language": "^4.4",
"symfony/css-selector": "6.0.*", "symfony/form": "^4.4",
"symfony/dom-crawler": "6.0.*", "symfony/framework-bundle": "^4.4",
"symfony/error-handler": "6.0.*", "symfony/http-client": "^4.4 || ^5",
"symfony/event-dispatcher": "6.0.*", "symfony/http-foundation": "^4.4",
"symfony/expression-language": "6.0.*", "symfony/intl": "^4.4",
"symfony/filesystem": "6.0.*", "symfony/mailer": "^5.4",
"symfony/finder": "6.0.*", "symfony/messenger": "^5.4",
"symfony/form": "6.0.*", "symfony/mime": "^5.4",
"symfony/framework-bundle": "6.0.*",
"symfony/http-client": "6.0.*",
"symfony/http-foundation": "6.0.*",
"symfony/intl": "6.0.*",
"symfony/mailer": "6.0.*",
"symfony/messenger": "6.0.*",
"symfony/mime": "6.0.*",
"symfony/monolog-bundle": "^3.5", "symfony/monolog-bundle": "^3.5",
"symfony/options-resolver": "6.0.*", "symfony/security-bundle": "^4.4",
"symfony/process": "6.0.*", "symfony/serializer": "^5.3",
"symfony/property-access": "6.0.*", "symfony/translation": "^4.4",
"symfony/property-info": "6.0.*", "symfony/twig-bundle": "^4.4",
"symfony/routing": "6.0.*", "symfony/validator": "^4.4",
"symfony/security-bundle": "^6.0",
"symfony/security-core": "6.0.*",
"symfony/security-csrf": "6.0.*",
"symfony/security-http": "6.0.*",
"symfony/serializer": "6.0.*",
"symfony/string": "6.0.*",
"symfony/templating": "6.0.*",
"symfony/translation": "6.0.*",
"symfony/twig-bundle": "6.0.*",
"symfony/validator": "6.0.*",
"symfony/webpack-encore-bundle": "^1.11", "symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "6.0.*", "symfony/workflow": "^4.4",
"symfony/yaml": "6.0.*", "symfony/yaml": "^4.4",
"thenetworg/oauth2-azure": "^2.0", "thenetworg/oauth2-azure": "^2.0",
"twig/extra-bundle": "^3.0", "twig/extra-bundle": "^3.0",
"twig/intl-extra": "^3.0", "twig/intl-extra": "^3.0",
@@ -90,15 +73,17 @@
"phpstan/phpstan": "^1.9", "phpstan/phpstan": "^1.9",
"phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-strict-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^10.5.24", "phpunit/phpunit": ">= 7.5",
"rector/rector": "^1.1.0", "psalm/plugin-phpunit": "^0.18.4",
"symfony/debug-bundle": "6.0.*", "psalm/plugin-symfony": "^4.0.2",
"symfony/dotenv": "6.0.*", "rector/rector": "1.1.1",
"symfony/debug-bundle": "^5.1",
"symfony/dotenv": "^4.4",
"symfony/maker-bundle": "^1.20", "symfony/maker-bundle": "^1.20",
"symfony/phpunit-bridge": "^7.1", "symfony/phpunit-bridge": "^4.4",
"symfony/runtime": "6.0.*", "symfony/stopwatch": "^4.4",
"symfony/stopwatch": "6.0.*", "symfony/var-dumper": "^4.4",
"symfony/var-dumper": "6.0.*" "vimeo/psalm": "^4.30.0"
}, },
"conflict": { "conflict": {
"symfony/symfony": "*" "symfony/symfony": "*"
@@ -113,8 +98,6 @@
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle", "Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle",
"Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle", "Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle",
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle", "Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
"Chill\\FranceTravailApiBundle\\": "src/Bundle/ChillFranceTravailApiBundle/src",
"Chill\\JobBundle\\": "src/Bundle/ChillJobBundle/src",
"Chill\\MainBundle\\": "src/Bundle/ChillMainBundle", "Chill\\MainBundle\\": "src/Bundle/ChillMainBundle",
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
@@ -149,13 +132,6 @@
"scripts": { "scripts": {
"auto-scripts": { "auto-scripts": {
"cache:clear": "symfony-cmd" "cache:clear": "symfony-cmd"
},
"php-cs-fixer": "php-cs-fixer fix --config=./.php-cs-fixer.dist.php --show-progress=none"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.0.*"
} }
} }
} }

View File

@@ -21,15 +21,13 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
{ {
// add specific role for this filter // add specific role for this filter
#[\Override] public function addRole()
public function addRole(): ?string
{ {
// we do not need any new role for this filter, so we return null // we do not need any new role for this filter, so we return null
return null; return null;
} }
// here, we alter the query created by Export // here, we alter the query created by Export
#[\Override]
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
{ {
$where = $qb->getDQLPart('where'); $where = $qb->getDQLPart('where');
@@ -54,14 +52,12 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
} }
// we give information on which type of export this filter applies // we give information on which type of export this filter applies
#[\Override]
public function applyOn() public function applyOn()
{ {
return 'person'; return 'person';
} }
// we build a form to collect some parameters from the users // we build a form to collect some parameters from the users
#[\Override]
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
{ {
$builder->add('date_from', DateType::class, [ $builder->add('date_from', DateType::class, [
@@ -78,7 +74,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
'format' => 'dd-MM-yyyy', 'format' => 'dd-MM-yyyy',
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return ['date_from' => new DateTime(), 'date_to' => new DateTime()]; return ['date_from' => new DateTime(), 'date_to' => new DateTime()];
@@ -86,7 +81,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
// here, we create a simple string which will describe the action of // here, we create a simple string which will describe the action of
// the filter in the Response // the filter in the Response
#[\Override]
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
return ['Filtered by person\'s birtdate: ' return ['Filtered by person\'s birtdate: '
@@ -96,7 +90,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
], ]; ], ];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Filter by person\'s birthdate'; return 'Filter by person\'s birthdate';
@@ -106,7 +99,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
// is executed here. This function is added by the interface // is executed here. This function is added by the interface
// `ExportElementValidatedInterface`, and can be ignore if there is // `ExportElementValidatedInterface`, and can be ignore if there is
// no need for a validation // no need for a validation
#[\Override]
public function validateForm($data, ExecutionContextInterface $context) public function validateForm($data, ExecutionContextInterface $context)
{ {
$date_from = $data['date_from']; $date_from = $data['date_from'];

View File

@@ -32,30 +32,25 @@ class CountPerson implements ExportInterface
$this->entityManager = $em; $this->entityManager = $em;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// this export does not add any form // this export does not add any form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription() public function getDescription()
{ {
return 'Count peoples by various parameters.'; return 'Count peoples by various parameters.';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
// the Closure which will be executed by the formatter. // the Closure which will be executed by the formatter.
@@ -65,7 +60,6 @@ class CountPerson implements ExportInterface
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
// this array match the result keys in the query. We have only // this array match the result keys in the query. We have only
@@ -73,25 +67,21 @@ class CountPerson implements ExportInterface
return ['export_result']; return ['export_result'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Count peoples'; return 'Count peoples';
} }
#[\Override]
public function getType() public function getType()
{ {
return Declarations::PERSON_TYPE; return Declarations::PERSON_TYPE;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
// we gather all center the user choose. // we gather all center the user choose.
@@ -108,13 +98,11 @@ class CountPerson implements ExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return PersonVoter::STATS; return PersonVoter::STATS;
} }
#[\Override]
public function supportsModifiers() public function supportsModifiers()
{ {
// explain the export manager which formatters and filters are allowed // explain the export manager which formatters and filters are allowed

View File

@@ -39,9 +39,12 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
use Chill\MainBundle\Entity\CronJobExecution; use Chill\MainBundle\Entity\CronJobExecution;
use DateInterval; use DateInterval;
use DateTimeImmutable; use DateTimeImmutable;
use Symfony\Component\Clock\ClockInterface;
class MyCronJob implements CronJobInterface class MyCronJob implements CronJobInterface
{ {
function __construct(private ClockInterface $clock) {}
public function canRun(?CronJobExecution $cronJobExecution): bool public function canRun(?CronJobExecution $cronJobExecution): bool
{ {
// the parameter $cronJobExecution contains data about the last execution of the cronjob // the parameter $cronJobExecution contains data about the last execution of the cronjob
@@ -56,7 +59,7 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
// this cron job should be executed if the last execution is greater than one day, but only during the night // this cron job should be executed if the last execution is greater than one day, but only during the night
$now = new DateTimeImmutable('now'); $now = $clock->now();
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D')) return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
&& in_array($now->format('H'), self::ACCEPTED_HOURS, true) && in_array($now->format('H'), self::ACCEPTED_HOURS, true)
@@ -69,10 +72,15 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
return 'arbitrary-and-unique-key'; return 'arbitrary-and-unique-key';
} }
public function run(): void public function run(array $lastExecutionData): void
{ {
// here, we execute the command // here, we execute the command
}
// we return execution data, which will be served for next execution
// this data should be easily serializable in a json column: it should contains
// only int, string, etc. Avoid storing object
return ['last-execution-id' => 0];
}
} }
How are cron job scheduled ? How are cron job scheduled ?

View File

@@ -15,12 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{ {
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
public function yourAction() public function yourAction()
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
// first, get the number of total item are available // first, get the number of total item are available
$total = $em $total = $em
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item') ->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')

View File

@@ -18,9 +18,6 @@ use Symfony\Component\Security\Core\Role\Role;
class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{ {
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
/** /**
* @param int $id personId * @param int $id personId
* *
@@ -51,7 +48,7 @@ class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\
); );
// create a query which take circles into account // create a query which take circles into account
$consultations = $this->managerRegistry->getManager() $consultations = $this->getDoctrine()->getManager()
->createQuery('SELECT c FROM ChillHealthBundle:Consultation c ' ->createQuery('SELECT c FROM ChillHealthBundle:Consultation c '
. 'WHERE c.patient = :person AND c.circle IN(:circles) ' . 'WHERE c.patient = :person AND c.circle IN(:circles) '
. 'ORDER BY c.date DESC') . 'ORDER BY c.date DESC')

View File

@@ -31,7 +31,6 @@ class ChillMainConfiguration implements ConfigurationInterface
$this->setWidgetFactories($widgetFactories); $this->setWidgetFactories($widgetFactories);
} }
#[\Override]
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {
$treeBuilder = new TreeBuilder('chill_main'); $treeBuilder = new TreeBuilder('chill_main');

View File

@@ -27,13 +27,11 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
*/ */
protected $widgetFactories = []; protected $widgetFactories = [];
#[\Override]
public function addWidgetFactory(WidgetFactoryInterface $factory) public function addWidgetFactory(WidgetFactoryInterface $factory)
{ {
$this->widgetFactories[] = $factory; $this->widgetFactories[] = $factory;
} }
#[\Override]
public function getConfiguration(array $config, ContainerBuilder $container) public function getConfiguration(array $config, ContainerBuilder $container)
{ {
return new Configuration($this->widgetFactories, $container); return new Configuration($this->widgetFactories, $container);
@@ -42,13 +40,11 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
/** /**
* @return WidgetFactoryInterface[] * @return WidgetFactoryInterface[]
*/ */
#[\Override]
public function getWidgetFactories() public function getWidgetFactories()
{ {
return $this->widgetFactories; return $this->widgetFactories;
} }
#[\Override]
public function load(array $configs, ContainerBuilder $container) public function load(array $configs, ContainerBuilder $container)
{ {
// configuration for main bundle // configuration for main bundle

View File

@@ -25,7 +25,6 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
* see http://symfony.com/doc/current/components/config/definition.html * see http://symfony.com/doc/current/components/config/definition.html
* *
*/ */
#[\Override]
public function configureOptions($place, NodeBuilder $node) public function configureOptions($place, NodeBuilder $node)
{ {
$node->booleanNode('only_active') $node->booleanNode('only_active')
@@ -57,7 +56,6 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
* the service must exists in the container, and it is not required that the service * the service must exists in the container, and it is not required that the service
* has the `chill_main` tag. * has the `chill_main` tag.
*/ */
#[\Override]
public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config) public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config)
{ {
return 'chill_person.widget.person_list'; return 'chill_person.widget.person_list';
@@ -68,7 +66,6 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
* *
* @return string * @return string
*/ */
#[\Override]
public function getWidgetAlias() public function getWidgetAlias()
{ {
return 'person_list'; return 'person_list';

View File

@@ -79,7 +79,6 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
* *
* @return string * @return string
*/ */
#[\Override]
public function render(Twig_Environment $env, $place, array $context, array $config) public function render(Twig_Environment $env, $place, array $context, array $config)
{ {
$qb = $this->personRepository $qb = $this->personRepository

View File

@@ -22,7 +22,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/ */
class ChillPersonExtension extends Extension implements PrependExtensionInterface class ChillPersonExtension extends Extension implements PrependExtensionInterface
{ {
#[\Override]
public function load(array $configs, ContainerBuilder $container) public function load(array $configs, ContainerBuilder $container)
{ {
// ... // ...
@@ -33,7 +32,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
* *
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container * @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
*/ */
#[\Override]
public function prepend(ContainerBuilder $container) public function prepend(ContainerBuilder $container)
{ {
$container->prependExtensionConfig('chill_main', [ $container->prependExtensionConfig('chill_main', [

View File

@@ -14,359 +14,6 @@
Installation & Usage Installation & Usage
#################### ####################
You will learn here how to install a new symfony project with chill, and configure it.
Requirements
============
The installation is tested on a Debian-like linux distribution. The installation on other operating systems is not documented.
You have to install the following tools on your computer:
- `PHP <https://www.php.net/>`_, version 8.3+, with the following extensions: pdo_pgsql, intl, mbstring, zip, bcmath, exif, sockets, redis, ast, gd;
- `composer <https://getcomposer.org/>`_;
- `symfony cli <https://symfony.com/download>`_;
- `node, we encourage you to use nvm to configure the correct version <https://github.com/nvm-sh/nvm>`_. The project contains an
:code:`.nvmrc` file which selects automatically the required version of node (if present).
- `yarn <https://classic.yarnpkg.com/lang/en/docs/install/>`_. We use the version 1.22+ for now.
- `docker and the plugin compose <https://docker.com>`_ to run the database
Chill needs a redis server and a postgresql database, and a few other things like a "relatorio service" which will
generate documents from templates. **All these things are available through docker using the plugin compose**. We do not provide
information on how to run this without docker compose.
Install a new project
=====================
Initialize project and dependencies
***********************************
.. code-block:: bash
symfony new --version=5.4 my_chill_project
cd my_chill_project
We strongly encourage you to initialize a git repository at this step, to track further changes.
.. code-block:: bash
# add the flex endpoints required for custom recipes
cat <<< "$(jq '.extra.symfony += {"endpoint": ["flex://defaults", "https://gitlab.com/api/v4/projects/57371968/repository/files/index.json/raw?ref=main"]}' composer.json)" > composer.json
# install chill and some dependencies
# TODO fix the suffix "alpha1" and replace by ^3.0.0 when version 3.0.0 will be released
symfony composer require chill-project/chill-bundles v3.0.0-RC3 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev
We encourage you to accept the inclusion of the "Docker configuration from recipes": this is the documented way to run the database.
You must also accept to configure recipes from the contrib repository, unless you want to configure the bundles manually).
.. code-block:: bash
# fix some configuration
./post-install-chill.sh
# install node dependencies
yarn install
# and compile assets
yarn run encore production
.. note::
If you encounter this error during assets compilation (:code:`yarn run encore production`) (repeated multiple times):
.. code-block:: txt
[tsl] ERROR in /tmp/chill/v1/public/bundles/chillcalendar/types.ts(2,65)
TS2307: Cannot find module '../../../ChillMainBundle/Resources/public/types' or its corresponding type declarations.
run:
.. code-block:: bash
rm -rf public/bundles/*
Then restart the compilation of assets (:code:```yarn run encore production```)
Configure your project
**********************
You should read the configuration files in :code:`chill/config/packages` carefully, especially if you have
custom developments. But most of the time, this should be fine.
You have to configure some local variables, which are described in the :code:`.env` file. The secrets should not be stored
in this :code:`.env` file, but instead using the `secrets management tool <https://symfony.com/doc/current/configuration/secrets.html>`_
or in the :code:`.env.local` file, which should not be committed to the git repository.
You do not need to set variables for the smtp server, redis server and relatorio server, as they are generated automatically
by the symfony server, from the docker compose services.
The only required variable is the :code:`ADMIN_PASSWORD`. You can generate a hashed and salted admin password using the command
:code:`symfony console security:hash-password <your password> 'Symfony\Component\Security\Core\User\User'`. Then,
you can either:
- add this password to the :code:`.env.local` file, you must escape the character :code:`$`: if the generated password
is :code:`$2y$13$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm`, your :code:`.env.local` file will be:
.. code-block:: env
ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm
# note: if you copy-paste the line above, the password will be "admin".
- add the generated password to the secrets manager (**note**: you must add the generated hashed password to the secrets env,
not the password in clear text).
- set up the jwt authentication bundle
Some environment variables are available for the JWT authentication bundle in the :code:`.env` file.
Prepare migrations and other tools
**********************************
To continue the installation process, you will have to run migrations:
.. code-block:: bash
# start databases and other services
docker compose up -d
# the first start, it may last some seconds, you can check with docker compose ps
# run migrations
symfony console doctrine:migrations:migrate
# setup messenger
symfony console messenger:setup-transports
# prepare some views
symfony console chill:db:sync-views
# generate jwt token, required for some api features (webdav access, ...)
symfony console lexik:jwt:generate-keypair
.. warning::
If you encounter an error while running :code:`symfony console messenger:setup-transports`, you can set up the messenger
transport to redis, by adding this in the :code:`.env.local` or :code:`.env` file:
.. code-block:: env
MESSENGER_TRANSPORT_DSN=redis://${REDIS_HOST}:${REDIS_PORT}/messages
Start your web server locally
*****************************
At this step, Chill will be ready to be served locally, but without any configuration. You can run the project
locally using the `local symfony server <https://symfony.com/doc/current/setup/symfony_server.html>`_:
.. code-block:: bash
# see the whole possibilities at https://symfony.com/doc/current/setup/symfony_server.html
symfony server:start -d
If you need to test the instance with accounts and some basic configuration, please install the fixtures (see below).
Add capabilities for dev
========================
If you need to add custom bundles, you can develop them in the `src/` directory, like for any other symfony project. You
can rely on the whole chill framework, meaning there is no need to add them to the original `chill-bundles`.
You will require some bundles to have the following development tools:
- add fixtures
- add profiler and debug bundle
Install fixtures
****************
.. code-block:: bash
# generate fixtures for chill
symfony composer require --dev doctrine/doctrine-fixtures-bundle nelmio/alice
# now, you can generate fixtures (this will reset your database)
symfony console doctrine:fixtures:load
This will generate user accounts, centers, and some basic configuration.
The accounts created are: :code:`center a_social`, :code:`center b_social`, :code:`center a_direction`, ... The full list is
visible in the "users" table: :code:`docker compose exec database psql -U app -c "SELECT username FROM users"`.
The password is always :code:`password`.
.. warning::
The fixtures are not fully functional. See the `corresponding issue <https://gitlab.com/Chill-Projet/chill-bundles/-/issues/280>`_.
Add web profiler and debugger
*****************************
.. code-block:: bash
symfony composer require --dev symfony/web-profiler-bundle symfony/debug-bundle
Working on chill bundles
************************
If you plan to improve the chill-bundles repository, that's great!
You will have to download chill-bundles as a git repository (and not as an archive, which is barely editable).
In your :code:`composer.json` file, add these lines:
.. code-block:: diff
{
"config": {
+ "preferred-install": {
+ "chill-project/chill-bundles": "source",
"*": "dist"
+ }
}
Then, run :code:`symfony composer reinstall chill-project/chill-bundles` to re-install the package from source.
Code style, code quality and other tools
****************************************
For development, you will also have to install:
- `php-cs-fixer <https://cs.symfony.com/>`_
We also encourage you to use tools like `phpstan <https://phpstan.org>`_ and `rector <https://getrector.com>`_.
Commit and share your project
=============================
If multiple developers work on a project, you can commit your symfony project and share it with other people.
When another developer clones your project, they will have to:
- run :code:`symfony composer install` and :code:`yarn install` to install the same dependencies as the initial developer;
- run :code:`yarn run encore production` to compile assets;
- copy any possible variables from the :code:`.env.local` files;
- start the docker compose stack, using :code:`docker compose`, and run migrations, set up transports, and prepare chill db views
(see the corresponding command above)
Update
======
In order to update your app, you must update dependencies:
- for chill-bundles, you can `set the last version <https://gitlab.com/Chill-Projet/chill-bundles/-/releases>`_ manually
in the :code:`composer.json` file, or set the version to `^3.0.0` and run :code:`symfony composer update` regularly
- run :code:`composer update` and :code:`yarn update` to maintain your dependencies up-to-date.
After each update, you must update your database schema:
.. code-block:: bash
symfony console doctrine:migrations:migrate
symfony console chill:db:sync-views
Operations
==========
Build assets
************
run those commands:
.. code-block:: bash
# for production (or in dev, when you don't need to work on your assets and need some speed)
yarn run encore production
# in dev, when you wan't to reload the assets on each changes
yarn run encore dev --watch
How to execute the console ?
****************************
.. code-block:: bash
# start the console with all required variables
symfony console
# you can add your command after that:
symfony console list
How to generate documents
*************************
Documents are generated asynchronously by `"consuming messages" <https://symfony.com/doc/current/messenger.html#consuming-messages-running-the-worker>`_.
You must generate them using a dedicated process:
.. code-block:: bash
symfony console messenger:consume async priority
To avoid memory issues, we encourage you to also use the :code:`--limit` parameter of the command.
How to read emails sent by the program ?
*******************************************
In development, there is a built-in "mail catcher". Open it with :code:`symfony open:local:webmail`
How to run cron-jobs ?
**********************
Some commands must be executed in :ref:`cron jobs <cronjob>`. To execute them:
.. code-block:: bash
symfony console chill:cron-job:execute
What about materialized views ?
*******************************
There are some materialized views in chill, to speed up some complex computations in the database.
In order to refresh them, run a cron job or refresh them manually in your database.
How to run tests for chill-bundles
**********************************
Tests reside inside the installed bundles. You must `cd` into that directory, download the required packages, and execute them from this place.
**Note**: some bundles require the fixtures to be executed. See the dedicated _how-tos_.
Example, for running a unit test inside `main` bundle:
.. code-block:: bash
# cd into main directory
cd vendor/chill-project/chill-bundles
composer install
# run tests
bin/phpunit src/Bundle/path/to/your/test
Or for running tests to check code style and php conventions with csfixer and phpstan:
Troubleshooting
===============
Error `An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/app/web/build/manifest.json" does not exist.").` on first run
********************************************************************************************************************************************************************
Build assets, see above.
Running in production
=====================
Currently, to run this software in production, the *state of the art* is the following :
1. Run the software locally and tweak the configuration to your needs ;
2. Build the image and store it in a private container registry.
.. warning::
In production, you **must** set these variables:
* ``APP_ENV`` to ``prod``
* ``APP_DEBUG`` to ``false``
There are security issues if you keep the same variables as for production.
Going further
=============
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@@ -374,3 +21,386 @@ Going further
load-addresses.rst load-addresses.rst
prod-calendar-sms-sending.rst prod-calendar-sms-sending.rst
msgraph-configure.rst msgraph-configure.rst
Requirements
************
- This project use `docker <https://docker.com>`_ to be run. As a developer, use `docker-compose <https://docs.docker.com/compose/overview/>`_ to bootstrap a dev environment in a glance. You do not need any other dependencies ;
- Make is used to automate scripts.
Installation
************
If you plan to run chill in production:
1. install it locally first, and check if everything is ok on your local machine;
2. once ready, build the image from your local machine, and deploy them.
If you want to develop some bundles, the first step is sufficient (until you deploy on production).
1. Get the code
===============
Clone or download the chill-skeleton project and `cd` into the main directory.
.. code-block:: bash
git clone https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic.git
cd chill-skeleton-basic
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
2. Prepare composer to download the sources
===========================================
As you are running in dev, you must configure an auth token for getting the source code.
.. warning
If you skip this part, the code will be downloaded from dist instead of source (with git repository). You will probably replace the source manually, but the next time you will run ```composer update```, your repository will be replaced and you might loose something.
1. Create a personal access token from https://gitlab.com/-/profile/personal_access_tokens, with the `read_api` scope.
2. add a file called ```.composer/auth.json``` with this content:
.. code-block:: json
{
"gitlab-token": {
"gitlab.com": "glXXX-XXXXXXXXXXXXXXXXXXXX"
}
}
2. Prepare your variables and environment
=========================================
Copy ```docker-compose.override.dev.yml``` into ```docker-compose.override.yml```
.. code-block:: bash
cp docker-compose.override.dev.template.yml docker-compose.override.yml
2. Prepare your variables and docker-compose
============================================
Have a look at the variable in ``.env`` and check if you need to adapt them. If they do not adapt with your need, or if some are missing:
1. copy the file as ``.env.local``: ``cp .env .env.local``
2. you may replace some variables inside ``.env``
Prepare also you docker-compose installation, and adapt it to your needs:
1. If you plan to deploy on dev, copy the file ``docker-compose.override.dev.template.yml`` to ``docker-compose.override.yml``.
2. adapt to your needs.
**Note**: If you intend to use the bundle ``Chill-Doc-Store``, you will need to configure and install an openstack object storage container with temporary url middleware. You will have to configure `secret keys <https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html#secret-keys>`_.
3. Run the bootstrap script
===========================
This script can be run using `make`
.. code-block:: bash
make init
This script will :
1. force docker-compose to, eventually, pull the base images and build the image used by this project ;
2. run an install script to download `composer <https://getcomposer.org>`_ ;
3. install the php dependencies
4. build assets
.. warning::
The script will work only if the binary ``docker-compose`` is located into your ``PATH``. If you use ``compose`` as a docker plugin,
you can simulate this binary by creating this file at (for instance), ``/usr/local/bin/docker-compose`` (and run ``chmod +x /usr/local/bin/docker-compose``):
.. code-block:: bash
#!/bin/bash
/usr/bin/docker compose "$@"
.. note::
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
docker-compose images php
docker rmi -f chill_php82:prod
docker-compose rm php
4. Start the project
====================
.. code-block:: bash
docker-compose up
**On the first run** (and after each upgrade), you must execute *post update commands* and run database migrations. With a container up and running, execute the following commands:
.. code-block:: bash
# mount into to container
./docker-php.sh
bin/console chill:db:sync-views
# and load fixtures
bin/console doctrine:migrations:migrate
Chill will be available at ``http://localhost:8001.`` Currently, there isn't any user or data. To add fixtures, run
.. code-block:: bash
# mount into to container
./docker-php.sh
# and load fixtures (do not this for production)
bin/console doctrine:fixtures:load --purge-with-truncate
There are several users available:
- ``center a_social``
- ``center b_social``
The password is always ``password``.
Now, read `Operations` below. For running in production, read `prod_`.
Operations
**********
Build assets
============
run those commands:
.. code-block:: bash
make build-assets
How to execute the console ?
============================
.. code-block:: bash
# if a container is running
./docker-php.sh
# if not
docker-compose run --user $(id -u) php bin/console
How to create the database schema (= run migrations) ?
======================================================
.. code-block:: bash
# if a container is running
./docker-php.sh
bin/console doctrine:migrations:migrate
bin/console chill:db:sync-views
# if not
docker-compose run --user $(id -u) php bin/console doctrine:migrations:migrate
docker-compose run --user $(id -u) php bin/console chill:db:sync-views
How to read the email sent by the program ?
===========================================
Go at ``http://localhost:8005`` and you should have access to mailcatcher.
In case of you should click on a link in the email, be aware that you should remove the "s" from https.
How to load fixtures ? (development mode only)
==============================================
.. code-block:: bash
# if a container is running
./docker-php.sh
bin/console doctrine:fixtures:load
# if not
docker-compose run --user $(id -u) php bin/console doctrine:fixtures:load
How to open a terminal in the project
=====================================
.. code-block:: bash
# if a container is running
./docker-php.sh
# if not
docker-compose run --user $(id -u) php /bin/bash
How to run cron-jobs ?
======================
Some command must be executed in :ref:`cron jobs <cronjob>`. To execute them:
.. code-block:: bash
# if a container is running
./docker-php.sh
bin/console chill:cron-job:execute
# some of them are executed only during the night. So, we have to force the execution during the day:
bin/console chill:cron-job:execute 'name-of-the-cron'
# if not
docker-compose run --user $(id -u) php bin/console chill:cron-job:execute
# some of them are executed only during the night. So, we have to force the execution during the day:
docker-compose run --user $(id -u) php bin/console chill:cron-job:execute 'name-of-the-cron'
How to run composer ?
=====================
.. code-block:: bash
# if a container is running
./docker-php.sh
composer
# if not
docker-compose run --user $(id -u) php composer
How to access to PGADMIN ?
==========================
Pgadmin is installed with docker-compose, and is available **only if you uncomment the appropriate lines into ``docker-compose.override.yml``.
You can access it at ``http://localhost:8002``.
Credentials:
- login: from the variable you set into ``docker-composer.override.yml``
- password: same :-)
How to run tests ?
==================
Tests reside inside the installed bundles. You must `cd` into that directory, download the required packages, and execute them from this place.
**Note**: some bundle require the fixture to be executed. See the dedicated _how-tos_.
Exemple, for running unit test inside `main` bundle:
.. code-block:: bash
# mount into the php image
./docker-php.sh
# cd into main directory
cd vendor/chill-project/chill-bundles
# download deps
git submodule init
git submodule update
composer install
# run tests
bin/phpunit src/Bundle/path/to/your/test
Or for running tests to check code style and php conventions with csfixer and phpstan:
.. code-block:: bash
# run code style fixer
bin/grumphp run --tasks=phpcsfixer
# run phpstan
bin/grumphp run --tasks=phpstan
.. note::
To avoid phpstan block your commits:
.. code-block:: bash
git commit -n ...
To avoid phpstan block your commits permanently:
.. code-block:: bash
./bin/grumphp git:deinit
How to run webpack interactively
================================
Executing :code:`bash docker-node.sh` will open a terminal in a node container, with volumes mounted.
How to switch the branch for chill-bundles, and get new dependencies
====================================================================
During development, you will switch to new branches for chill-bundles. As long as the dependencies are equals, this does not cause any problem. But sometimes, a new branch introduces a new dependency, and you must download it.
.. warning::
Ensure that you have gitlab-token ready before updating your branches. See above.
In order to do that without pain, use those steps:
0. Ensuire you have a token, set
1. at the app's root, update the ``composer.json`` to your current branch:
.. code-block:: json
{
"require": {
"chill-bundles": "dev-<my-branch>@dev"
}
2. mount into the php container (``./docker-php.sh``), and run ``composer update``
Error `An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/app/web/build/manifest.json" does not exist.").` on first run
====================================================================================================================================================================
Run :code:`make build-assets`
Running in production
*********************
Currently, to run this software in production, the *state of the art* is the following :
1. Run the software locally and tweak the configuration to your needs ;
2. Build the image and store them into a private container registry. This can be done using :code:`make build-and-push-image`.
To be sure to target the correct container registry, you have to adapt the image names into your ``docker-compose.override.yml`` file.
3. Push the image on your registry, or upload them to the destination machine using ``docker image save`` and ``docker image load``.
3. Run the image on your production server, using docker-compose or eventually docker stack. You have to customize the variable set in docker-compose.
See also the :ref:`running-production-tips-and-tricks` below.
.. warning::
In production, you **must** set those variables:
* ``APP_ENV`` to ``prod``
* ``APP_DEBUG`` to ``false``
There are security issues if you keep the same variable than for production.
.. _running-production-tips-and-tricks:
Tips and tricks
===============
Operation on database (backups, running custom sql, replication) are easier to set when run outside of a container. If you run into a container, take care of the volume where data are stored.
The PHP sessions are stored inside redis. This is useful if you distribute the traffic amongst different php server: they will share same sessions if a request goes into a different instance of the container.
When the PHP servers are shared across multiple instances, take care that some data is stored into redis: the same redis server should be reachable by all instances.
It is worth having an eye on the configuration of logstash container.
Design principles
*****************
Why the DB URL is also set in environment, and not in .env file ?
=================================================================
Because, at startup, a script does check the db is up and, if not, wait for a couple of seconds before running ``entrypoint.sh``. For avoiding double configuration, the configuration of the PHP app takes his configuration from environment also (and it will be standard in future releases, with symfony 4.0).

View File

@@ -6,33 +6,29 @@
"@apidevtools/swagger-cli": "^4.0.4", "@apidevtools/swagger-cli": "^4.0.4",
"@babel/core": "^7.20.5", "@babel/core": "^7.20.5",
"@babel/preset-env": "^7.20.2", "@babel/preset-env": "^7.20.2",
"@ckeditor/ckeditor5-build-classic": "^41.4.2", "@ckeditor/ckeditor5-build-classic": "^35.3.2",
"@ckeditor/ckeditor5-dev-utils": "^40.2.0", "@ckeditor/ckeditor5-dev-utils": "^31.1.13",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^31.1.13", "@ckeditor/ckeditor5-dev-webpack-plugin": "^31.1.13",
"@ckeditor/ckeditor5-dev-translations": "^40.2.0", "@ckeditor/ckeditor5-markdown-gfm": "^35.3.2",
"@ckeditor/ckeditor5-markdown-gfm": "^41.4.2", "@ckeditor/ckeditor5-theme-lark": "^35.3.2",
"@ckeditor/ckeditor5-theme-lark": "^41.4.2", "@ckeditor/ckeditor5-vue": "^4.0.1",
"@ckeditor/ckeditor5-vue": "^5.1.0",
"@symfony/webpack-encore": "^4.1.0", "@symfony/webpack-encore": "^4.1.0",
"@tsconfig/node14": "^1.0.1", "@tsconfig/node14": "^1.0.1",
"@types/dompurify": "^3.0.5",
"bindings": "^1.5.0", "bindings": "^1.5.0",
"bootstrap": "5.2.3", "bootstrap": "5.2.3",
"chokidar": "^3.5.1", "chokidar": "^3.5.1",
"dompurify": "^3.1.0",
"fork-awesome": "^1.1.7", "fork-awesome": "^1.1.7",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"node-sass": "^8.0.0", "node-sass": "^8.0.0",
"marked": "^12.0.1",
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
"postcss-loader": "^7.0.2", "postcss-loader": "^7.0.2",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"sass-loader": "^14.0.0", "sass-loader": "^13.0.0",
"select2": "^4.0.13", "select2": "^4.0.13",
"select2-bootstrap-theme": "0.1.0-beta.10", "select2-bootstrap-theme": "0.1.0-beta.10",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"ts-loader": "^9.3.1", "ts-loader": "^9.3.1",
"typescript": "^5.4.5", "typescript": "^4.7.2",
"vue-loader": "^17.0.0", "vue-loader": "^17.0.0",
"webpack": "^5.75.0", "webpack": "^5.75.0",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.0.1"
@@ -58,7 +54,7 @@
"vue": "^3.2.37", "vue": "^3.2.37",
"vue-i18n": "^9.1.6", "vue-i18n": "^9.1.6",
"vue-multiselect": "3.0.0-alpha.2", "vue-multiselect": "3.0.0-alpha.2",
"vue-toast-notification": "^3.1.2", "vue-toast-notification": "^2.0",
"vuex": "^4.0.0" "vuex": "^4.0.0"
}, },
"browserslist": [ "browserslist": [

View File

@@ -4,11 +4,3 @@ parameters:
message: "#^Parameter \\#1 \\$records of method League\\\\Csv\\\\Writer\\:\\:insertAll\\(\\) expects iterable\\<array\\<float\\|int\\|string\\|Stringable\\|null\\>\\>, iterable\\<array\\<string, bool\\|int\\|string\\>\\> given\\.$#" message: "#^Parameter \\#1 \\$records of method League\\\\Csv\\\\Writer\\:\\:insertAll\\(\\) expects iterable\\<array\\<float\\|int\\|string\\|Stringable\\|null\\>\\>, iterable\\<array\\<string, bool\\|int\\|string\\>\\> given\\.$#"
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Controller/UserExportController.php path: src/Bundle/ChillMainBundle/Controller/UserExportController.php
-
message: """
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Ascending instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php

View File

@@ -1,58 +0,0 @@
# See https://github.com/doctrine/orm/issues/11313 for a follow-up
parameters:
ignoreErrors:
-
message: """
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Ascending instead$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message: """
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Ascending instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Entity/Notification.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 2
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 2
path: src/Bundle/ChillPersonBundle/Entity/Person.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php

View File

@@ -100,6 +100,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillEventBundle/Controller/EventController.php path: src/Bundle/ChillEventBundle/Controller/EventController.php
-
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Controller/EventController.php
- -
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#" message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#"
count: 1 count: 1
@@ -160,6 +165,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php path: src/Bundle/ChillMainBundle/Controller/ExportController.php
-
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
- -
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#" message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
count: 1 count: 1

View File

@@ -5,26 +5,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
-
message: "#^Property Chill\\\\CustomFieldsBundle\\\\Entity\\\\CustomField\\:\\:\\$required \\(false\\) does not accept bool\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
-
message: "#^Parameter \\#1 \\$user of method Chill\\\\DocStoreBundle\\\\Entity\\\\Document\\:\\:setUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
count: 2
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php
-
message: "#^Parameter \\#1 \\$user of method Chill\\\\DocStoreBundle\\\\Entity\\\\Document\\:\\:setUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
count: 2
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
- -
message: "#^Variable \\$participation might not be defined\\.$#" message: "#^Variable \\$participation might not be defined\\.$#"
count: 3 count: 3
@@ -35,106 +15,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
-
message: "#^Comparison operation \"\\>\" between \\(bool\\|int\\|Redis\\) and 0 results in an error\\.$#"
count: 1
path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/ApiWrapper.php
-
message: "#^Variable \\$response might not be defined\\.$#"
count: 1
path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/ApiWrapper.php
-
message: "#^Function GuzzleHttp\\\\Psr7\\\\get not found\\.$#"
count: 1
path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php
-
message: "#^Function GuzzleHttp\\\\Psr7\\\\str not found\\.$#"
count: 2
path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php
-
message: "#^Parameter \\#1 \\$seconds of function sleep expects int, string given\\.$#"
count: 1
path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php
-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php
-
message: "#^Parameter \\#1 \\$interval of method DateTimeImmutable\\:\\:add\\(\\) expects DateInterval, string\\|null given\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Entity/Immersion.php
-
message: "#^Parameter \\#1 \\$object of static method DateTimeImmutable\\:\\:createFromMutable\\(\\) expects DateTime, DateTimeInterface given\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Entity/Immersion.php
-
message: "#^Property Chill\\\\JobBundle\\\\Entity\\\\Rome\\\\Metier\\:\\:\\$appellations is never read, only written\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Entity/Rome/Metier.php
-
message: "#^Method Chill\\\\JobBundle\\\\Export\\\\ListCSPerson\\:\\:splitArrayToColumns\\(\\) never returns Closure so it can be removed from the return type\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Export/ListCSPerson.php
-
message: "#^Variable \\$f might not be defined\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Export/ListCSPerson.php
-
message: "#^Method Chill\\\\JobBundle\\\\Export\\\\ListFrein\\:\\:splitArrayToColumns\\(\\) never returns Closure so it can be removed from the return type\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Export/ListFrein.php
-
message: "#^Method Chill\\\\JobBundle\\\\Export\\\\ListProjetProfessionnel\\:\\:splitArrayToColumns\\(\\) never returns Closure so it can be removed from the return type\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php
-
message: "#^Property Chill\\\\JobBundle\\\\Form\\\\ChoiceLoader\\\\RomeAppellationChoiceLoader\\:\\:\\$appellationRepository \\(Chill\\\\JobBundle\\\\Repository\\\\Rome\\\\AppellationRepository\\) does not accept Doctrine\\\\ORM\\\\EntityRepository\\<Chill\\\\JobBundle\\\\Entity\\\\Rome\\\\Appellation\\>\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php
-
message: "#^Result of && is always false\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php
-
message: "#^Strict comparison using \\=\\=\\= between array\\{\\} and Symfony\\\\Component\\\\Validator\\\\ConstraintViolationListInterface will always evaluate to false\\.$#"
count: 2
path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php
-
message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php
-
message: "#^Variable \\$metier might not be defined\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php
-
message: "#^Parameter \\#1 \\$interval of method DateTimeImmutable\\:\\:add\\(\\) expects DateInterval, string\\|null given\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Security/Authorization/CSConnectesVoter.php
-
message: "#^Parameter \\#1 \\$object of static method DateTimeImmutable\\:\\:createFromMutable\\(\\) expects DateTime, DateTimeInterface given\\.$#"
count: 1
path: src/Bundle/ChillJobBundle/src/Security/Authorization/CSConnectesVoter.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
@@ -160,31 +40,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
-
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccessForCenter\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.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: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/PersonType.php
- -
message: "#^Foreach overwrites \\$value with its value variable\\.$#" message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1 count: 1

View File

@@ -1,153 +0,0 @@
parameters:
ignoreErrors:
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 2
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 3
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 2
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\EncoderFactory\\:
since Symfony 5\\.3, use \\{@link PasswordHasherFactory\\} instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/MenuController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/SearchController.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/UserController.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\EncoderFactory\\:
since Symfony 5\\.3, use \\{@link PasswordHasherFactory\\} instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 2
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 3
path: src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 13
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 4
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 7
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php

View File

@@ -1,5 +1,36 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
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: 2
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
-
message: "#^Call to deprecated method setType\\(\\) of class Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReason.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
- -
message: """ message: """
@@ -9,10 +40,201 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.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/Timeline/TimelineActivityProvider.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Used function LogicException not found\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
-
message: """
#^Parameter \\$twigEngine of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php
- -
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.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: 6
path: src/Bundle/ChillEventBundle/Controller/EventController.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/EventType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.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/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
-
message: """
#^Parameter \\$role of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has typehint with 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/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: """
#^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: """
#^Call to deprecated method getRegionBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Countries\\} instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.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/ChillMainBundle/Controller/PermissionsGroupController.php
-
message: """
#^Parameter \\$role of anonymous function has typehint with 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/ChillMainBundle/Controller/PermissionsGroupController.php
-
message: """
#^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$#
"""
count: 2
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
-
message: """
#^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with 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/ChillMainBundle/Entity/User.php
-
message: """
#^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
-
message: """
#^Parameter \\$attribute of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccess\\(\\) has typehint with 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/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
- -
message: """ message: """
@@ -22,6 +244,14 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
-
message: """
#^Parameter \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCircles\\(\\) has typehint with 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/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -46,6 +276,14 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php
-
message: """
#^Class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
- -
message: """ message: """
#^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -54,6 +292,35 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php
-
message: """
#^Class Chill\\\\MainBundle\\\\Templating\\\\Events\\\\DelegatedBlockRenderingEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Actions\\\\ActionEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Actions/ActionEvent.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
- -
message: """ message: """
#^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\: #^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\:
@@ -62,10 +329,56 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Controller\\\\PersonDuplicateController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
- -
message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#" message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#"
count: 2 count: 2
path: src/Bundle/ChillPersonBundle/Entity/Person.php path: src/Bundle/ChillPersonBundle/Entity/Person.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/ChillPersonBundle/Form/AccompanyingPeriodType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/PersonType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Privacy\\\\AccompanyingPeriodPrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Privacy\\\\PrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -74,6 +387,48 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.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/ChillPersonBundle/Widget/PersonListWidget.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 3
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
-
message: """
#^Parameter \\$role of method Chill\\\\ReportBundle\\\\Form\\\\ReportType\\:\\:appendScopeChoices\\(\\) has typehint with 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/ChillReportBundle/Form/ReportType.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/ChillReportBundle/Search/ReportSearch.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: 2
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -82,6 +437,46 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
-
message: """
#^Parameter \\$role of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:setCreateForm\\(\\) has typehint with 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/ChillTaskBundle/Controller/SingleTaskController.php
-
message: """
#^Class Chill\\\\TaskBundle\\\\Event\\\\TaskEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Event/TaskEvent.php
-
message: """
#^Class Chill\\\\TaskBundle\\\\Event\\\\UI\\\\UIEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Event/UI/UIEvent.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: 4
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -89,3 +484,28 @@ parameters:
""" """
count: 1 count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.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/ChillTaskBundle/Repository/SingleTaskRepository.php
-
message: """
#^Class Chill\\\\TaskBundle\\\\Security\\\\Authorization\\\\AuthorizationEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 3
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php

View File

@@ -31,7 +31,5 @@ includes:
- phpstan-baseline-level-3.neon - phpstan-baseline-level-3.neon
- phpstan-baseline-level-4.neon - phpstan-baseline-level-4.neon
- phpstan-baseline-level-5.neon - phpstan-baseline-level-5.neon
- phpstan-deprecations-sf54.neon
- phpstan-baseline-deprecations-doctrine-orm.neon
- phpstan-baseline-2024-05.neon - phpstan-baseline-2024-05.neon

View File

@@ -1,13 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" colors="true" cacheDirectory="var/cache/phpunit.rector.cache" requireCoverageMetadata="true" beStrictAboutCoverageMetadata="true"> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<testsuites> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
<testsuite name="default"> bootstrap="tests/app/vendor/autoload.php"
<directory>utils/rector/tests</directory> cacheResultFile=".cache/phpunit/test-results-rector"
</testsuite> executionOrder="depends,defects"
</testsuites> forceCoversAnnotation="true"
<source> beStrictAboutCoversAnnotation="true"
<include> beStrictAboutOutputDuringTests="true"
<directory suffix=".php">utils/rector/src</directory> beStrictAboutTodoAnnotatedTests="true"
</include> convertDeprecationsToExceptions="true"
</source> failOnRisky="true"
failOnWarning="true"
verbose="true"
colors="true"
>
<testsuites>
<testsuite name="default">
<directory>utils/rector/tests</directory>
</testsuite>
</testsuites>
<coverage cacheDirectory=".cache/phpunit/code-coverage-rector"
processUncoveredFiles="true">
<include>
<directory suffix=".php">utils/rector/src</directory>
</include>
</coverage>
</phpunit> </phpunit>

View File

@@ -1,73 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html --> <!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="tests/bootstrap.php"> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<php> xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
<ini name="error_reporting" value="-1"/> backupGlobals="false"
<server name="APP_ENV" value="test" force="true"/> colors="true"
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=93&amp;max[indirect]=999999"/> bootstrap="tests/bootstrap.php"
<server name="SHELL_VERBOSITY" value="-1"/> >
<env name="KERNEL_CLASS" value="\App\Kernel"/> <php>
</php> <ini name="error_reporting" value="-1" />
<testsuites> <server name="APP_ENV" value="test" force="true" />
<!-- <env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0&amp;max[indirect]=999999" />
<server name="SHELL_VERBOSITY" value="-1" />
<env name="KERNEL_CLASS" value="\App\Kernel" />
</php>
<testsuites>
<!--
<testsuite name="ActivityBundle"> <testsuite name="ActivityBundle">
<directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory>
</testsuite> </testsuite>
--> -->
<testsuite name="AsideActivityBundle"> <testsuite name="AsideActivityBundle">
<directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory>
</testsuite> </testsuite>
<testsuite name="BudgetBundle"> <testsuite name="BudgetBundle">
<directory suffix="Test.php">src/Bundle/ChillBudgetBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillBudgetBundle/Tests/</directory>
</testsuite> </testsuite>
<testsuite name="CalendarBundle"> <testsuite name="CalendarBundle">
<directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory>
</testsuite> </testsuite>
<!-- Missing CustomFieldBundle --> <!-- Missing CustomFieldBundle -->
<testsuite name="DocGeneratorBundle"> <testsuite name="DocGeneratorBundle">
<directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory> <directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory>
</testsuite> </testsuite>
<testsuite name="DocStoreBundle"> <testsuite name="DocStoreBundle">
<directory suffix="Test.php">src/Bundle/ChillDocStoreBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillDocStoreBundle/Tests/</directory>
</testsuite> </testsuite>
<!-- <!--
<testsuite name="EventBundle"> <testsuite name="EventBundle">
<directory suffix="Test.php">src/Bundle/ChillEventBundle/tests/</directory> <directory suffix="Test.php">src/Bundle/ChillEventBundle/tests/</directory>
</testsuite> </testsuite>
--> -->
<testsuite name="MainBundle"> <testsuite name="MainBundle">
<directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
</testsuite> </testsuite>
<testsuite name="PersonBundle"> <testsuite name="PersonBundle">
<directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
<!-- we are rewriting accompanying periods... Work in progress --> <!-- we are rewriting accompanying periods... Work in progress -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude>
<!-- we are rewriting address, Work in progress --> <!-- we are rewriting address, Work in progress -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude>
<!-- find a solution to create multiple configs --> <!-- find a solution to create multiple configs -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude>
<!-- temporarily removed, the time to find a fix --> <!-- temporarily removed, the time to find a fix -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
</testsuite> </testsuite>
<!-- <!--
<testsuite name="ReportBundle"> <testsuite name="ReportBundle">
<directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory>
</testsuite> </testsuite>
--> -->
<!-- <!--
<testsuite name="TaskBundle"> <testsuite name="TaskBundle">
<directory suffix="Test.php">src/Bundle/ChillTaskBundle/Tests</directory> <directory suffix="Test.php">src/Bundle/ChillTaskBundle/Tests</directory>
</testsuite> </testsuite>
--> -->
<testsuite name="ThirdPartyBundle"> <testsuite name="ThirdPartyBundle">
<directory suffix="Test.php">src/Bundle/ChillThirdPartyBundle/Tests</directory> <directory suffix="Test.php">src/Bundle/ChillThirdPartyBundle/Tests</directory>
</testsuite> </testsuite>
<testsuite name="WopiBundle"> <testsuite name="WopiBundle">
<directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory> <directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<!-- Run `composer require symfony/panther` before enabling this extension -->
<!-- <listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<!-- Run `composer require symfony/panther` before enabling this extension -->
<!--
<extensions> <extensions>
<extension class="Symfony\Component\Panther\ServerExtension" /> <extension class="Symfony\Component\Panther\ServerExtension" />
</extensions> </extensions>

View File

@@ -11,7 +11,6 @@ declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void { return static function (RectorConfig $rectorConfig): void {
@@ -20,7 +19,7 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/src', __DIR__ . '/src',
]); ]);
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/test/App_KernelTestDebugContainer.xml '); $rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/testsApp_KernelDevDebugContainer.xml');
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php'); $rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class); //$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
@@ -28,49 +27,25 @@ return static function (RectorConfig $rectorConfig): void {
// register a single rule // register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Class_\MergeDateTimePropertyTypeDeclarationRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector::class);
// part of the symfony 54 rules
$rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class);
$rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class);
$rectorConfig->disableParallel(); $rectorConfig->disableParallel();
//define sets of rules //define sets of rules
$rectorConfig->sets([ $rectorConfig->sets([
LevelSetList::UP_TO_PHP_83, LevelSetList::UP_TO_PHP_82,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_40, \Rector\Symfony\Set\SymfonySetList::SYMFONY_40,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_41, \Rector\Symfony\Set\SymfonySetList::SYMFONY_41,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_42, \Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_43, \Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_44, \Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50, \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51, \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
// \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
// \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
]);
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
new \Rector\Php80\ValueObject\AnnotationToAttribute('Symfony\Component\Serializer\Annotation\Context'),
]);
// migrate for phpunit
$rectorConfig->rules([
\Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector::class,
\Rector\PHPUnit\PHPUnit100\Rector\Class_\PublicDataProviderClassMethodRector::class
]); ]);
// some routes are added twice if it remains activated // some routes are added twice if it remains activated
// $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class); // $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class);
// chill rules // chill rules
$rectorConfig->rules([ //$rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class);
\Chill\Utils\Rector\Rector\ChillBundleMakeDataProviderStaticForAbstractExportTestRector::class,
]);
// skip some path... // skip some path...
$rectorConfig->skip([ $rectorConfig->skip([
@@ -78,22 +53,4 @@ return static function (RectorConfig $rectorConfig): void {
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class, \Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class, \Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
]); ]);
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
]);
}; };

View File

@@ -13,4 +13,6 @@ namespace Chill\ActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillActivityBundle extends Bundle {} class ChillActivityBundle extends Bundle
{
}

View File

@@ -24,7 +24,6 @@ use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Repository\LocationRepository; use Chill\MainBundle\Repository\LocationRepository;
use Chill\MainBundle\Repository\UserRepositoryInterface; use Chill\MainBundle\Repository\UserRepositoryInterface;
use Chill\MainBundle\Security\ChillSecurity;
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface; use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
use Chill\MainBundle\Templating\Listing\FilterOrderHelper; use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface; use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
@@ -68,13 +67,14 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory, private readonly PaginatorFactory $paginatorFactory,
private readonly ChillSecurity $security ) {
) {} }
/** /**
* Deletes a Activity entity. * Deletes a Activity entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/delete", name="chill_activity_activity_delete", methods={"GET", "POST", "DELETE"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])]
public function deleteAction(Request $request, mixed $id) public function deleteAction(Request $request, mixed $id)
{ {
$view = null; $view = null;
@@ -99,10 +99,10 @@ final class ActivityController extends AbstractController
$form = $this->createDeleteForm($activity->getId(), $person, $accompanyingPeriod); $form = $this->createDeleteForm($activity->getId(), $person, $accompanyingPeriod);
if (Request::METHOD_POST === $request->getMethod()) { if (Request::METHOD_DELETE === $request->getMethod()) {
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isValid()) {
$this->logger->notice('An activity has been removed', [ $this->logger->notice('An activity has been removed', [
'by_user' => $this->getUser()->getUsername(), 'by_user' => $this->getUser()->getUsername(),
'activity_id' => $activity->getId(), 'activity_id' => $activity->getId(),
@@ -142,8 +142,9 @@ final class ActivityController extends AbstractController
/** /**
* Displays a form to edit an existing Activity entity. * Displays a form to edit an existing Activity entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/edit", name="chill_activity_activity_edit", methods={"GET", "POST", "PUT"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/edit', name: 'chill_activity_activity_edit', methods: ['GET', 'POST', 'PUT'])]
public function editAction(int $id, Request $request): Response public function editAction(int $id, Request $request): Response
{ {
$view = null; $view = null;
@@ -236,8 +237,9 @@ final class ActivityController extends AbstractController
/** /**
* Lists all Activity entities. * Lists all Activity entities.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/", name="chill_activity_activity_list")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/', name: 'chill_activity_activity_list')]
public function listAction(Request $request): Response public function listAction(Request $request): Response
{ {
$view = null; $view = null;
@@ -341,7 +343,9 @@ final class ActivityController extends AbstractController
return $filterBuilder->build(); return $filterBuilder->build();
} }
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/new', name: 'chill_activity_activity_new', methods: ['POST', 'GET'])] /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/new", name="chill_activity_activity_new", methods={"POST", "GET"})
*/
public function newAction(Request $request): Response public function newAction(Request $request): Response
{ {
$view = null; $view = null;
@@ -381,7 +385,7 @@ final class ActivityController extends AbstractController
} }
$entity = new Activity(); $entity = new Activity();
$entity->setUser($this->security->getUser()); $entity->setUser($this->getUser());
if ($person instanceof Person) { if ($person instanceof Person) {
$entity->setPerson($person); $entity->setPerson($person);
@@ -396,7 +400,7 @@ final class ActivityController extends AbstractController
$entity->setDate(new \DateTime('now')); $entity->setDate(new \DateTime('now'));
if ($request->query->has('activityData')) { if ($request->query->has('activityData')) {
$activityData = $request->query->all('activityData'); $activityData = $request->query->get('activityData');
if (\array_key_exists('durationTime', $activityData) && $activityType->getDurationTimeVisible() > 0) { if (\array_key_exists('durationTime', $activityData) && $activityType->getDurationTimeVisible() > 0) {
$durationTimeInMinutes = $activityData['durationTime']; $durationTimeInMinutes = $activityData['durationTime'];
@@ -449,7 +453,7 @@ final class ActivityController extends AbstractController
if (\array_key_exists('comment', $activityData) && $activityType->getCommentVisible() > 0) { if (\array_key_exists('comment', $activityData) && $activityType->getCommentVisible() > 0) {
$comment = new CommentEmbeddable(); $comment = new CommentEmbeddable();
$comment->setComment($activityData['comment']); $comment->setComment($activityData['comment']);
$comment->setUserId($this->security->getUser()->getId()); $comment->setUserId($this->getUser()->getid());
$comment->setDate(new \DateTime('now')); $comment->setDate(new \DateTime('now'));
$entity->setComment($comment); $entity->setComment($comment);
} }
@@ -510,7 +514,7 @@ final class ActivityController extends AbstractController
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']); $activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
$defaultLocation = $this->security->getUser()->getCurrentLocation(); $defaultLocation = $this->getUser()->getCurrentLocation();
return $this->render($view, [ return $this->render($view, [
'person' => $person, 'person' => $person,
@@ -522,7 +526,9 @@ final class ActivityController extends AbstractController
]); ]);
} }
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/select-type', name: 'chill_activity_activity_select_type')] /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/select-type", name="chill_activity_activity_select_type")
*/
public function selectTypeAction(Request $request): Response public function selectTypeAction(Request $request): Response
{ {
$view = null; $view = null;
@@ -563,11 +569,13 @@ final class ActivityController extends AbstractController
'person' => $person, 'person' => $person,
'accompanyingCourse' => $accompanyingPeriod, 'accompanyingCourse' => $accompanyingPeriod,
'data' => $data, 'data' => $data,
'activityData' => $request->query->all('activityData'), 'activityData' => $request->query->get('activityData', []),
]); ]);
} }
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/show', name: 'chill_activity_activity_show')] /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/show", name="chill_activity_activity_show")
*/
public function showAction(Request $request, int $id): Response public function showAction(Request $request, int $id): Response
{ {
$entity = $this->activityRepository->find($id); $entity = $this->activityRepository->find($id);
@@ -640,6 +648,7 @@ final class ActivityController extends AbstractController
return $this->createFormBuilder() return $this->createFormBuilder()
->setAction($this->generateUrl('chill_activity_activity_delete', $params)) ->setAction($this->generateUrl('chill_activity_activity_delete', $params))
->setMethod('DELETE')
->add('submit', SubmitType::class, ['label' => 'Delete']) ->add('submit', SubmitType::class, ['label' => 'Delete'])
->getForm(); ->getForm();
} }

View File

@@ -22,12 +22,11 @@ use Symfony\Component\HttpFoundation\Request;
*/ */
class ActivityReasonCategoryController extends AbstractController class ActivityReasonCategoryController extends AbstractController
{ {
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
/** /**
* Creates a new ActivityReasonCategory entity. * Creates a new ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/create", name="chill_activity_activityreasoncategory_create", methods={"POST"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])]
public function createAction(Request $request) public function createAction(Request $request)
{ {
$entity = new ActivityReasonCategory(); $entity = new ActivityReasonCategory();
@@ -35,7 +34,7 @@ class ActivityReasonCategoryController extends AbstractController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
@@ -50,11 +49,12 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Displays a form to edit an existing ActivityReasonCategory entity. * Displays a form to edit an existing ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/edit", name="chill_activity_activityreasoncategory_edit")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')]
public function editAction(mixed $id) public function editAction(mixed $id)
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id); $entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
@@ -72,11 +72,12 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Lists all ActivityReasonCategory entities. * Lists all ActivityReasonCategory entities.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/", name="chill_activity_activityreasoncategory")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')]
public function indexAction() public function indexAction()
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entities = $em->getRepository(ActivityReasonCategory::class)->findAll(); $entities = $em->getRepository(ActivityReasonCategory::class)->findAll();
@@ -87,8 +88,9 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Displays a form to create a new ActivityReasonCategory entity. * Displays a form to create a new ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/new", name="chill_activity_activityreasoncategory_new")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')]
public function newAction() public function newAction()
{ {
$entity = new ActivityReasonCategory(); $entity = new ActivityReasonCategory();
@@ -102,11 +104,12 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Finds and displays a ActivityReasonCategory entity. * Finds and displays a ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/show", name="chill_activity_activityreasoncategory_show")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')]
public function showAction(mixed $id) public function showAction(mixed $id)
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id); $entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
@@ -121,11 +124,12 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Edits an existing ActivityReasonCategory entity. * Edits an existing ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/update", name="chill_activity_activityreasoncategory_update", methods={"POST", "PUT"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id) public function updateAction(Request $request, mixed $id)
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id); $entity = $em->getRepository(ActivityReasonCategory::class)->find($id);

View File

@@ -24,12 +24,15 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/ */
class ActivityReasonController extends AbstractController class ActivityReasonController extends AbstractController
{ {
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} public function __construct(private readonly ActivityReasonRepository $activityReasonRepository)
{
}
/** /**
* Creates a new ActivityReason entity. * Creates a new ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/create", name="chill_activity_activityreason_create", methods={"POST"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])]
public function createAction(Request $request) public function createAction(Request $request)
{ {
$entity = new ActivityReason(); $entity = new ActivityReason();
@@ -37,7 +40,7 @@ class ActivityReasonController extends AbstractController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
@@ -52,11 +55,12 @@ class ActivityReasonController extends AbstractController
/** /**
* Displays a form to edit an existing ActivityReason entity. * Displays a form to edit an existing ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/edit", name="chill_activity_activityreason_edit")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')]
public function editAction(mixed $id) public function editAction(mixed $id)
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(ActivityReason::class)->find($id); $entity = $em->getRepository(ActivityReason::class)->find($id);
@@ -74,11 +78,12 @@ class ActivityReasonController extends AbstractController
/** /**
* Lists all ActivityReason entities. * Lists all ActivityReason entities.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/", name="chill_activity_activityreason")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')]
public function indexAction() public function indexAction()
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entities = $this->activityReasonRepository->findAll(); $entities = $this->activityReasonRepository->findAll();
@@ -89,8 +94,9 @@ class ActivityReasonController extends AbstractController
/** /**
* Displays a form to create a new ActivityReason entity. * Displays a form to create a new ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/new", name="chill_activity_activityreason_new")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')]
public function newAction() public function newAction()
{ {
$entity = new ActivityReason(); $entity = new ActivityReason();
@@ -104,11 +110,12 @@ class ActivityReasonController extends AbstractController
/** /**
* Finds and displays a ActivityReason entity. * Finds and displays a ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/show", name="chill_activity_activityreason_show")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')]
public function showAction(mixed $id) public function showAction(mixed $id)
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(ActivityReason::class)->find($id); $entity = $em->getRepository(ActivityReason::class)->find($id);
@@ -123,11 +130,12 @@ class ActivityReasonController extends AbstractController
/** /**
* Edits an existing ActivityReason entity. * Edits an existing ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/update", name="chill_activity_activityreason_update", methods={"POST", "PUT"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id) public function updateAction(Request $request, mixed $id)
{ {
$em = $this->managerRegistry->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(ActivityReason::class)->find($id); $entity = $em->getRepository(ActivityReason::class)->find($id);

View File

@@ -22,7 +22,6 @@ class AdminActivityPresenceController extends CRUDController
* *
* @return \Doctrine\ORM\QueryBuilder|mixed * @return \Doctrine\ORM\QueryBuilder|mixed
*/ */
#[\Override]
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{ {
/* @var \Doctrine\ORM\QueryBuilder $query */ /* @var \Doctrine\ORM\QueryBuilder $query */

View File

@@ -22,7 +22,6 @@ class AdminActivityTypeCategoryController extends CRUDController
* *
* @return \Doctrine\ORM\QueryBuilder|mixed * @return \Doctrine\ORM\QueryBuilder|mixed
*/ */
#[\Override]
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{ {
/* @var \Doctrine\ORM\QueryBuilder $query */ /* @var \Doctrine\ORM\QueryBuilder $query */

View File

@@ -22,7 +22,6 @@ class AdminActivityTypeController extends CRUDController
* *
* @return \Doctrine\ORM\QueryBuilder|mixed * @return \Doctrine\ORM\QueryBuilder|mixed
*/ */
#[\Override]
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{ {
/* @var \Doctrine\ORM\QueryBuilder $query */ /* @var \Doctrine\ORM\QueryBuilder $query */

View File

@@ -18,14 +18,18 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
*/ */
class AdminController extends AbstractController class AdminController extends AbstractController
{ {
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')] /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity", name="chill_activity_admin_index")
*/
public function indexActivityAction() public function indexActivityAction()
{ {
return $this->render('@ChillActivity/Admin/layout_activity.html.twig'); return $this->render('@ChillActivity/Admin/layout_activity.html.twig');
} }
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])] /**
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')] * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity_redirect_to_main", name="chill_admin_aside_activity_redirect_to_admin_index", options={null})
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity_redirect_to_main", name="chill_admin_activity_redirect_to_admin_index")
*/
public function redirectToAdminIndexAction() public function redirectToAdminIndexAction()
{ {
return $this->redirectToRoute('chill_main_admin_central'); return $this->redirectToRoute('chill_main_admin_central');

View File

@@ -32,13 +32,11 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
$this->faker = FakerFactory::create('fr_FR'); $this->faker = FakerFactory::create('fr_FR');
} }
#[\Override]
public function getOrder() public function getOrder()
{ {
return 16400; return 16400;
} }
#[\Override]
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$persons = $this->em $persons = $this->em
@@ -66,7 +64,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
->setPerson($person) ->setPerson($person)
->setDate($this->faker->dateTimeThisYear()) ->setDate($this->faker->dateTimeThisYear())
->setDurationTime($this->faker->dateTime(36000)) ->setDurationTime($this->faker->dateTime(36000))
->setActivityType($this->getRandomActivityType()) ->setType($this->getRandomActivityType())
->setScope($this->getRandomScope()); ->setScope($this->getRandomScope());
// ->setAttendee($this->faker->boolean()) // ->setAttendee($this->faker->boolean())

View File

@@ -38,7 +38,6 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt
], ],
]; ];
#[\Override]
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@@ -23,13 +23,11 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf
{ {
public static $references = []; public static $references = [];
#[\Override]
public function getOrder() public function getOrder()
{ {
return 16300; return 16300;
} }
#[\Override]
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$reasons = [ $reasons = [

View File

@@ -21,13 +21,11 @@ use Doctrine\Persistence\ObjectManager;
*/ */
class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface
{ {
#[\Override]
public function getOrder() public function getOrder()
{ {
return 16200; return 16200;
} }
#[\Override]
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$categs = [ $categs = [

View File

@@ -23,13 +23,11 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface
{ {
public static $references = []; public static $references = [];
#[\Override]
public function getOrder() public function getOrder()
{ {
return 16100; return 16100;
} }
#[\Override]
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$types = [ $types = [

View File

@@ -23,13 +23,11 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac
{ {
public static $references = []; public static $references = [];
#[\Override]
public function getOrder() public function getOrder()
{ {
return 16050; return 16050;
} }
#[\Override]
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$categories = [ $categories = [

View File

@@ -26,13 +26,11 @@ use Doctrine\Persistence\ObjectManager;
*/ */
class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface
{ {
#[\Override]
public function getOrder() public function getOrder()
{ {
return 16000; return 16000;
} }
#[\Override]
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) {

View File

@@ -25,7 +25,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/ */
class ChillActivityExtension extends Extension implements PrependExtensionInterface class ChillActivityExtension extends Extension implements PrependExtensionInterface
{ {
#[\Override]
public function load(array $configs, ContainerBuilder $container) public function load(array $configs, ContainerBuilder $container)
{ {
$configuration = new Configuration(); $configuration = new Configuration();
@@ -45,7 +44,6 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
$loader->load('services/doctrine.entitylistener.yaml'); $loader->load('services/doctrine.entitylistener.yaml');
} }
#[\Override]
public function prepend(ContainerBuilder $container) public function prepend(ContainerBuilder $container)
{ {
$this->prependRoutes($container); $this->prependRoutes($container);

View File

@@ -22,7 +22,6 @@ use function is_int;
*/ */
class Configuration implements ConfigurationInterface class Configuration implements ConfigurationInterface
{ {
#[\Override]
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {
$treeBuilder = new TreeBuilder('chill_activity'); $treeBuilder = new TreeBuilder('chill_activity');

View File

@@ -25,12 +25,14 @@ use Chill\MainBundle\Entity\HasScopesInterface;
use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface; use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\ThirdPartyBundle\Entity\ThirdParty; use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@@ -41,131 +43,205 @@ use Symfony\Component\Validator\Constraints as Assert;
/** /**
* Class Activity. * Class Activity.
*
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
*
* @ORM\Table(name="activity")
*
* @ORM\HasLifecycleCallbacks
*
* @DiscriminatorMap(typeProperty="type", mapping={
* "activity": Activity::class
* })
*
* @ActivityValidator\ActivityValidity
*
* TODO see if necessary
* UserCircleConsistency(
* "CHILL_ACTIVITY_SEE_DETAILS",
* getUserFunction="getUser",
* path="scope")
*/ */
#[DiscriminatorMap(typeProperty: 'type', mapping: ['activity' => Activity::class])]
#[ORM\Entity(repositoryClass: \Chill\ActivityBundle\Repository\ActivityRepository::class)]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activity')]
#[ActivityValidator\ActivityValidity] // TODO see if necessary
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface
{ {
use TrackCreationTrait; use TrackCreationTrait;
use TrackUpdateTrait; use TrackUpdateTrait;
final public const string SENTRECEIVED_RECEIVED = 'received'; final public const SENTRECEIVED_RECEIVED = 'received';
final public const string SENTRECEIVED_SENT = 'sent'; final public const SENTRECEIVED_SENT = 'sent';
#[Groups(['read'])] /**
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)] * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
*
* @Groups({"read"})
*/
private ?AccompanyingPeriod $accompanyingPeriod = null; private ?AccompanyingPeriod $accompanyingPeriod = null;
#[Groups(['read', 'docgen:read'])] /**
#[SerializedName('activityType')] * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
#[ORM\ManyToOne(targetEntity: ActivityType::class)] *
#[ORM\JoinColumn(name: 'type_id')] * @Groups({"read", "docgen:read"})
*
* @SerializedName("activityType")
*
* @ORM\JoinColumn(name="type_id")
*/
private ActivityType $activityType; private ActivityType $activityType;
#[Groups(['docgen:read'])] /**
#[ORM\ManyToOne(targetEntity: ActivityPresence::class)] * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
*
* @Groups({"docgen:read"})
*/
private ?ActivityPresence $attendee = null; private ?ActivityPresence $attendee = null;
#[Groups(['docgen:read'])] /**
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')] * @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
*
* @Groups({"docgen:read"})
*/
private CommentEmbeddable $comment; private CommentEmbeddable $comment;
#[Groups(['docgen:read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)] * @ORM\Column(type="datetime")
*
* @Groups({"docgen:read"})
*/
private \DateTime $date; private \DateTime $date;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
*
* @Assert\Valid(traverse=true)
*
* @var Collection<StoredObject> * @var Collection<StoredObject>
*/ */
#[Assert\Valid(traverse: true)]
#[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist'])]
private Collection $documents; private Collection $documents;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)] /**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTime $durationTime = null; private ?\DateTime $durationTime = null;
#[Groups(['docgen:read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])] * @ORM\Column(type="boolean", options={"default": false})
*
* @Groups({"docgen:read"})
*/
private bool $emergency = false; private bool $emergency = false;
#[Groups(['read', 'docgen:read'])] /**
#[ORM\Id] * @ORM\Id
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] *
#[ORM\GeneratedValue(strategy: 'AUTO')] * @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read", "docgen:read"})
*/
private ?int $id = null; private ?int $id = null;
#[Groups(['read', 'docgen:read'])] /**
#[ORM\ManyToOne(targetEntity: Location::class)] * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
*
* @groups({"read", "docgen:read"})
*/
private ?Location $location = null; private ?Location $location = null;
#[ORM\ManyToOne(targetEntity: Person::class)] /**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?Person $person = null; private ?Person $person = null;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<Person> * @var Collection<Person>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: Person::class)]
private Collection $persons; private Collection $persons;
#[ORM\Embedded(class: PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')] /**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
*/
private PrivateCommentEmbeddable $privateComment; private PrivateCommentEmbeddable $privateComment;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
*
* @Groups({"docgen:read"})
*
* @var Collection<ActivityReason> * @var Collection<ActivityReason>
*/ */
#[Groups(['docgen:read'])]
#[ORM\ManyToMany(targetEntity: ActivityReason::class)]
private Collection $reasons; private Collection $reasons;
#[Groups(['docgen:read'])] /**
#[ORM\ManyToOne(targetEntity: Scope::class)] * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
*
* @Groups({"docgen:read"})
*/
private ?Scope $scope = null; private ?Scope $scope = null;
#[Groups(['docgen:read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, options: ['default' => ''])] * @ORM\Column(type="string", options={"default": ""})
*
* @Groups({"docgen:read"})
*/
private string $sentReceived = ''; private string $sentReceived = '';
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
*
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<SocialAction> * @var Collection<SocialAction>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: SocialAction::class)]
#[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialaction')]
private Collection $socialActions; private Collection $socialActions;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
*
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<SocialIssue> * @var Collection<SocialIssue>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: SocialIssue::class)]
#[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialissue')]
private Collection $socialIssues; private Collection $socialIssues;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<ThirdParty> * @var Collection<ThirdParty>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
private Collection $thirdParties; private Collection $thirdParties;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)] /**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTime $travelTime = null; private ?\DateTime $travelTime = null;
#[Groups(['docgen:read'])] /**
#[ORM\ManyToOne(targetEntity: User::class)] * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*
* @Groups({"docgen:read"})
*/
private ?User $user = null; private ?User $user = null;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<User> * @var Collection<User>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: User::class)]
private Collection $users; private Collection $users;
public function __construct() public function __construct()
@@ -262,7 +338,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this; return $this;
} }
#[\Override]
public function getAccompanyingPeriod(): ?AccompanyingPeriod public function getAccompanyingPeriod(): ?AccompanyingPeriod
{ {
return $this->accompanyingPeriod; return $this->accompanyingPeriod;
@@ -282,7 +357,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
* get the center * get the center
* center is extracted from person. * center is extracted from person.
*/ */
#[\Override]
public function getCenters(): iterable public function getCenters(): iterable
{ {
if ($this->person instanceof Person) { if ($this->person instanceof Person) {
@@ -311,7 +385,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->documents; return $this->documents;
} }
#[Groups(['docgen:read'])] /**
* @Groups({"docgen:read"})
*/
public function getDurationMinute(): int public function getDurationMinute(): int
{ {
if (null === $this->durationTime) { if (null === $this->durationTime) {
@@ -401,7 +477,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->scope; return $this->scope;
} }
#[\Override]
public function getScopes(): iterable public function getScopes(): iterable
{ {
if (null !== $this->getAccompanyingPeriod()) { if (null !== $this->getAccompanyingPeriod()) {
@@ -425,7 +500,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->socialActions; return $this->socialActions;
} }
#[\Override]
public function getSocialIssues(): Collection public function getSocialIssues(): Collection
{ {
return $this->socialIssues; return $this->socialIssues;
@@ -441,7 +515,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->travelTime; return $this->travelTime;
} }
#[Groups(['docgen:read'])] /**
* @Groups({"docgen:read"})
*/
public function getTravelTimeMinute(): int public function getTravelTimeMinute(): int
{ {
if (null === $this->travelTime) { if (null === $this->travelTime) {
@@ -496,7 +572,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this; return $this;
} }
#[\Override]
public function removeSocialIssue(SocialIssue $socialIssue): self public function removeSocialIssue(SocialIssue $socialIssue): self
{ {
$this->socialIssues->removeElement($socialIssue); $this->socialIssues->removeElement($socialIssue);

View File

@@ -16,24 +16,38 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/** /**
* Class ActivityPresence. * Class ActivityPresence.
*
* @ORM\Entity
*
* @ORM\Table(name="activitytpresence")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activitytpresence')]
class ActivityPresence class ActivityPresence
{ {
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] /**
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
#[Serializer\Groups(['docgen:read'])] /**
#[ORM\Id] * @ORM\Id
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] *
#[ORM\GeneratedValue(strategy: 'AUTO')] * @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Serializer\Groups({"docgen:read"})
*/
private ?int $id = null; private ?int $id = null;
#[Serializer\Groups(['docgen:read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] * @ORM\Column(type="json")
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])] *
* @Serializer\Groups({"docgen:read"})
*
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
private array $name = []; private array $name = [];
/** /**

View File

@@ -15,24 +15,39 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Class ActivityReason. * Class ActivityReason.
*
* @ORM\Entity
*
* @ORM\Table(name="activityreason")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activityreason')]
class ActivityReason class ActivityReason
{ {
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] /**
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
#[ORM\ManyToOne(targetEntity: ActivityReasonCategory::class, inversedBy: 'reasons')] /**
* @ORM\ManyToOne(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
* inversedBy="reasons")
*/
private ?ActivityReasonCategory $category = null; private ?ActivityReasonCategory $category = null;
#[ORM\Id] /**
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] * @ORM\Id
#[ORM\GeneratedValue(strategy: 'AUTO')] *
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null; private ?int $id = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] /**
* @ORM\Column(type="json")
*/
private array $name; private array $name;
/** /**
@@ -79,9 +94,11 @@ class ActivityReason
/** /**
* Set active. * Set active.
* *
* @param bool $active
*
* @return ActivityReason * @return ActivityReason
*/ */
public function setActive(bool $active) public function setActive($active)
{ {
$this->active = $active; $this->active = $active;
@@ -108,9 +125,11 @@ class ActivityReason
/** /**
* Set name. * Set name.
* *
* @param array $name
*
* @return ActivityReason * @return ActivityReason
*/ */
public function setName(array $name) public function setName($name)
{ {
$this->name = $name; $this->name = $name;

View File

@@ -17,32 +17,45 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Class ActivityReasonCategory. * Class ActivityReasonCategory.
*
* @ORM\Entity
*
* @ORM\Table(name="activityreasoncategory")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activityreasoncategory')]
class ActivityReasonCategory implements \Stringable class ActivityReasonCategory implements \Stringable
{ {
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] /**
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
#[ORM\Id] /**
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] * @ORM\Id
#[ORM\GeneratedValue(strategy: 'AUTO')] *
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null; private ?int $id = null;
/** /**
* @var string * @var string
*
* @ORM\Column(type="json")
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
private $name; private $name;
/** /**
* Array of ActivityReason. * Array of ActivityReason.
* *
* @var Collection<ActivityReason> * @var Collection<ActivityReason>
*
* @ORM\OneToMany(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReason",
* mappedBy="category")
*/ */
#[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')]
private Collection $reasons; private Collection $reasons;
/** /**
@@ -53,7 +66,6 @@ class ActivityReasonCategory implements \Stringable
$this->reasons = new ArrayCollection(); $this->reasons = new ArrayCollection();
} }
#[\Override]
public function __toString(): string public function __toString(): string
{ {
return 'ActivityReasonCategory('.$this->getName('x').')'; return 'ActivityReasonCategory('.$this->getName('x').')';

View File

@@ -19,175 +19,275 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/** /**
* Class ActivityType. * Class ActivityType.
*
* @ORM\Entity
*
* @ORM\Table(name="activitytype")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activitytype')]
class ActivityType class ActivityType
{ {
final public const int FIELD_INVISIBLE = 0; final public const FIELD_INVISIBLE = 0;
final public const int FIELD_OPTIONAL = 1; final public const FIELD_OPTIONAL = 1;
final public const int FIELD_REQUIRED = 2; final public const FIELD_REQUIRED = 2;
/** /**
* @deprecated not in use * @deprecated not in use
*
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
private string $accompanyingPeriodLabel = ''; private string $accompanyingPeriodLabel = '';
/** /**
* @deprecated not in use * @deprecated not in use
*
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE; private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE;
#[Groups(['read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] * @ORM\Column(type="boolean")
*
* @Groups({"read"})
*/
private bool $active = true; private bool $active = true;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $attendeeLabel = ''; private string $attendeeLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $attendeeVisible = self::FIELD_OPTIONAL; private int $attendeeVisible = self::FIELD_OPTIONAL;
#[ORM\ManyToOne(targetEntity: ActivityTypeCategory::class)] /**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityTypeCategory")
*/
private ?ActivityTypeCategory $category = null; private ?ActivityTypeCategory $category = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $commentLabel = ''; private string $commentLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $commentVisible = self::FIELD_OPTIONAL; private int $commentVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $dateLabel = ''; private string $dateLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
*/
private int $dateVisible = self::FIELD_REQUIRED; private int $dateVisible = self::FIELD_REQUIRED;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $documentsLabel = ''; private string $documentsLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $documentsVisible = self::FIELD_OPTIONAL; private int $documentsVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $durationTimeLabel = ''; private string $durationTimeLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $durationTimeVisible = self::FIELD_OPTIONAL; private int $durationTimeVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $emergencyLabel = ''; private string $emergencyLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $emergencyVisible = self::FIELD_INVISIBLE; private int $emergencyVisible = self::FIELD_INVISIBLE;
#[Groups(['docgen:read'])] /**
#[ORM\Id] * @ORM\Id
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] *
#[ORM\GeneratedValue(strategy: 'AUTO')] * @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"docgen:read"})
*/
private ?int $id = null; private ?int $id = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $locationLabel = ''; private string $locationLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $locationVisible = self::FIELD_INVISIBLE; private int $locationVisible = self::FIELD_INVISIBLE;
#[Groups(['read', 'docgen:read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] * @ORM\Column(type="json")
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])] *
* @Groups({"read", "docgen:read"})
*
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
private array $name = []; private array $name = [];
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])] /**
* @ORM\Column(type="float", options={"default": "0.0"})
*/
private float $ordering = 0.0; private float $ordering = 0.0;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $personLabel = ''; private string $personLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $personsLabel = ''; private string $personsLabel = '';
#[Groups(['read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] * @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*
* @Groups({"read"})
*/
private int $personsVisible = self::FIELD_OPTIONAL; private int $personsVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
*/
private int $personVisible = self::FIELD_REQUIRED; private int $personVisible = self::FIELD_REQUIRED;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $privateCommentLabel = ''; private string $privateCommentLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $privateCommentVisible = self::FIELD_OPTIONAL; private int $privateCommentVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $reasonsLabel = ''; private string $reasonsLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $reasonsVisible = self::FIELD_OPTIONAL; private int $reasonsVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $sentReceivedLabel = ''; private string $sentReceivedLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $sentReceivedVisible = self::FIELD_OPTIONAL; private int $sentReceivedVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $socialActionsLabel = ''; private string $socialActionsLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $socialActionsVisible = self::FIELD_INVISIBLE; private int $socialActionsVisible = self::FIELD_INVISIBLE;
/** /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*
* @deprecated not in use * @deprecated not in use
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
private string $socialDataLabel = ''; private string $socialDataLabel = '';
/** /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*
* @deprecated not in use * @deprecated not in use
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
private int $socialDataVisible = self::FIELD_INVISIBLE; private int $socialDataVisible = self::FIELD_INVISIBLE;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $socialIssuesLabel = ''; private string $socialIssuesLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $socialIssuesVisible = self::FIELD_INVISIBLE; private int $socialIssuesVisible = self::FIELD_INVISIBLE;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $thirdPartiesLabel = ''; private string $thirdPartiesLabel = '';
#[Groups(['read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] * @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*
* @Groups({"read"})
*/
private int $thirdPartiesVisible = self::FIELD_INVISIBLE; private int $thirdPartiesVisible = self::FIELD_INVISIBLE;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $travelTimeLabel = ''; private string $travelTimeLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $travelTimeVisible = self::FIELD_OPTIONAL; private int $travelTimeVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $userLabel = ''; private string $userLabel = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $usersLabel = ''; private string $usersLabel = '';
#[Groups(['read'])] /**
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] * @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*
* @Groups({"read"})
*/
private int $usersVisible = self::FIELD_OPTIONAL; private int $usersVisible = self::FIELD_OPTIONAL;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])] /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
*/
private int $userVisible = self::FIELD_REQUIRED; private int $userVisible = self::FIELD_REQUIRED;
#[Assert\Callback] /**
* @Assert\Callback
*/
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload) public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload)
{ {
if ($this->socialIssuesVisible !== $this->socialActionsVisible) { if ($this->socialIssuesVisible !== $this->socialActionsVisible) {

View File

@@ -13,23 +13,37 @@ namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity] /**
#[ORM\HasLifecycleCallbacks] * @ORM\Entity
#[ORM\Table(name: 'activitytypecategory')] *
* @ORM\Table(name="activitytypecategory")
*
* @ORM\HasLifecycleCallbacks
*/
class ActivityTypeCategory class ActivityTypeCategory
{ {
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] /**
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
#[ORM\Id] /**
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] * @ORM\Id
#[ORM\GeneratedValue(strategy: 'AUTO')] *
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null; private ?int $id = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] /**
* @ORM\Column(type="json")
*/
private array $name = []; private array $name = [];
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])] /**
* @ORM\Column(type="float", options={"default": "0.0"})
*/
private float $ordering = 0.0; private float $ordering = 0.0;
/** /**

View File

@@ -19,7 +19,9 @@ use Doctrine\ORM\EntityManagerInterface;
class ActivityEntityListener class ActivityEntityListener
{ {
public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) {} public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository)
{
}
public function persistActionToCourse(Activity $activity) public function persistActionToCourse(Activity $activity)
{ {

View File

@@ -19,13 +19,11 @@ use Symfony\Component\Form\FormBuilderInterface;
class ByActivityNumberAggregator implements AggregatorInterface class ByActivityNumberAggregator implements AggregatorInterface
{ {
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data): void public function alterQuery(QueryBuilder $qb, $data): void
{ {
$qb $qb
@@ -33,25 +31,21 @@ class ByActivityNumberAggregator implements AggregatorInterface
->addGroupBy('activity_by_number_aggregator'); ->addGroupBy('activity_by_number_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACP_TYPE; return Declarations::ACP_TYPE;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder): void public function buildForm(FormBuilderInterface $builder): void
{ {
// No form needed // No form needed
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return static function ($value) { return static function ($value) {
@@ -67,13 +61,11 @@ class ByActivityNumberAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['activity_by_number_aggregator']; return ['activity_by_number_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group acp by activity number'; return 'Group acp by activity number';

View File

@@ -25,15 +25,15 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ByActivityTypeAggregator implements AggregatorInterface final readonly class ByActivityTypeAggregator implements AggregatorInterface
{ {
private const string PREFIX = 'acp_by_activity_type_agg'; private const PREFIX = 'acp_by_activity_type_agg';
public function __construct( public function __construct(
private RollingDateConverterInterface $rollingDateConverter, private RollingDateConverterInterface $rollingDateConverter,
private ActivityTypeRepositoryInterface $activityTypeRepository, private ActivityTypeRepositoryInterface $activityTypeRepository,
private TranslatableStringHelperInterface $translatableStringHelper, private TranslatableStringHelperInterface $translatableStringHelper,
) {} ) {
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder $builder
@@ -47,7 +47,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return [
@@ -56,7 +55,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
]; ];
} }
#[\Override]
public function getLabels($key, array $values, mixed $data) public function getLabels($key, array $values, mixed $data)
{ {
return function (int|string|null $value): string { return function (int|string|null $value): string {
@@ -72,25 +70,21 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return [self::PREFIX.'_actype_id']; return [self::PREFIX.'_actype_id'];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.aggregator.acp.by_activity_type.title'; return 'export.aggregator.acp.by_activity_type.title';
} }
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -122,7 +116,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
->addGroupBy("{$p}_actype_id"); ->addGroupBy("{$p}_actype_id");
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACP_TYPE; return Declarations::ACP_TYPE;

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class BySocialActionAggregator implements AggregatorInterface class BySocialActionAggregator implements AggregatorInterface
{ {
public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {} public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) { if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
@@ -39,25 +39,21 @@ class BySocialActionAggregator implements AggregatorInterface
$qb->addGroupBy('socialaction_aggregator'); $qb->addGroupBy('socialaction_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY_ACP; return Declarations::ACTIVITY_ACP;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form // no form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value) { return function ($value) {
@@ -75,13 +71,11 @@ class BySocialActionAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['socialaction_aggregator']; return ['socialaction_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group activity by linked socialaction'; return 'Group activity by linked socialaction';

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class BySocialIssueAggregator implements AggregatorInterface class BySocialIssueAggregator implements AggregatorInterface
{ {
public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {} public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) { if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
@@ -39,25 +39,21 @@ class BySocialIssueAggregator implements AggregatorInterface
$qb->addGroupBy('socialissue_aggregator'); $qb->addGroupBy('socialissue_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY_ACP; return Declarations::ACTIVITY_ACP;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form // no form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -75,13 +71,11 @@ class BySocialIssueAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['socialissue_aggregator']; return ['socialissue_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group activity by linked socialissue'; return 'Group activity by linked socialissue';

View File

@@ -18,15 +18,13 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ActivityLocationAggregator implements AggregatorInterface final readonly class ActivityLocationAggregator implements AggregatorInterface
{ {
public const string KEY = 'activity_location_aggregator'; public const KEY = 'activity_location_aggregator';
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actloc', $qb->getAllAliases(), true)) { if (!\in_array('actloc', $qb->getAllAliases(), true)) {
@@ -36,25 +34,21 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
$qb->addGroupBy(self::KEY); $qb->addGroupBy(self::KEY);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form required for this aggregator // no form required for this aggregator
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data): \Closure public function getLabels($key, array $values, $data): \Closure
{ {
return function ($value): string { return function ($value): string {
@@ -70,13 +64,11 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return [self::KEY]; return [self::KEY];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.aggregator.activity.by_location.Title'; return 'export.aggregator.activity.by_location.Title';

View File

@@ -20,18 +20,19 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ActivityPresenceAggregator implements AggregatorInterface final readonly class ActivityPresenceAggregator implements AggregatorInterface
{ {
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {} public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper)
{
}
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, mixed $data) public function getLabels($key, array $values, mixed $data)
{ {
return function (int|string|null $value): string { return function (int|string|null $value): string {
@@ -47,32 +48,27 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return ['activity_presence_aggregator_attendee']; return ['activity_presence_aggregator_attendee'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.aggregator.activity.by_activity_presence.Group activity by presence'; return 'export.aggregator.activity.by_activity_presence.Group activity by presence';
} }
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data): void public function alterQuery(QueryBuilder $qb, $data): void
{ {
$qb->addSelect('IDENTITY(activity.attendee) AS activity_presence_aggregator_attendee'); $qb->addSelect('IDENTITY(activity.attendee) AS activity_presence_aggregator_attendee');
$qb->addGroupBy('activity_presence_aggregator_attendee'); $qb->addGroupBy('activity_presence_aggregator_attendee');
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;

View File

@@ -29,15 +29,14 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository, protected ActivityReasonCategoryRepository $activityReasonCategoryRepository,
protected ActivityReasonRepository $activityReasonRepository, protected ActivityReasonRepository $activityReasonRepository,
protected TranslatableStringHelper $translatableStringHelper protected TranslatableStringHelper $translatableStringHelper
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
// add select element // add select element
@@ -69,13 +68,11 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
$qb->addGroupBy($alias); $qb->addGroupBy($alias);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add( $builder->add(
@@ -93,7 +90,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
); );
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return [
@@ -101,7 +97,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
]; ];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value) use ($data) { return function ($value) use ($data) {
@@ -131,7 +126,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
// add select element // add select element
@@ -146,13 +140,11 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
throw new \RuntimeException('The data provided are not recognised.'); throw new \RuntimeException('The data provided are not recognised.');
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Aggregate by activity reason'; return 'Aggregate by activity reason';
} }
#[\Override]
public function validateForm($data, ExecutionContextInterface $context) public function validateForm($data, ExecutionContextInterface $context)
{ {
if (null === $data['level']) { if (null === $data['level']) {

View File

@@ -20,17 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityTypeAggregator implements AggregatorInterface class ActivityTypeAggregator implements AggregatorInterface
{ {
final public const string KEY = 'activity_type_aggregator'; final public const KEY = 'activity_type_aggregator';
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {} public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('acttype', $qb->getAllAliases(), true)) { if (!\in_array('acttype', $qb->getAllAliases(), true)) {
@@ -41,25 +41,21 @@ class ActivityTypeAggregator implements AggregatorInterface
$qb->addGroupBy(self::KEY); $qb->addGroupBy(self::KEY);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form required for this aggregator // no form required for this aggregator
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data): \Closure public function getLabels($key, array $values, $data): \Closure
{ {
return function (int|string|null $value): string { return function (int|string|null $value): string {
@@ -75,13 +71,11 @@ class ActivityTypeAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return [self::KEY]; return [self::KEY];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Aggregate by activity type'; return 'Aggregate by activity type';

View File

@@ -20,17 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUserAggregator implements AggregatorInterface class ActivityUserAggregator implements AggregatorInterface
{ {
final public const string KEY = 'activity_user_id'; final public const KEY = 'activity_user_id';
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {} public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
// add select element // add select element
@@ -40,25 +40,21 @@ class ActivityUserAggregator implements AggregatorInterface
$qb->addGroupBy(self::KEY); $qb->addGroupBy(self::KEY);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// nothing to add // nothing to add
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, $values, $data): \Closure public function getLabels($key, $values, $data): \Closure
{ {
return function ($value) { return function ($value) {
@@ -76,13 +72,11 @@ class ActivityUserAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return [self::KEY]; return [self::KEY];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Aggregate by activity user'; return 'Aggregate by activity user';

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUsersAggregator implements AggregatorInterface class ActivityUsersAggregator implements AggregatorInterface
{ {
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actusers', $qb->getAllAliases(), true)) { if (!\in_array('actusers', $qb->getAllAliases(), true)) {
@@ -40,25 +40,21 @@ class ActivityUsersAggregator implements AggregatorInterface
->addGroupBy('activity_users_aggregator'); ->addGroupBy('activity_users_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// nothing to add on the form // nothing to add on the form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value) { return function ($value) {
@@ -76,13 +72,11 @@ class ActivityUsersAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return ['activity_users_aggregator']; return ['activity_users_aggregator'];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Aggregate by activity users'; return 'Aggregate by activity users';

View File

@@ -22,20 +22,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUsersJobAggregator implements AggregatorInterface class ActivityUsersJobAggregator implements AggregatorInterface
{ {
private const string PREFIX = 'act_agg_user_job'; private const PREFIX = 'act_agg_user_job';
public function __construct( public function __construct(
private readonly UserJobRepositoryInterface $userJobRepository, private readonly UserJobRepositoryInterface $userJobRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper private readonly TranslatableStringHelperInterface $translatableStringHelper
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -62,22 +61,20 @@ class ActivityUsersJobAggregator implements AggregatorInterface
->addGroupBy("{$p}_select"); ->addGroupBy("{$p}_select");
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -97,13 +94,11 @@ class ActivityUsersJobAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return [self::PREFIX.'_select']; return [self::PREFIX.'_select'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.aggregator.activity.by_user_job.Aggregate by users job'; return 'export.aggregator.activity.by_user_job.Aggregate by users job';

View File

@@ -22,20 +22,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUsersScopeAggregator implements AggregatorInterface class ActivityUsersScopeAggregator implements AggregatorInterface
{ {
private const string PREFIX = 'act_agg_user_scope'; private const PREFIX = 'act_agg_user_scope';
public function __construct( public function __construct(
private readonly ScopeRepositoryInterface $scopeRepository, private readonly ScopeRepositoryInterface $scopeRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper private readonly TranslatableStringHelperInterface $translatableStringHelper
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -62,22 +61,20 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
->addGroupBy("{$p}_select"); ->addGroupBy("{$p}_select");
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -97,13 +94,11 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return [self::PREFIX.'_select']; return [self::PREFIX.'_select'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.aggregator.activity.by_user_scope.Aggregate by users scope'; return 'export.aggregator.activity.by_user_scope.Aggregate by users scope';

View File

@@ -20,40 +20,36 @@ use Symfony\Component\Form\FormBuilderInterface;
class ByCreatorAggregator implements AggregatorInterface class ByCreatorAggregator implements AggregatorInterface
{ {
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator'); $qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
$qb->addGroupBy('creator_aggregator'); $qb->addGroupBy('creator_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form // no form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -71,13 +67,11 @@ class ByCreatorAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['creator_aggregator']; return ['creator_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group activity by creator'; return 'Group activity by creator';

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class ByThirdpartyAggregator implements AggregatorInterface class ByThirdpartyAggregator implements AggregatorInterface
{ {
public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {} public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('acttparty', $qb->getAllAliases(), true)) { if (!\in_array('acttparty', $qb->getAllAliases(), true)) {
@@ -39,25 +39,21 @@ class ByThirdpartyAggregator implements AggregatorInterface
$qb->addGroupBy('thirdparty_aggregator'); $qb->addGroupBy('thirdparty_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form // no form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -75,13 +71,11 @@ class ByThirdpartyAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['thirdparty_aggregator']; return ['thirdparty_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group activity by linked thirdparties'; return 'Group activity by linked thirdparties';

View File

@@ -22,20 +22,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class CreatorJobAggregator implements AggregatorInterface class CreatorJobAggregator implements AggregatorInterface
{ {
private const string PREFIX = 'acp_agg_creator_job'; private const PREFIX = 'acp_agg_creator_job';
public function __construct( public function __construct(
private readonly UserJobRepositoryInterface $userJobRepository, private readonly UserJobRepositoryInterface $userJobRepository,
private readonly TranslatableStringHelper $translatableStringHelper private readonly TranslatableStringHelper $translatableStringHelper
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -62,22 +61,20 @@ class CreatorJobAggregator implements AggregatorInterface
->addGroupBy("{$p}_select"); ->addGroupBy("{$p}_select");
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -95,13 +92,11 @@ class CreatorJobAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return [self::PREFIX.'_select']; return [self::PREFIX.'_select'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.aggregator.activity.by_creator_job.Group activity by creator job'; return 'export.aggregator.activity.by_creator_job.Group activity by creator job';

View File

@@ -22,20 +22,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class CreatorScopeAggregator implements AggregatorInterface class CreatorScopeAggregator implements AggregatorInterface
{ {
private const string PREFIX = 'acp_agg_creator_scope'; private const PREFIX = 'acp_agg_creator_scope';
public function __construct( public function __construct(
private readonly ScopeRepository $scopeRepository, private readonly ScopeRepository $scopeRepository,
private readonly TranslatableStringHelper $translatableStringHelper private readonly TranslatableStringHelper $translatableStringHelper
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -62,22 +61,20 @@ class CreatorScopeAggregator implements AggregatorInterface
->addGroupBy("{$p}_select"); ->addGroupBy("{$p}_select");
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -97,13 +94,11 @@ class CreatorScopeAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return [self::PREFIX.'_select']; return [self::PREFIX.'_select'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.aggregator.activity.by_creator_scope.Group activity by creator scope'; return 'export.aggregator.activity.by_creator_scope.Group activity by creator scope';

View File

@@ -19,21 +19,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class DateAggregator implements AggregatorInterface class DateAggregator implements AggregatorInterface
{ {
private const array CHOICES = [ private const CHOICES = [
'by month' => 'month', 'by month' => 'month',
'by week' => 'week', 'by week' => 'week',
'by year' => 'year', 'by year' => 'year',
]; ];
private const string DEFAULT_CHOICE = 'year'; private const DEFAULT_CHOICE = 'year';
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$order = null; $order = null;
@@ -64,13 +62,11 @@ class DateAggregator implements AggregatorInterface
$qb->addOrderBy('date_aggregator', $order); $qb->addOrderBy('date_aggregator', $order);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('frequency', ChoiceType::class, [ $builder->add('frequency', ChoiceType::class, [
@@ -80,13 +76,11 @@ class DateAggregator implements AggregatorInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return ['frequency' => self::DEFAULT_CHOICE]; return ['frequency' => self::DEFAULT_CHOICE];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return static function ($value) use ($data): string { return static function ($value) use ($data): string {
@@ -104,13 +98,11 @@ class DateAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['date_aggregator']; return ['date_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group activity by date'; return 'Group activity by date';

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class LocationTypeAggregator implements AggregatorInterface class LocationTypeAggregator implements AggregatorInterface
{ {
public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actloc', $qb->getAllAliases(), true)) { if (!\in_array('actloc', $qb->getAllAliases(), true)) {
@@ -39,25 +39,21 @@ class LocationTypeAggregator implements AggregatorInterface
$qb->addGroupBy('locationtype_aggregator'); $qb->addGroupBy('locationtype_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form // no form
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return function ($value): string {
@@ -79,13 +75,11 @@ class LocationTypeAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['locationtype_aggregator']; return ['locationtype_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Group activity by locationtype'; return 'Group activity by locationtype';

View File

@@ -19,45 +19,40 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class PersonAggregator implements AggregatorInterface final readonly class PersonAggregator implements AggregatorInterface
{ {
public function __construct(private LabelPersonHelper $labelPersonHelper) {} public function __construct(private LabelPersonHelper $labelPersonHelper)
{
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// nothing to add here // nothing to add here
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, mixed $data) public function getLabels($key, array $values, mixed $data)
{ {
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person'); return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return ['activity_by_person_agg']; return ['activity_by_person_agg'];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.aggregator.person.by_person.title'; return 'export.aggregator.person.by_person.title';
} }
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$qb $qb
@@ -65,7 +60,6 @@ final readonly class PersonAggregator implements AggregatorInterface
->addGroupBy('activity_by_person_agg'); ->addGroupBy('activity_by_person_agg');
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACTIVITY_PERSON; return Declarations::ACTIVITY_PERSON;

View File

@@ -23,23 +23,22 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
final readonly class PersonsAggregator implements AggregatorInterface final readonly class PersonsAggregator implements AggregatorInterface
{ {
private const string PREFIX = 'act_persons_agg'; private const PREFIX = 'act_persons_agg';
public function __construct(private LabelPersonHelper $labelPersonHelper) {} public function __construct(private LabelPersonHelper $labelPersonHelper)
{
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// nothing to add here // nothing to add here
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, mixed $data) public function getLabels($key, array $values, mixed $data)
{ {
if ($key !== self::PREFIX.'_pid') { if ($key !== self::PREFIX.'_pid') {
@@ -49,25 +48,21 @@ final readonly class PersonsAggregator implements AggregatorInterface
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.activity.by_persons.Persons'); return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.activity.by_persons.Persons');
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return [self::PREFIX.'_pid']; return [self::PREFIX.'_pid'];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.aggregator.activity.by_persons.Group activity by persons'; return 'export.aggregator.activity.by_persons.Group activity by persons';
} }
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -78,7 +73,6 @@ final readonly class PersonsAggregator implements AggregatorInterface
->addGroupBy("{$p}_pid"); ->addGroupBy("{$p}_pid");
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;

View File

@@ -19,40 +19,36 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class SentReceivedAggregator implements AggregatorInterface class SentReceivedAggregator implements AggregatorInterface
{ {
public function __construct(private readonly TranslatorInterface $translator) {} public function __construct(private readonly TranslatorInterface $translator)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data): void public function alterQuery(QueryBuilder $qb, $data): void
{ {
$qb->addSelect('activity.sentReceived AS activity_sentreceived_aggregator') $qb->addSelect('activity.sentReceived AS activity_sentreceived_aggregator')
->addGroupBy('activity_sentreceived_aggregator'); ->addGroupBy('activity_sentreceived_aggregator');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder): void public function buildForm(FormBuilderInterface $builder): void
{ {
// No form needed // No form needed
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getLabels($key, array $values, $data): callable public function getLabels($key, array $values, $data): callable
{ {
return function (?string $value): string { return function (?string $value): string {
@@ -77,13 +73,11 @@ class SentReceivedAggregator implements AggregatorInterface
}; };
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['activity_sentreceived_aggregator']; return ['activity_sentreceived_aggregator'];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.aggregator.activity.by_sent_received.Group activity by sentreceived'; return 'export.aggregator.activity.by_sent_received.Group activity by sentreceived';

View File

@@ -36,34 +36,30 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'Average activities linked to an accompanying period duration by various parameters.'; return 'Average activities linked to an accompanying period duration by various parameters.';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_avg_activity_duration' !== $key) { if ('export_avg_activity_duration' !== $key) {
@@ -73,31 +69,26 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value; return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_avg_activity_duration']; return ['export_avg_activity_duration'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Average activity linked to an accompanying period duration'; return 'Average activity linked to an accompanying period duration';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -127,13 +118,11 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -41,37 +41,31 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// TODO: Implement buildForm() method. // TODO: Implement buildForm() method.
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'Average activities linked to an accompanying period visit duration by various parameters.'; return 'Average activities linked to an accompanying period visit duration by various parameters.';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_avg_activity_visit_duration' !== $key) { if ('export_avg_activity_visit_duration' !== $key) {
@@ -81,31 +75,26 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value; return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_avg_activity_visit_duration']; return ['export_avg_activity_visit_duration'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Average activity linked to an accompanying period visit duration'; return 'Average activity linked to an accompanying period visit duration';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -135,13 +124,11 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -41,34 +41,30 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'Count activities linked to an accompanying period by various parameters.'; return 'Count activities linked to an accompanying period by various parameters.';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_count_activity' !== $key) { if ('export_count_activity' !== $key) {
@@ -78,31 +74,26 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Number of activities linked to an accompanying period' : $value; return static fn ($value) => '_header' === $value ? 'Number of activities linked to an accompanying period' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_count_activity']; return ['export_count_activity'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Count activities linked to an accompanying period'; return 'Count activities linked to an accompanying period';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -131,13 +122,11 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -42,34 +42,30 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'export.export.count_household_on_activity.description'; return 'export.export.count_household_on_activity.description';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_count_activity' !== $key) { if ('export_count_activity' !== $key) {
@@ -79,31 +75,26 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value; return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_count_activity']; return ['export_count_activity'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.export.count_household_on_activity.title'; return 'export.export.count_household_on_activity.title';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -140,13 +131,11 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -41,34 +41,30 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'export.export.count_person_on_activity.description'; return 'export.export.count_person_on_activity.description';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_count_activity' !== $key) { if ('export_count_activity' !== $key) {
@@ -78,31 +74,26 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'export.export.count_person_on_activity.header' : $value; return static fn ($value) => '_header' === $value ? 'export.export.count_person_on_activity.header' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_count_activity']; return ['export_count_activity'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.export.count_person_on_activity.title'; return 'export.export.count_person_on_activity.title';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -132,13 +123,11 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -31,39 +31,34 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
private EntityManagerInterface $entityManager, private EntityManagerInterface $entityManager,
private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
) {} ) {
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$this->helper->buildForm($builder); $this->helper->buildForm($builder);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
return $this->helper->getAllowedFormattersTypes(); return $this->helper->getAllowedFormattersTypes();
} }
#[\Override]
public function getDescription() public function getDescription()
{ {
return ListActivityHelper::MSG_KEY.'List activities linked to an accompanying course'; return ListActivityHelper::MSG_KEY.'List activities linked to an accompanying course';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return match ($key) { return match ($key) {
@@ -79,7 +74,6 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
}; };
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return return
@@ -92,25 +86,21 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
); );
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $this->helper->getResult($query, $data); return $this->helper->getResult($query, $data);
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return ListActivityHelper::MSG_KEY.'List activity linked to a course'; return ListActivityHelper::MSG_KEY.'List activity linked to a course';
} }
#[\Override]
public function getType() public function getType()
{ {
return $this->helper->getType(); return $this->helper->getType();
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -146,13 +136,11 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::LISTS; return ActivityStatsVoter::LISTS;
} }
#[\Override]
public function supportsModifiers() public function supportsModifiers()
{ {
return array_merge( return array_merge(

View File

@@ -40,37 +40,31 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// TODO: Implement buildForm() method. // TODO: Implement buildForm() method.
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'Sum activities linked to an accompanying period duration by various parameters.'; return 'Sum activities linked to an accompanying period duration by various parameters.';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_sum_activity_duration' !== $key) { if ('export_sum_activity_duration' !== $key) {
@@ -80,31 +74,26 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value; return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_sum_activity_duration']; return ['export_sum_activity_duration'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Sum activity linked to an accompanying period duration'; return 'Sum activity linked to an accompanying period duration';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -134,13 +123,11 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -40,37 +40,31 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// TODO: Implement buildForm() method. // TODO: Implement buildForm() method.
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes(): array public function getAllowedFormattersTypes(): array
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription(): string public function getDescription(): string
{ {
return 'Sum activities linked to an accompanying period visit duration by various parameters.'; return 'Sum activities linked to an accompanying period visit duration by various parameters.';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to an accompanying period'; return 'Exports of activities linked to an accompanying period';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_sum_activity_visit_duration' !== $key) { if ('export_sum_activity_visit_duration' !== $key) {
@@ -80,31 +74,26 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value; return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
} }
#[\Override]
public function getQueryKeys($data): array public function getQueryKeys($data): array
{ {
return ['export_sum_activity_visit_duration']; return ['export_sum_activity_visit_duration'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Sum activity linked to an accompanying period visit duration'; return 'Sum activity linked to an accompanying period visit duration';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -134,13 +123,11 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers(): array public function supportsModifiers(): array
{ {
return [ return [

View File

@@ -33,34 +33,30 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription() public function getDescription()
{ {
return 'Count activities linked to a person by various parameters.'; return 'Count activities linked to a person by various parameters.';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to a person'; return 'Exports of activities linked to a person';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_count_activity' !== $key) { if ('export_count_activity' !== $key) {
@@ -70,31 +66,26 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Number of activities linked to a person' : $value; return static fn ($value) => '_header' === $value ? 'Number of activities linked to a person' : $value;
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return ['export_count_activity']; return ['export_count_activity'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Count activities linked to a person'; return 'Count activities linked to a person';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -124,13 +115,11 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers() public function supportsModifiers()
{ {
return [ return [

View File

@@ -34,34 +34,30 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription() public function getDescription()
{ {
return 'export.export.count_household_on_activity_person.description'; return 'export.export.count_household_on_activity_person.description';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to a person'; return 'Exports of activities linked to a person';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_count_activity' !== $key) { if ('export_count_activity' !== $key) {
@@ -71,31 +67,26 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value; return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value;
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return ['export_count_activity']; return ['export_count_activity'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.export.count_household_on_activity_person.title'; return 'export.export.count_household_on_activity_person.title';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -132,13 +123,11 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers() public function supportsModifiers()
{ {
return [ return [

View File

@@ -57,7 +57,6 @@ class ListActivity implements ListInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('fields', ChoiceType::class, [ $builder->add('fields', ChoiceType::class, [
@@ -77,31 +76,26 @@ class ListActivity implements ListInterface, GroupedExportInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
return [FormatterInterface::TYPE_LIST]; return [FormatterInterface::TYPE_LIST];
} }
#[\Override]
public function getDescription() public function getDescription()
{ {
return 'List activities linked to a person description'; return 'List activities linked to a person description';
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to a person'; return 'Exports of activities linked to a person';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
switch ($key) { switch ($key) {
@@ -171,31 +165,26 @@ class ListActivity implements ListInterface, GroupedExportInterface
} }
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return $data['fields']; return $data['fields'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'List activity linked to a person'; return 'List activity linked to a person';
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map(static fn ($el) => $el['center'], $acl); $centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -290,13 +279,11 @@ class ListActivity implements ListInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::LISTS; return ActivityStatsVoter::LISTS;
} }
#[\Override]
public function supportsModifiers() public function supportsModifiers()
{ {
return [ return [

View File

@@ -30,7 +30,7 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
class StatActivityDuration implements ExportInterface, GroupedExportInterface class StatActivityDuration implements ExportInterface, GroupedExportInterface
{ {
final public const string SUM = 'sum'; final public const SUM = 'sum';
private readonly bool $filterStatsByCenters; private readonly bool $filterStatsByCenters;
/** /**
@@ -47,22 +47,20 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
} }
#[\Override] public function buildForm(FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder) {} {
}
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
return [FormatterInterface::TYPE_TABULAR]; return [FormatterInterface::TYPE_TABULAR];
} }
#[\Override]
public function getDescription() public function getDescription()
{ {
if (self::SUM === $this->action) { if (self::SUM === $this->action) {
@@ -72,13 +70,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
throw new \LogicException('this action is not supported: '.$this->action); throw new \LogicException('this action is not supported: '.$this->action);
} }
#[\Override]
public function getGroup(): string public function getGroup(): string
{ {
return 'Exports of activities linked to a person'; return 'Exports of activities linked to a person';
} }
#[\Override]
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
if ('export_stat_activity' !== $key) { if ('export_stat_activity' !== $key) {
@@ -90,19 +86,16 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
return static fn (string $value) => '_header' === $value ? $header : $value; return static fn (string $value) => '_header' === $value ? $header : $value;
} }
#[\Override]
public function getQueryKeys($data) public function getQueryKeys($data)
{ {
return ['export_stat_activity']; return ['export_stat_activity'];
} }
#[\Override]
public function getResult($query, $data) public function getResult($query, $data)
{ {
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
if (self::SUM === $this->action) { if (self::SUM === $this->action) {
@@ -112,13 +105,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
throw new \LogicException('This action is not supported: '.$this->action); throw new \LogicException('This action is not supported: '.$this->action);
} }
#[\Override]
public function getType(): string public function getType(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
$centers = array_map( $centers = array_map(
@@ -156,13 +147,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
return $qb; return $qb;
} }
#[\Override]
public function requiredRole(): string public function requiredRole(): string
{ {
return ActivityStatsVoter::STATS; return ActivityStatsVoter::STATS;
} }
#[\Override]
public function supportsModifiers() public function supportsModifiers()
{ {
return [ return [

View File

@@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ListActivityHelper class ListActivityHelper
{ {
final public const string MSG_KEY = 'export.list.activity.'; final public const MSG_KEY = 'export.list.activity.';
public function __construct( public function __construct(
private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository, private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository,
@@ -40,7 +40,8 @@ class ListActivityHelper
private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper, private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper,
private readonly UserHelper $userHelper private readonly UserHelper $userHelper
) {} ) {
}
public function addSelect(QueryBuilder $qb): void public function addSelect(QueryBuilder $qb): void
{ {
@@ -74,7 +75,9 @@ class ListActivityHelper
->addGroupBy('location.id'); ->addGroupBy('location.id');
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {
@@ -152,7 +155,7 @@ class ListActivityHelper
return ''; return '';
} }
return $this->translator->trans((string) $value); return $this->translator->trans($value);
}, },
}; };
} }

View File

@@ -25,21 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ActivityTypeFilter implements FilterInterface final readonly class ActivityTypeFilter implements FilterInterface
{ {
private const string BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp'; private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
public function __construct( public function __construct(
private ActivityTypeRepositoryInterface $activityTypeRepository, private ActivityTypeRepositoryInterface $activityTypeRepository,
private TranslatableStringHelperInterface $translatableStringHelper, private TranslatableStringHelperInterface $translatableStringHelper,
private RollingDateConverterInterface $rollingDateConverter, private RollingDateConverterInterface $rollingDateConverter,
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$exists = self::BASE_EXISTS; $exists = self::BASE_EXISTS;
@@ -64,13 +63,11 @@ final readonly class ActivityTypeFilter implements FilterInterface
} }
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACP_TYPE; return Declarations::ACP_TYPE;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('accepted_activitytypes', EntityType::class, [ $builder->add('accepted_activitytypes', EntityType::class, [
@@ -96,7 +93,6 @@ final readonly class ActivityTypeFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return [
@@ -106,7 +102,6 @@ final readonly class ActivityTypeFilter implements FilterInterface
]; ];
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
$types = []; $types = [];
@@ -124,7 +119,6 @@ final readonly class ActivityTypeFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Filter accompanying course by activity type'; return 'Filter accompanying course by activity type';

View File

@@ -21,15 +21,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class BySocialActionFilter implements FilterInterface class BySocialActionFilter implements FilterInterface
{ {
public function __construct(private readonly SocialActionRender $actionRender) {} public function __construct(private readonly SocialActionRender $actionRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) { if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
@@ -45,13 +45,11 @@ class BySocialActionFilter implements FilterInterface
); );
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY_ACP; return Declarations::ACTIVITY_ACP;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('accepted_socialactions', PickSocialActionType::class, [ $builder->add('accepted_socialactions', PickSocialActionType::class, [
@@ -59,13 +57,11 @@ class BySocialActionFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
$actions = []; $actions = [];
@@ -81,7 +77,6 @@ class BySocialActionFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Filter activity by linked socialaction'; return 'Filter activity by linked socialaction';

View File

@@ -21,15 +21,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class BySocialIssueFilter implements FilterInterface class BySocialIssueFilter implements FilterInterface
{ {
public function __construct(private readonly SocialIssueRender $issueRender) {} public function __construct(private readonly SocialIssueRender $issueRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) { if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
@@ -45,13 +45,11 @@ class BySocialIssueFilter implements FilterInterface
); );
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY_ACP; return Declarations::ACTIVITY_ACP;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('accepted_socialissues', PickSocialIssueType::class, [ $builder->add('accepted_socialissues', PickSocialIssueType::class, [
@@ -59,13 +57,11 @@ class BySocialIssueFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
$issues = []; $issues = [];
@@ -81,7 +77,6 @@ class BySocialIssueFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Filter activity by linked socialissue'; return 'Filter activity by linked socialissue';

View File

@@ -22,13 +22,11 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
class HasNoActivityFilter implements FilterInterface class HasNoActivityFilter implements FilterInterface
{ {
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$qb $qb
@@ -40,31 +38,26 @@ class HasNoActivityFilter implements FilterInterface
'); ');
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACP_TYPE; return Declarations::ACP_TYPE;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
// no form needed // no form needed
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
return ['Filtered acp which has no activities', []]; return ['Filtered acp which has no activities', []];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Filter acp which has no activity'; return 'Filter acp which has no activity';

View File

@@ -23,15 +23,14 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
{ {
public function __construct( public function __construct(
private RollingDateConverterInterface $rollingDateConverter, private RollingDateConverterInterface $rollingDateConverter,
) {} ) {
}
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.filter.activity.course_having_activity_between_date.Title'; return 'export.filter.activity.course_having_activity_between_date.Title';
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder $builder
@@ -43,7 +42,6 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return [
@@ -52,7 +50,6 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
]; ];
} }
#[\Override]
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
return [ return [
@@ -64,13 +61,11 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
]; ];
} }
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$alias = 'act_period_having_act_betw_date_alias'; $alias = 'act_period_having_act_betw_date_alias';
@@ -79,7 +74,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
$qb->andWhere( $qb->andWhere(
$qb->expr()->exists( $qb->expr()->exists(
'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = activity.accompanyingPeriod" 'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = acp"
) )
); );
@@ -88,7 +83,6 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
->setParameter($to, $this->rollingDateConverter->convert($data['end_date'])); ->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return \Chill\PersonBundle\Export\Declarations::ACP_TYPE; return \Chill\PersonBundle\Export\Declarations::ACP_TYPE;

View File

@@ -23,15 +23,15 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ActivityDateFilter implements FilterInterface class ActivityDateFilter implements FilterInterface
{ {
public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {} public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$where = $qb->getDQLPart('where'); $where = $qb->getDQLPart('where');
@@ -58,13 +58,11 @@ class ActivityDateFilter implements FilterInterface
); );
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder $builder
@@ -76,13 +74,11 @@ class ActivityDateFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
} }
#[\Override]
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
return [ return [
@@ -94,7 +90,6 @@ class ActivityDateFilter implements FilterInterface
]; ];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Filtered by date activity'; return 'Filtered by date activity';

View File

@@ -26,15 +26,14 @@ final readonly class ActivityPresenceFilter implements FilterInterface
public function __construct( public function __construct(
private TranslatableStringHelperInterface $translatableStringHelper, private TranslatableStringHelperInterface $translatableStringHelper,
private TranslatorInterface $translator private TranslatorInterface $translator
) {} ) {
}
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'export.filter.activity.by_presence.Filter activity by activity presence'; return 'export.filter.activity.by_presence.Filter activity by activity presence';
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('presences', EntityType::class, [ $builder->add('presences', EntityType::class, [
@@ -47,13 +46,11 @@ final readonly class ActivityPresenceFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
$presences = array_map( $presences = array_map(
@@ -67,13 +64,11 @@ final readonly class ActivityPresenceFilter implements FilterInterface
]; ];
} }
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$qb $qb
@@ -81,7 +76,6 @@ final readonly class ActivityPresenceFilter implements FilterInterface
->setParameter('activity_presence_filter_presences', $data['presences']); ->setParameter('activity_presence_filter_presences', $data['presences']);
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;

View File

@@ -27,15 +27,14 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
public function __construct( public function __construct(
protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatableStringHelperInterface $translatableStringHelper,
protected ActivityTypeRepositoryInterface $activityTypeRepository protected ActivityTypeRepositoryInterface $activityTypeRepository
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types'); $clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
@@ -44,13 +43,11 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
$qb->setParameter('selected_activity_types', $data['types']); $qb->setParameter('selected_activity_types', $data['types']);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('types', EntityType::class, [ $builder->add('types', EntityType::class, [
@@ -74,13 +71,11 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
// collect all the reasons'name used in this filter in one array // collect all the reasons'name used in this filter in one array
@@ -94,13 +89,11 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
]]; ]];
} }
#[\Override]
public function getTitle() public function getTitle()
{ {
return 'Filter by activity type'; return 'Filter by activity type';
} }
#[\Override]
public function validateForm($data, ExecutionContextInterface $context) public function validateForm($data, ExecutionContextInterface $context)
{ {
if (null === $data['types'] || 0 === \count($data['types'])) { if (null === $data['types'] || 0 === \count($data['types'])) {

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUsersFilter implements FilterInterface class ActivityUsersFilter implements FilterInterface
{ {
public function __construct(private readonly UserRender $userRender) {} public function __construct(private readonly UserRender $userRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$orX = $qb->expr()->orX(); $orX = $qb->expr()->orX();
@@ -41,13 +41,11 @@ class ActivityUsersFilter implements FilterInterface
$qb->andWhere($orX); $qb->andWhere($orX);
} }
#[\Override]
public function applyOn() public function applyOn()
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('accepted_users', PickUserDynamicType::class, [ $builder->add('accepted_users', PickUserDynamicType::class, [
@@ -56,13 +54,11 @@ class ActivityUsersFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
$users = []; $users = [];
@@ -76,7 +72,6 @@ class ActivityUsersFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Filter activity by users'; return 'Filter activity by users';

View File

@@ -20,15 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class ByCreatorFilter implements FilterInterface class ByCreatorFilter implements FilterInterface
{ {
public function __construct(private readonly UserRender $userRender) {} public function __construct(private readonly UserRender $userRender)
{
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$qb $qb
@@ -38,13 +38,11 @@ class ByCreatorFilter implements FilterInterface
->setParameter('users', $data['accepted_users']); ->setParameter('users', $data['accepted_users']);
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('accepted_users', PickUserDynamicType::class, [ $builder->add('accepted_users', PickUserDynamicType::class, [
@@ -52,13 +50,11 @@ class ByCreatorFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
$users = []; $users = [];
@@ -72,7 +68,6 @@ class ByCreatorFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'Filter activity by creator'; return 'Filter activity by creator';

View File

@@ -26,21 +26,20 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class CreatorJobFilter implements FilterInterface final readonly class CreatorJobFilter implements FilterInterface
{ {
private const string PREFIX = 'acp_act_filter_creator_job'; private const PREFIX = 'acp_act_filter_creator_job';
public function __construct( public function __construct(
private TranslatableStringHelper $translatableStringHelper, private TranslatableStringHelper $translatableStringHelper,
private TranslatorInterface $translator, private TranslatorInterface $translator,
private UserJobRepositoryInterface $userJobRepository, private UserJobRepositoryInterface $userJobRepository,
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -72,13 +71,11 @@ final readonly class CreatorJobFilter implements FilterInterface
); );
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder $builder
@@ -94,7 +91,6 @@ final readonly class CreatorJobFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
$jobs = array_map( $jobs = array_map(
@@ -107,7 +103,6 @@ final readonly class CreatorJobFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return [
@@ -115,7 +110,6 @@ final readonly class CreatorJobFilter implements FilterInterface
]; ];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.filter.activity.by_creator_job.Filter activity by user job'; return 'export.filter.activity.by_creator_job.Filter activity by user job';

View File

@@ -24,20 +24,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class CreatorScopeFilter implements FilterInterface class CreatorScopeFilter implements FilterInterface
{ {
private const string PREFIX = 'acp_act_filter_creator_scope'; private const PREFIX = 'acp_act_filter_creator_scope';
public function __construct( public function __construct(
private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatableStringHelper $translatableStringHelper,
private readonly ScopeRepositoryInterface $scopeRepository, private readonly ScopeRepositoryInterface $scopeRepository,
) {} ) {
}
#[\Override]
public function addRole(): ?string public function addRole(): ?string
{ {
return null; return null;
} }
#[\Override]
public function alterQuery(QueryBuilder $qb, $data) public function alterQuery(QueryBuilder $qb, $data)
{ {
$p = self::PREFIX; $p = self::PREFIX;
@@ -69,13 +68,11 @@ class CreatorScopeFilter implements FilterInterface
); );
} }
#[\Override]
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY;
} }
#[\Override]
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder $builder
@@ -90,7 +87,6 @@ class CreatorScopeFilter implements FilterInterface
]); ]);
} }
#[\Override]
public function describeAction($data, $format = 'string'): array public function describeAction($data, $format = 'string'): array
{ {
$scopes = []; $scopes = [];
@@ -106,7 +102,6 @@ class CreatorScopeFilter implements FilterInterface
]]; ]];
} }
#[\Override]
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return [
@@ -114,7 +109,6 @@ class CreatorScopeFilter implements FilterInterface
]; ];
} }
#[\Override]
public function getTitle(): string public function getTitle(): string
{ {
return 'export.filter.activity.by_creator_scope.Filter activity by user scope'; return 'export.filter.activity.by_creator_scope.Filter activity by user scope';

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