mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
Compare commits
10 Commits
rector/rul
...
upgrade/sy
Author | SHA1 | Date | |
---|---|---|---|
13bc9683fb
|
|||
958e2b5cf2
|
|||
f7ed390c96
|
|||
217ce99851
|
|||
efaa01f4f6
|
|||
f04ef9c931
|
|||
9252e92da0
|
|||
4ab4554e63
|
|||
6d63177ff4
|
|||
81e8928344
|
35
.env.test
35
.env.test
@@ -3,3 +3,38 @@
|
||||
# Run tests from root to adapt your own environment
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
|
||||
ADMIN_PASSWORD=admin
|
||||
|
||||
LOCALE=fr
|
||||
REDIS_URL=redis
|
||||
REDIS_PORT=6379
|
||||
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
|
||||
|
||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
|
||||
|
||||
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
|
||||
MESSENGER_TRANSPORT_DSN=sync://
|
||||
###< 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/test?serverVersion=14&charset=utf8"
|
||||
|
||||
ASYNC_UPLOAD_TEMP_URL_KEY=
|
||||
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
|
||||
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
|
||||
|
@@ -3,7 +3,6 @@
|
||||
# Select what we should cache between builds
|
||||
cache:
|
||||
paths:
|
||||
- tests/app/vendor/
|
||||
- .cache
|
||||
|
||||
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
||||
@@ -28,7 +27,7 @@ variables:
|
||||
REDIS_PORT: 6379
|
||||
REDIS_URL: redis://redis:6379
|
||||
# change vendor dir to make the app install into tests/apps
|
||||
COMPOSER_VENDOR_DIR: tests/app/vendor
|
||||
#COMPOSER_VENDOR_DIR: /vendor
|
||||
DEFAULT_CARRIER_CODE: BE
|
||||
|
||||
stages:
|
||||
@@ -49,7 +48,7 @@ build:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
- vendor/
|
||||
|
||||
code_style:
|
||||
stage: Tests
|
||||
@@ -63,7 +62,7 @@ code_style:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
- vendor/
|
||||
|
||||
phpstan_tests:
|
||||
stage: Tests
|
||||
@@ -77,7 +76,7 @@ phpstan_tests:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
- vendor/
|
||||
|
||||
rector_tests:
|
||||
stage: Tests
|
||||
@@ -91,7 +90,7 @@ rector_tests:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
- vendor/
|
||||
|
||||
# psalm_tests:
|
||||
# stage: Tests
|
||||
@@ -111,13 +110,12 @@ unit_tests:
|
||||
# until we fix testes
|
||||
allow_failure: true
|
||||
script:
|
||||
- php tests/app/bin/console doctrine:migrations:migrate -n
|
||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
||||
- php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n
|
||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=test
|
||||
- php tests/console doctrine:migrations:migrate -n
|
||||
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n
|
||||
- php -d memory_limit=2G tests/console cache:clear --env=test
|
||||
- php -d memory_limit=4G bin/phpunit --colors=never
|
||||
artifacts:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
- vendor/
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,6 +1,3 @@
|
||||
[submodule "_exts/sphinx-php"]
|
||||
path = _exts/sphinx-php
|
||||
url = https://github.com/fabpot/sphinx-php.git
|
||||
[submodule "tests/app"]
|
||||
path = tests/app
|
||||
url = https://gitlab.com/Chill-projet/chill-app.git
|
||||
|
@@ -107,7 +107,7 @@
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"App\\": "tests/app/src/",
|
||||
"App\\": "tests/",
|
||||
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests",
|
||||
"Chill\\WopiBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
|
||||
}
|
||||
@@ -123,12 +123,10 @@
|
||||
},
|
||||
"bin-dir": "bin",
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true,
|
||||
"vendor-dir": "tests/app/vendor"
|
||||
"sort-packages": true
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd",
|
||||
"cache:clear": "symfony-cmd"
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
||||
|
||||
public function __construct(
|
||||
array $widgetFactories,
|
||||
private ContainerBuilder $containerBuilder
|
||||
private readonly ContainerBuilder $containerBuilder
|
||||
) {
|
||||
// we register here widget factories (see below)
|
||||
$this->setWidgetFactories($widgetFactories);
|
||||
|
@@ -2,10 +2,10 @@
|
||||
|
||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="tests/app/vendor/phpunit/phpunit/phpunit.xsd"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="tests/app/tests/bootstrap.php"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
|
@@ -12,6 +12,8 @@ return static function (RectorConfig $rectorConfig): void {
|
||||
__DIR__ . '/src',
|
||||
]);
|
||||
|
||||
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/testsApp_KernelDevDebugContainer.xml');
|
||||
|
||||
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
||||
//$rectorConfig->cacheDirectory(__DIR__ . '/.cache/rector');
|
||||
|
||||
@@ -21,7 +23,8 @@ return static function (RectorConfig $rectorConfig): void {
|
||||
|
||||
//define sets of rules
|
||||
$rectorConfig->sets([
|
||||
LevelSetList::UP_TO_PHP_80
|
||||
LevelSetList::UP_TO_PHP_82,
|
||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
|
||||
]);
|
||||
|
||||
// skip some path...
|
||||
|
@@ -48,23 +48,22 @@ use function array_key_exists;
|
||||
final class ActivityController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
|
||||
private ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||
private ActivityTypeCategoryRepository $activityTypeCategoryRepository,
|
||||
private PersonRepository $personRepository,
|
||||
private ThirdPartyRepository $thirdPartyRepository,
|
||||
private LocationRepository $locationRepository,
|
||||
private ActivityRepository $activityRepository,
|
||||
private AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||
private EntityManagerInterface $entityManager,
|
||||
private EventDispatcherInterface $eventDispatcher,
|
||||
private LoggerInterface $logger,
|
||||
private SerializerInterface $serializer,
|
||||
private UserRepositoryInterface $userRepository,
|
||||
private CenterResolverManagerInterface $centerResolver,
|
||||
private TranslatorInterface $translator,
|
||||
)
|
||||
{
|
||||
private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
|
||||
private readonly ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||
private readonly ActivityTypeCategoryRepository $activityTypeCategoryRepository,
|
||||
private readonly PersonRepository $personRepository,
|
||||
private readonly ThirdPartyRepository $thirdPartyRepository,
|
||||
private readonly LocationRepository $locationRepository,
|
||||
private readonly ActivityRepository $activityRepository,
|
||||
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly SerializerInterface $serializer,
|
||||
private readonly UserRepositoryInterface $userRepository,
|
||||
private readonly CenterResolverManagerInterface $centerResolver,
|
||||
private readonly TranslatorInterface $translator,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
*/
|
||||
class ActivityReasonController extends AbstractController
|
||||
{
|
||||
public function __construct(private ActivityReasonRepository $activityReasonRepository)
|
||||
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
||||
*/
|
||||
private $faker;
|
||||
|
||||
public function __construct(private EntityManagerInterface $em)
|
||||
public function __construct(private readonly EntityManagerInterface $em)
|
||||
{
|
||||
$this->faker = FakerFactory::create('fr_FR');
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
||||
->setPerson($person)
|
||||
->setDate($this->faker->dateTimeThisYear())
|
||||
->setDurationTime($this->faker->dateTime(36000))
|
||||
->setType($this->getRandomActivityType())
|
||||
->setActivityType($this->getRandomActivityType())
|
||||
->setScope($this->getRandomScope());
|
||||
|
||||
// ->setAttendee($this->faker->boolean())
|
||||
|
@@ -65,9 +65,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
|
||||
use TrackUpdateTrait;
|
||||
|
||||
public const SENTRECEIVED_RECEIVED = 'received';
|
||||
final public const SENTRECEIVED_RECEIVED = 'received';
|
||||
|
||||
public const SENTRECEIVED_SENT = 'sent';
|
||||
final public const SENTRECEIVED_SENT = 'sent';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
|
||||
@@ -672,7 +672,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @deprecated use @link{self::setActivityType} instead
|
||||
*/
|
||||
public function setType(ActivityType $activityType): self
|
||||
{
|
||||
|
@@ -27,11 +27,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
*/
|
||||
class ActivityType
|
||||
{
|
||||
public const FIELD_INVISIBLE = 0;
|
||||
final public const FIELD_INVISIBLE = 0;
|
||||
|
||||
public const FIELD_OPTIONAL = 1;
|
||||
final public const FIELD_OPTIONAL = 1;
|
||||
|
||||
public const FIELD_REQUIRED = 2;
|
||||
final public const FIELD_REQUIRED = 2;
|
||||
|
||||
/**
|
||||
* @deprecated not in use
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class ActivityEntityListener
|
||||
{
|
||||
public function __construct(private EntityManagerInterface $em, private AccompanyingPeriodWorkRepository $workRepository)
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByCreatorAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private UserRepositoryInterface $userRepository, private UserRender $userRender)
|
||||
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use function in_array;
|
||||
|
||||
class BySocialActionAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository)
|
||||
public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use function in_array;
|
||||
|
||||
class BySocialIssueAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender)
|
||||
public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use function in_array;
|
||||
|
||||
class ByThirdpartyAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private ThirdPartyRepository $thirdPartyRepository, private ThirdPartyRender $thirdPartyRender)
|
||||
public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use function in_array;
|
||||
|
||||
class CreatorScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class DateAggregator implements AggregatorInterface
|
||||
|
||||
private const DEFAULT_CHOICE = 'year';
|
||||
|
||||
public function __construct(private TranslatorInterface $translator)
|
||||
public function __construct(private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use function in_array;
|
||||
|
||||
class LocationTypeAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class ActivityTypeAggregator implements AggregatorInterface
|
||||
{
|
||||
public const KEY = 'activity_type_aggregator';
|
||||
final public const KEY = 'activity_type_aggregator';
|
||||
|
||||
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
|
@@ -21,9 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityUserAggregator implements AggregatorInterface
|
||||
{
|
||||
public const KEY = 'activity_user_id';
|
||||
final public const KEY = 'activity_user_id';
|
||||
|
||||
public function __construct(private UserRepository $userRepository, private UserRender $userRender)
|
||||
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use function in_array;
|
||||
|
||||
class ActivityUsersAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private UserRepositoryInterface $userRepository, private UserRender $userRender)
|
||||
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use function in_array;
|
||||
|
||||
class ActivityUsersJobAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
||||
{
|
||||
public function __construct(private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use function in_array;
|
||||
|
||||
class ActivityUsersScopeAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
||||
{
|
||||
public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class SentReceivedAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private TranslatorInterface $translator)
|
||||
public function __construct(private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -16,9 +16,9 @@ namespace Chill\ActivityBundle\Export;
|
||||
*/
|
||||
abstract class Declarations
|
||||
{
|
||||
public const ACTIVITY = 'activity';
|
||||
final public const ACTIVITY = 'activity';
|
||||
|
||||
public const ACTIVITY_ACP = 'activity_linked_to_acp';
|
||||
final public const ACTIVITY_ACP = 'activity_linked_to_acp';
|
||||
|
||||
public const ACTIVITY_PERSON = 'activity_linked_to_person';
|
||||
final public const ACTIVITY_PERSON = 'activity_linked_to_person';
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ListActivity implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private ListActivityHelper $helper, private EntityManagerInterface $entityManager, private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper)
|
||||
public function __construct(private readonly ListActivityHelper $helper, private readonly EntityManagerInterface $entityManager, private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
||||
'person_id',
|
||||
];
|
||||
|
||||
public function __construct(protected EntityManagerInterface $entityManager, protected TranslatorInterface $translator, protected TranslatableStringHelperInterface $translatableStringHelper, private ActivityRepository $activityRepository)
|
||||
public function __construct(protected EntityManagerInterface $entityManager, protected TranslatorInterface $translator, protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ActivityRepository $activityRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -30,13 +30,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public const SUM = 'sum';
|
||||
final public const SUM = 'sum';
|
||||
|
||||
/**
|
||||
* @param string $action the stat to perform
|
||||
*/
|
||||
public function __construct(
|
||||
private ActivityRepository $activityRepository,
|
||||
private readonly ActivityRepository $activityRepository,
|
||||
/**
|
||||
* The action for this report.
|
||||
*/
|
||||
|
@@ -30,9 +30,9 @@ use const SORT_NUMERIC;
|
||||
|
||||
class ListActivityHelper
|
||||
{
|
||||
public const MSG_KEY = 'export.list.activity.';
|
||||
final public const MSG_KEY = 'export.list.activity.';
|
||||
|
||||
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private ActivityTypeRepositoryInterface $activityTypeRepository, private DateTimeHelper $dateTimeHelper, private LabelPersonHelper $labelPersonHelper, private LabelThirdPartyHelper $labelThirdPartyHelper, private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatableStringExportLabelHelper $translatableStringLabelHelper, private UserHelper $userHelper)
|
||||
public function __construct(private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository, private readonly ActivityTypeRepositoryInterface $activityTypeRepository, private readonly DateTimeHelper $dateTimeHelper, private readonly LabelPersonHelper $labelPersonHelper, private readonly LabelThirdPartyHelper $labelThirdPartyHelper, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper, private readonly UserHelper $userHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityTypeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private ActivityTypeRepositoryInterface $activityTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ActivityTypeRepositoryInterface $activityTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByCreatorFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private UserRender $userRender)
|
||||
public function __construct(private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class BySocialActionFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private SocialActionRender $actionRender)
|
||||
public function __construct(private readonly SocialActionRender $actionRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class BySocialIssueFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private SocialIssueRender $issueRender)
|
||||
public function __construct(private readonly SocialIssueRender $issueRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class EmergencyFilter implements FilterInterface
|
||||
|
||||
private const DEFAULT_CHOICE = false;
|
||||
|
||||
public function __construct(private TranslatorInterface $translator)
|
||||
public function __construct(private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class LocationTypeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class SentReceivedFilter implements FilterInterface
|
||||
|
||||
private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
||||
|
||||
public function __construct(private TranslatorInterface $translator)
|
||||
public function __construct(private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UserFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private UserRender $userRender)
|
||||
public function __construct(private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use function in_array;
|
||||
|
||||
class UserScopeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ActivityDateFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(protected TranslatorInterface $translator, private RollingDateConverterInterface $rollingDateConverter)
|
||||
public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityUsersFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private UserRender $userRender)
|
||||
public function __construct(private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UsersJobFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UsersScopeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ActivityTypeType extends AbstractType
|
||||
{
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
*/
|
||||
class PickActivityReasonType extends AbstractType
|
||||
{
|
||||
public function __construct(private ActivityReasonRepository $activityReasonRepository, private ActivityReasonRender $reasonRender, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository, private readonly ActivityReasonRender $reasonRender, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class TranslatableActivityReasonCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator)
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Security;
|
||||
/**
|
||||
* @implements LocalMenuBuilderInterface<array>
|
||||
*/
|
||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private Security $security)
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@ use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\MainBundle\Notification\NotificationHandlerInterface;
|
||||
|
||||
final class ActivityNotificationHandler implements NotificationHandlerInterface
|
||||
final readonly class ActivityNotificationHandler implements NotificationHandlerInterface
|
||||
{
|
||||
public function __construct(private ActivityRepository $activityRepository)
|
||||
{
|
||||
|
@@ -33,7 +33,7 @@ use Symfony\Component\Security\Core\Security;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
|
||||
final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
|
||||
{
|
||||
public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher, private TokenStorageInterface $tokenStorage, private ActivityRepository $repository, private EntityManagerInterface $em, private Security $security)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
private readonly EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@ class ActivityReasonRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(
|
||||
ManagerRegistry $registry,
|
||||
private RequestStack $requestStack
|
||||
private readonly RequestStack $requestStack
|
||||
) {
|
||||
parent::__construct($registry, ActivityReason::class);
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository;
|
||||
|
||||
final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
private readonly EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
|
@@ -20,9 +20,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
public const LISTS = 'CHILL_ACTIVITY_LIST';
|
||||
final public const LISTS = 'CHILL_ACTIVITY_LIST';
|
||||
|
||||
public const STATS = 'CHILL_ACTIVITY_STATS';
|
||||
final public const STATS = 'CHILL_ACTIVITY_STATS';
|
||||
|
||||
protected VoterHelperInterface $helper;
|
||||
|
||||
|
@@ -35,7 +35,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
*
|
||||
* It is safe for usage in template and controller
|
||||
*/
|
||||
public const CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||
final public const CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||
|
||||
/**
|
||||
* role to allow to create an activity associated win an accompanying course.
|
||||
@@ -44,7 +44,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE';
|
||||
final public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE';
|
||||
|
||||
/**
|
||||
* role to allow to create an activity associated with a person.
|
||||
@@ -53,17 +53,17 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON';
|
||||
final public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON';
|
||||
|
||||
public const DELETE = 'CHILL_ACTIVITY_DELETE';
|
||||
final public const DELETE = 'CHILL_ACTIVITY_DELETE';
|
||||
|
||||
public const FULL = 'CHILL_ACTIVITY_FULL';
|
||||
final public const FULL = 'CHILL_ACTIVITY_FULL';
|
||||
|
||||
public const SEE = 'CHILL_ACTIVITY_SEE';
|
||||
final public const SEE = 'CHILL_ACTIVITY_SEE';
|
||||
|
||||
public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
||||
final public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
||||
|
||||
public const UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
||||
final public const UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
||||
|
||||
private const ALL = [
|
||||
self::CREATE,
|
||||
|
@@ -39,7 +39,7 @@ class ActivityContext implements
|
||||
DocGeneratorContextWithAdminFormInterface,
|
||||
DocGeneratorContextWithPublicFormInterface
|
||||
{
|
||||
public function __construct(private DocumentCategoryRepository $documentCategoryRepository, private NormalizerInterface $normalizer, private TranslatableStringHelperInterface $translatableStringHelper, private EntityManagerInterface $em, private PersonRenderInterface $personRender, private PersonRepository $personRepository, private TranslatorInterface $translator, private BaseContextData $baseContextData)
|
||||
public function __construct(private readonly DocumentCategoryRepository $documentCategoryRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly EntityManagerInterface $em, private readonly PersonRenderInterface $personRender, private readonly PersonRepository $personRepository, private readonly TranslatorInterface $translator, private readonly BaseContextData $baseContextData)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
||||
DocGeneratorContextWithAdminFormInterface,
|
||||
DocGeneratorContextWithPublicFormInterface
|
||||
{
|
||||
public function __construct(private AccompanyingPeriodContext $accompanyingPeriodContext, private ActivityACLAwareRepositoryInterface $activityACLAwareRepository, private NormalizerInterface $normalizer, private PersonRepository $personRepository, private SocialActionRepository $socialActionRepository, private SocialIssueRepository $socialIssueRepository, private ThirdPartyRepository $thirdPartyRepository, private TranslatableStringHelperInterface $translatableStringHelper, private UserRepository $userRepository)
|
||||
public function __construct(private readonly AccompanyingPeriodContext $accompanyingPeriodContext, private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository, private readonly NormalizerInterface $normalizer, private readonly PersonRepository $personRepository, private readonly SocialActionRepository $socialActionRepository, private readonly SocialIssueRepository $socialIssueRepository, private readonly ThirdPartyRepository $thirdPartyRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -214,7 +214,7 @@ final class ActivityControllerTest extends WebTestCase
|
||||
->setName('social without activity');
|
||||
//copy role scopes where ACTIVITY is not present
|
||||
foreach ($socialPermissionGroup->getRoleScopes() as $roleScope) {
|
||||
if (!strpos($roleScope->getRole(), 'ACTIVITY')) {
|
||||
if (!strpos((string) $roleScope->getRole(), 'ACTIVITY')) {
|
||||
$withoutActivityPermissionGroup->addRoleScope($roleScope);
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
*/
|
||||
final class ActivityReasonCategoryControllerTest extends WebTestCase
|
||||
{
|
||||
public function testToWrite()
|
||||
public function testToWrite(): never
|
||||
{
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
*/
|
||||
final class ActivityReasonControllerTest extends WebTestCase
|
||||
{
|
||||
public function testToWrite()
|
||||
public function testToWrite(): never
|
||||
{
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
*/
|
||||
final class ActivityTypeControllerTest extends WebTestCase
|
||||
{
|
||||
public function testToWrite()
|
||||
public function testToWrite(): never
|
||||
{
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function testSimple()
|
||||
public function testSimple(): never
|
||||
{
|
||||
$translatableActivityReasonType = new PickActivityReasonType(
|
||||
$this->getTranslatableStringHelper()
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
*/
|
||||
final class TimelineProviderTest extends WebTestCase
|
||||
{
|
||||
public function testAnActivityIsShownOnTimeline()
|
||||
public function testAnActivityIsShownOnTimeline(): never
|
||||
{
|
||||
$this->markTestSkipped('we have to write fixtures before writing this tests');
|
||||
}
|
||||
|
@@ -18,9 +18,9 @@ use Symfony\Component\Validator\Constraint;
|
||||
*/
|
||||
class ActivityValidity extends Constraint
|
||||
{
|
||||
public const IS_REQUIRED_MESSAGE = ' is required';
|
||||
final public const IS_REQUIRED_MESSAGE = ' is required';
|
||||
|
||||
public const ROOT_MESSAGE = 'For this type of activity, ';
|
||||
final public const ROOT_MESSAGE = 'For this type of activity, ';
|
||||
|
||||
public $noPersonsMessage = 'For this type of activity, you must add at least one person';
|
||||
|
||||
|
@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
final class AsideActivityController extends CRUDController
|
||||
{
|
||||
public function __construct(private AsideActivityCategoryRepository $categoryRepository)
|
||||
public function __construct(private readonly AsideActivityCategoryRepository $categoryRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@ use function random_int;
|
||||
|
||||
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public function __construct(private UserRepository $userRepository)
|
||||
public function __construct(private readonly UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByActivityTypeAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private AsideActivityCategoryRepository $asideActivityCategoryRepository, private TranslatableStringHelper $translatableStringHelper)
|
||||
public function __construct(private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository, private readonly TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class ByUserJobAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function in_array;
|
||||
|
||||
class ByUserScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -16,5 +16,5 @@ namespace Chill\AsideActivityBundle\Export;
|
||||
*/
|
||||
abstract class Declarations
|
||||
{
|
||||
public const ASIDE_ACTIVITY_TYPE = 'aside_activity';
|
||||
final public const ASIDE_ACTIVITY_TYPE = 'aside_activity';
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private AsideActivityRepository $repository)
|
||||
public function __construct(private readonly AsideActivityRepository $repository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CountAsideActivity implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private AsideActivityRepository $repository)
|
||||
public function __construct(private readonly AsideActivityRepository $repository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ use Doctrine\ORM\QueryBuilder;
|
||||
use LogicException;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ListAsideActivity implements ListInterface, GroupedExportInterface
|
||||
final readonly class ListAsideActivity implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private EntityManagerInterface $em, private DateTimeHelper $dateTimeHelper, private UserHelper $userHelper, private ScopeRepositoryInterface $scopeRepository, private CenterRepositoryInterface $centerRepository, private AsideActivityCategoryRepository $asideActivityCategoryRepository, private CategoryRender $categoryRender, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class SumAsideActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
public function __construct(private AsideActivityRepository $repository)
|
||||
public function __construct(private readonly AsideActivityRepository $repository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByActivityTypeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private CategoryRender $categoryRender, private TranslatableStringHelperInterface $translatableStringHelper, private AsideActivityCategoryRepository $asideActivityTypeRepository)
|
||||
public function __construct(private readonly CategoryRender $categoryRender, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly AsideActivityCategoryRepository $asideActivityTypeRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ByDateFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator)
|
||||
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private UserRender $userRender)
|
||||
public function __construct(private readonly UserRender $userRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserJobFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserScopeFilter implements FilterInterface
|
||||
{
|
||||
public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class AsideActivityCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private CategoryRender $categoryRender)
|
||||
public function __construct(private readonly CategoryRender $categoryRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ use function in_array;
|
||||
|
||||
final class AsideActivityFormType extends AbstractType
|
||||
{
|
||||
private array $timeChoices;
|
||||
private readonly array $timeChoices;
|
||||
|
||||
public function __construct(
|
||||
ParameterBagInterface $parameterBag,
|
||||
@@ -105,13 +105,7 @@ final class AsideActivityFormType extends AbstractType
|
||||
if (!in_array($data->getTimestamp(), $timeChoices, true)) {
|
||||
// the data are not in the possible values. add them
|
||||
$timeChoices[$data->format('H:i')] = $data->getTimestamp();
|
||||
$form = $builder->create($fieldName, ChoiceType::class, array_merge(
|
||||
$durationTimeOptions,
|
||||
[
|
||||
'choices' => $timeChoices,
|
||||
'auto_initialize' => false,
|
||||
]
|
||||
));
|
||||
$form = $builder->create($fieldName, ChoiceType::class, [...$durationTimeOptions, 'choices' => $timeChoices, 'auto_initialize' => false]);
|
||||
$form->addModelTransformer($durationTimeTransformer);
|
||||
$formEvent->getForm()->getParent()->add($form->getForm());
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
final class PickAsideActivityCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private CategoryRender $categoryRender)
|
||||
public function __construct(private readonly CategoryRender $categoryRender)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ namespace Chill\AsideActivityBundle\Menu;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||
final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private Security $security)
|
||||
{
|
||||
|
@@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
class AsideActivityCategoryRepository implements ObjectRepository
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
private readonly EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
@@ -21,9 +21,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS';
|
||||
final public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS';
|
||||
|
||||
private VoterHelperInterface $voterHelper;
|
||||
private readonly VoterHelperInterface $voterHelper;
|
||||
|
||||
public function __construct(
|
||||
VoterHelperFactoryInterface $voterHelperFactory
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Component\Templating\EngineInterface;
|
||||
/**
|
||||
* @implements ChillEntityRenderInterface<AsideActivityCategory>
|
||||
*/
|
||||
final class CategoryRender implements ChillEntityRenderInterface
|
||||
final readonly class CategoryRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public const DEFAULT_ARGS = [
|
||||
self::SEPERATOR_KEY => ' > ',
|
||||
@@ -27,7 +27,7 @@ final class CategoryRender implements ChillEntityRenderInterface
|
||||
|
||||
public const SEPERATOR_KEY = 'default.separator';
|
||||
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private EngineInterface $engine)
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -13,11 +13,11 @@ namespace Chill\BudgetBundle\Calculator;
|
||||
|
||||
class CalculatorResult
|
||||
{
|
||||
public const TYPE_CURRENCY = 'currency';
|
||||
final public const TYPE_CURRENCY = 'currency';
|
||||
|
||||
public const TYPE_PERCENTAGE = 'percentage';
|
||||
final public const TYPE_PERCENTAGE = 'percentage';
|
||||
|
||||
public const TYPE_RATE = 'rate';
|
||||
final public const TYPE_RATE = 'rate';
|
||||
|
||||
public $label;
|
||||
|
||||
|
@@ -31,7 +31,7 @@ use function count;
|
||||
|
||||
class ElementController extends AbstractController
|
||||
{
|
||||
public function __construct(private CalculatorManager $calculator, private ResourceRepository $resourceRepository, private ChargeRepository $chargeRepository)
|
||||
public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -24,15 +24,15 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
*/
|
||||
class Charge extends AbstractElement implements HasCentersInterface
|
||||
{
|
||||
public const HELP_ASKED = 'running';
|
||||
final public const HELP_ASKED = 'running';
|
||||
|
||||
public const HELP_NO = 'no';
|
||||
final public const HELP_NO = 'no';
|
||||
|
||||
public const HELP_NOT_RELEVANT = 'not-relevant';
|
||||
final public const HELP_NOT_RELEVANT = 'not-relevant';
|
||||
|
||||
public const HELP_YES = 'yes';
|
||||
final public const HELP_YES = 'yes';
|
||||
|
||||
public const HELPS = [
|
||||
final public const HELPS = [
|
||||
self::HELP_ASKED,
|
||||
self::HELP_NO,
|
||||
self::HELP_YES,
|
||||
|
@@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ChargeType extends AbstractType
|
||||
{
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private ChargeKindRepository $repository, private TranslatorInterface $translator)
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ResourceType extends AbstractType
|
||||
{
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepository $repository, private TranslatorInterface $translator)
|
||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private Security $security)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository;
|
||||
|
||||
final class ChargeKindRepository implements ChargeKindRepositoryInterface
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
private readonly EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository;
|
||||
|
||||
final class ResourceKindRepository implements ResourceKindRepositoryInterface
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
private readonly EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
@@ -24,20 +24,20 @@ use UnexpectedValueException;
|
||||
|
||||
class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
public const CREATE = 'CHILL_BUDGET_ELEMENT_CREATE';
|
||||
final public const CREATE = 'CHILL_BUDGET_ELEMENT_CREATE';
|
||||
|
||||
public const DELETE = 'CHILL_BUDGET_ELEMENT_DELETE';
|
||||
final public const DELETE = 'CHILL_BUDGET_ELEMENT_DELETE';
|
||||
|
||||
public const ROLES = [
|
||||
final public const ROLES = [
|
||||
self::CREATE,
|
||||
self::DELETE,
|
||||
self::SEE,
|
||||
self::UPDATE,
|
||||
];
|
||||
|
||||
public const SEE = 'CHILL_BUDGET_ELEMENT_SEE';
|
||||
final public const SEE = 'CHILL_BUDGET_ELEMENT_SEE';
|
||||
|
||||
public const UPDATE = 'CHILL_BUDGET_ELEMENT_UPDATE';
|
||||
final public const UPDATE = 'CHILL_BUDGET_ELEMENT_UPDATE';
|
||||
|
||||
protected VoterHelperInterface $voter;
|
||||
|
||||
|
@@ -27,7 +27,7 @@ use function count;
|
||||
/**
|
||||
* Helps to find a summary of the budget: the sum of resources and charges.
|
||||
*/
|
||||
final class SummaryBudget implements SummaryBudgetInterface
|
||||
final readonly class SummaryBudget implements SummaryBudgetInterface
|
||||
{
|
||||
private const QUERY_CHARGE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id';
|
||||
|
||||
|
@@ -20,9 +20,9 @@ use Symfony\Component\Templating\EngineInterface;
|
||||
/**
|
||||
* @implements ChillEntityRenderInterface<ResourceKind|ChargeKind>
|
||||
*/
|
||||
final class BudgetElementTypeRender implements ChillEntityRenderInterface
|
||||
final readonly class BudgetElementTypeRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private EngineInterface $engine)
|
||||
public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -66,11 +66,11 @@ final class SummaryBudgetTest extends TestCase
|
||||
$em = $this->prophesize(EntityManagerInterface::class);
|
||||
$em->createNativeQuery(Argument::type('string'), Argument::type(Query\ResultSetMapping::class))
|
||||
->will(static function ($args) use ($queryResources, $queryCharges) {
|
||||
if (str_contains($args[0], 'chill_budget.resource')) {
|
||||
if (str_contains((string) $args[0], 'chill_budget.resource')) {
|
||||
return $queryResources->reveal();
|
||||
}
|
||||
|
||||
if (str_contains($args[0], 'chill_budget.charge')) {
|
||||
if (str_contains((string) $args[0], 'chill_budget.charge')) {
|
||||
return $queryCharges->reveal();
|
||||
}
|
||||
|
||||
|
@@ -29,12 +29,12 @@ use TheNetworg\OAuth2\Client\Provider\Azure;
|
||||
|
||||
class AzureGrantAdminConsentAndAcquireToken extends Command
|
||||
{
|
||||
public function __construct(private Azure $azure, private ClientRegistry $clientRegistry, private MachineTokenStorage $machineTokenStorage)
|
||||
public function __construct(private readonly Azure $azure, private readonly ClientRegistry $clientRegistry, private readonly MachineTokenStorage $machineTokenStorage)
|
||||
{
|
||||
parent::__construct('chill:calendar:msgraph-grant-admin-consent');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
/** @var FormatterHelper $formatter */
|
||||
$formatter = $this->getHelper('formatter');
|
||||
|
@@ -33,11 +33,11 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
class MapAndSubscribeUserCalendarCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private EntityManagerInterface $em,
|
||||
private EventsOnUserSubscriptionCreator $eventsOnUserSubscriptionCreator,
|
||||
private LoggerInterface $logger,
|
||||
private MapCalendarToUser $mapCalendarToUser,
|
||||
private MSGraphUserRepository $userRepository
|
||||
private readonly EntityManagerInterface $em,
|
||||
private readonly EventsOnUserSubscriptionCreator $eventsOnUserSubscriptionCreator,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly MapCalendarToUser $mapCalendarToUser,
|
||||
private readonly MSGraphUserRepository $userRepository
|
||||
) {
|
||||
parent::__construct('chill:calendar:msgraph-user-map-subscribe');
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user