mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-12-01 16:08:28 +00:00
Apply new rector rules regarding to PHP version to 8.4
This commit is contained in:
@@ -32,6 +32,7 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
||||
$this->widgetFactories[] = $factory;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getConfiguration(array $config, ContainerBuilder $container): ?\Symfony\Component\Config\Definition\ConfigurationInterface
|
||||
{
|
||||
return new Configuration($this->widgetFactories, $container);
|
||||
|
||||
@@ -97,12 +97,12 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
|
||||
$or = new Expr\Orx();
|
||||
// add the case where closingDate IS NULL
|
||||
$andWhenClosingDateIsNull = new Expr\Andx();
|
||||
$andWhenClosingDateIsNull->add((new Expr())->isNull('ap.closingDate'));
|
||||
$andWhenClosingDateIsNull->add((new Expr())->gte(':now', 'ap.openingDate'));
|
||||
$andWhenClosingDateIsNull->add(new Expr()->isNull('ap.closingDate'));
|
||||
$andWhenClosingDateIsNull->add(new Expr()->gte(':now', 'ap.openingDate'));
|
||||
$or->add($andWhenClosingDateIsNull);
|
||||
// add the case when now is between opening date and closing date
|
||||
$or->add(
|
||||
(new Expr())->between(':now', 'ap.openingDate', 'ap.closingDate')
|
||||
new Expr()->between(':now', 'ap.openingDate', 'ap.closingDate')
|
||||
);
|
||||
$and->add($or);
|
||||
$qb->setParameter('now', new DateTime(), Type::DATE);
|
||||
|
||||
@@ -22,6 +22,7 @@ class AdminActivityPresenceController extends CRUDController
|
||||
*
|
||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||
*/
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||
|
||||
@@ -22,6 +22,7 @@ class AdminActivityTypeCategoryController extends CRUDController
|
||||
*
|
||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||
*/
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||
|
||||
@@ -22,6 +22,7 @@ class AdminActivityTypeController extends CRUDController
|
||||
*
|
||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||
*/
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||
|
||||
@@ -61,7 +61,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
||||
|
||||
public function newRandomActivity($person): ?Activity
|
||||
{
|
||||
$activity = (new Activity())
|
||||
$activity = new Activity()
|
||||
->setUser($this->getRandomUser())
|
||||
->setPerson($person)
|
||||
->setDate($this->faker->dateTimeThisYear())
|
||||
|
||||
@@ -54,7 +54,7 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf
|
||||
|
||||
foreach ($reasons as $r) {
|
||||
echo 'Creating activity reason : '.$r['name']['en']."\n";
|
||||
$activityReason = (new ActivityReason())
|
||||
$activityReason = new ActivityReason()
|
||||
->setName($r['name'])
|
||||
->setActive(true)
|
||||
->setCategory($this->getReference($r['category'], ActivityReasonCategory::class));
|
||||
|
||||
@@ -35,7 +35,7 @@ class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtu
|
||||
|
||||
foreach ($categs as $c) {
|
||||
echo 'Creating activity reason category : '.$c['name']['en']."\n";
|
||||
$activityReasonCategory = (new ActivityReasonCategory())
|
||||
$activityReasonCategory = new ActivityReasonCategory()
|
||||
->setName($c['name'])
|
||||
->setActive(true);
|
||||
$manager->persist($activityReasonCategory);
|
||||
|
||||
@@ -56,7 +56,7 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface
|
||||
|
||||
foreach ($types as $t) {
|
||||
echo 'Creating activity type : '.$t['name']['fr'].' (cat:'.$t['category']." \n";
|
||||
$activityType = (new ActivityType())
|
||||
$activityType = new ActivityType()
|
||||
->setName($t['name'])
|
||||
->setCategory($this->getReference('activity_type_cat_'.$t['category'], ActivityTypeCategory::class))
|
||||
->setSocialIssuesVisible(1)
|
||||
|
||||
@@ -44,7 +44,7 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac
|
||||
foreach ($categories as $cat) {
|
||||
echo 'Creating activity type category : '.$cat['ref']."\n";
|
||||
|
||||
$newCat = (new ActivityTypeCategory())
|
||||
$newCat = new ActivityTypeCategory()
|
||||
->setName($cat['name']);
|
||||
|
||||
$manager->persist($newCat);
|
||||
|
||||
@@ -64,25 +64,25 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
|
||||
$permissionsGroup->getName(),
|
||||
$scope->getName()['en']
|
||||
);
|
||||
$roleScopeUpdate = (new RoleScope())
|
||||
$roleScopeUpdate = new RoleScope()
|
||||
->setRole('CHILL_ACTIVITY_UPDATE')
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeUpdate);
|
||||
$roleScopeCreate = (new RoleScope())
|
||||
$roleScopeCreate = new RoleScope()
|
||||
->setRole(ActivityVoter::CREATE_ACCOMPANYING_COURSE)
|
||||
->setScope($scope);
|
||||
$roleScopeCreate = (new RoleScope())
|
||||
$roleScopeCreate = new RoleScope()
|
||||
->setRole(ActivityVoter::CREATE_PERSON)
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeCreate);
|
||||
$roleScopeDelete = (new RoleScope())
|
||||
$roleScopeDelete = new RoleScope()
|
||||
->setRole('CHILL_ACTIVITY_DELETE')
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeDelete);
|
||||
$roleScopeList = (new RoleScope())
|
||||
$roleScopeList = new RoleScope()
|
||||
->setRole(ActivityStatsVoter::LISTS);
|
||||
$permissionsGroup->addRoleScope($roleScopeList);
|
||||
$roleScopeStat = (new RoleScope())
|
||||
$roleScopeStat = new RoleScope()
|
||||
->setRole(ActivityStatsVoter::STATS);
|
||||
$permissionsGroup->addRoleScope($roleScopeStat);
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
|
||||
use TrackUpdateTrait;
|
||||
|
||||
final public const SENTRECEIVED_RECEIVED = 'received';
|
||||
final public const string SENTRECEIVED_RECEIVED = 'received';
|
||||
|
||||
final public const SENTRECEIVED_SENT = 'sent';
|
||||
final public const string SENTRECEIVED_SENT = 'sent';
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
|
||||
@@ -447,9 +447,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
return (int) round(($this->travelTime->getTimestamp() + $this->travelTime->getOffset()) / 60.0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
#[\Deprecated]
|
||||
public function getType(): ActivityType
|
||||
{
|
||||
return $this->activityType;
|
||||
@@ -632,9 +630,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
#[\Deprecated]
|
||||
public function setType(ActivityType $activityType): self
|
||||
{
|
||||
$this->activityType = $activityType;
|
||||
|
||||
@@ -25,11 +25,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
#[ORM\Table(name: 'activitytype')]
|
||||
class ActivityType
|
||||
{
|
||||
final public const FIELD_INVISIBLE = 0;
|
||||
final public const int FIELD_INVISIBLE = 0;
|
||||
|
||||
final public const FIELD_OPTIONAL = 1;
|
||||
final public const int FIELD_OPTIONAL = 1;
|
||||
|
||||
final public const FIELD_REQUIRED = 2;
|
||||
final public const int FIELD_REQUIRED = 2;
|
||||
|
||||
/**
|
||||
* @deprecated not in use
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_by_activity_type_agg';
|
||||
private const string PREFIX = 'acp_by_activity_type_agg';
|
||||
|
||||
public function __construct(
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
|
||||
@@ -18,7 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ActivityLocationAggregator implements AggregatorInterface
|
||||
{
|
||||
public const KEY = 'activity_location_aggregator';
|
||||
public const string KEY = 'activity_location_aggregator';
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityTypeAggregator implements AggregatorInterface
|
||||
{
|
||||
final public const KEY = 'activity_type_aggregator';
|
||||
final public const string KEY = 'activity_type_aggregator';
|
||||
|
||||
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityUserAggregator implements AggregatorInterface
|
||||
{
|
||||
final public const KEY = 'activity_user_id';
|
||||
final public const string KEY = 'activity_user_id';
|
||||
|
||||
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityUsersJobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'act_agg_user_job';
|
||||
private const string PREFIX = 'act_agg_user_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActivityUsersScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'act_agg_user_scope';
|
||||
private const string PREFIX = 'act_agg_user_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorJobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_creator_job';
|
||||
private const string PREFIX = 'acp_agg_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_creator_scope';
|
||||
private const string PREFIX = 'acp_agg_creator_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepository $scopeRepository,
|
||||
|
||||
@@ -19,13 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class DateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'by month' => 'month',
|
||||
'by week' => 'week',
|
||||
'by year' => 'year',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'year';
|
||||
private const string DEFAULT_CHOICE = 'year';
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
final readonly class PersonsAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'act_persons_agg';
|
||||
private const string PREFIX = 'act_persons_agg';
|
||||
|
||||
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
final public const SUM = 'sum';
|
||||
final public const string SUM = 'sum';
|
||||
private readonly bool $filterStatsByCenters;
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ListActivityHelper
|
||||
{
|
||||
final public const MSG_KEY = 'export.list.activity.';
|
||||
final public const string MSG_KEY = 'export.list.activity.';
|
||||
|
||||
public function __construct(
|
||||
private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository,
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class ActivityTypeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
|
||||
private const string BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
|
||||
|
||||
public function __construct(
|
||||
private ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||
|
||||
@@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
final readonly class CreatorJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_act_filter_creator_job';
|
||||
private const string PREFIX = 'acp_act_filter_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
class CreatorScopeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_act_filter_creator_scope';
|
||||
private const string PREFIX = 'acp_act_filter_creator_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||
|
||||
@@ -22,12 +22,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class EmergencyFilter implements FilterInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'activity is emergency' => 'true',
|
||||
'activity is not emergency' => 'false',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'false';
|
||||
private const string DEFAULT_CHOICE = 'false';
|
||||
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
final readonly class PersonsFilter implements FilterInterface
|
||||
{
|
||||
private const PREFIX = 'act_persons_filter';
|
||||
private const string PREFIX = 'act_persons_filter';
|
||||
|
||||
public function __construct(private PersonRenderInterface $personRender) {}
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class SentReceivedFilter implements FilterInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'export.filter.activity.by_sent_received.is sent' => Activity::SENTRECEIVED_SENT,
|
||||
'export.filter.activity.by_sent_received.is received' => Activity::SENTRECEIVED_RECEIVED,
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
||||
private const string DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
||||
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
class UsersJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'act_filter_user_job';
|
||||
private const string PREFIX = 'act_filter_user_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
class UsersScopeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'act_filter_user_scope';
|
||||
private const string PREFIX = 'act_filter_user_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -36,6 +36,7 @@ class ActivityReasonCategoryType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_activitybundle_activityreasoncategory';
|
||||
|
||||
@@ -36,6 +36,7 @@ class ActivityReasonType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_activitybundle_activityreason';
|
||||
|
||||
@@ -400,6 +400,7 @@ class ActivityType extends AbstractType
|
||||
->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_activitybundle_activity';
|
||||
|
||||
@@ -31,6 +31,7 @@ class ActivityFieldPresence extends AbstractType
|
||||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return ChoiceType::class;
|
||||
|
||||
@@ -49,11 +49,13 @@ class PickActivityReasonType extends AbstractType
|
||||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'translatable_activity_reason';
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return EntityType::class;
|
||||
|
||||
@@ -36,6 +36,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
||||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return EntityType::class;
|
||||
|
||||
@@ -34,11 +34,13 @@ class TranslatableActivityType extends AbstractType
|
||||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'translatable_activity_type';
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return EntityType::class;
|
||||
|
||||
@@ -35,6 +35,7 @@ class ActivityReasonRepository extends ServiceEntityRepository
|
||||
/**
|
||||
* @return ActivityReason[]
|
||||
*/
|
||||
#[\Override]
|
||||
public function findAll(): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('ar');
|
||||
|
||||
@@ -35,10 +35,9 @@ class ActivityRepository extends ServiceEntityRepository implements AssociatedEn
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use @see{ActivityACLAwareRepositoryInterface::findByAccompanyingPeriod}
|
||||
*
|
||||
* @return Activity[]
|
||||
*/
|
||||
#[\Deprecated(message: 'use @see{ActivityACLAwareRepositoryInterface::findByAccompanyingPeriod}')]
|
||||
public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $scopes, ?bool $allowNullScope = false, ?int $limit = 100, ?int $offset = 0, array $orderBy = ['date' => 'desc']): array
|
||||
{
|
||||
$qb = $this->createQueryBuilder('a');
|
||||
|
||||
@@ -20,9 +20,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
final public const LISTS = 'CHILL_ACTIVITY_LIST';
|
||||
final public const string LISTS = 'CHILL_ACTIVITY_LIST';
|
||||
|
||||
final public const STATS = 'CHILL_ACTIVITY_STATS';
|
||||
final public const string STATS = 'CHILL_ACTIVITY_STATS';
|
||||
|
||||
protected VoterHelperInterface $helper;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
*
|
||||
* It is safe for usage in template and controller
|
||||
*/
|
||||
final public const CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||
final public const string CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||
|
||||
/**
|
||||
* role to allow to create an activity associated win an accompanying course.
|
||||
@@ -41,7 +41,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE';
|
||||
final public const string CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE';
|
||||
|
||||
/**
|
||||
* role to allow to create an activity associated with a person.
|
||||
@@ -50,19 +50,19 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON';
|
||||
final public const string CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON';
|
||||
|
||||
final public const DELETE = 'CHILL_ACTIVITY_DELETE';
|
||||
final public const string DELETE = 'CHILL_ACTIVITY_DELETE';
|
||||
|
||||
final public const FULL = 'CHILL_ACTIVITY_FULL';
|
||||
final public const string FULL = 'CHILL_ACTIVITY_FULL';
|
||||
|
||||
final public const SEE = 'CHILL_ACTIVITY_SEE';
|
||||
final public const string SEE = 'CHILL_ACTIVITY_SEE';
|
||||
|
||||
final public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
||||
final public const string SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
||||
|
||||
final public const UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
||||
final public const string UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
||||
|
||||
private const ALL = [
|
||||
private const array ALL = [
|
||||
self::CREATE,
|
||||
self::SEE,
|
||||
self::UPDATE,
|
||||
|
||||
@@ -30,7 +30,7 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
final readonly class AccompanyingPeriodActivityGenericDocProvider implements GenericDocForAccompanyingPeriodProviderInterface, GenericDocForPersonProviderInterface
|
||||
{
|
||||
public const KEY = 'accompanying_period_activity_document';
|
||||
public const string KEY = 'accompanying_period_activity_document';
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $em,
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
final readonly class PersonActivityGenericDocProvider implements GenericDocForPersonProviderInterface
|
||||
{
|
||||
public const KEY = 'person_activity_document';
|
||||
public const string KEY = 'person_activity_document';
|
||||
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
|
||||
@@ -25,7 +25,7 @@ trait PrepareActivityTrait
|
||||
*/
|
||||
public function prepareActivity(Scope $scope, Person $person): Activity
|
||||
{
|
||||
return (new Activity())
|
||||
return new Activity()
|
||||
->setScope($scope)
|
||||
->setPerson($person);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ final class ActivityControllerTest extends WebTestCase
|
||||
$socialPermissionGroup = $em
|
||||
->getRepository(\Chill\MainBundle\Entity\PermissionsGroup::class)
|
||||
->findOneByName('social');
|
||||
$withoutActivityPermissionGroup = (new \Chill\MainBundle\Entity\PermissionsGroup())
|
||||
$withoutActivityPermissionGroup = new \Chill\MainBundle\Entity\PermissionsGroup()
|
||||
->setName('social without activity');
|
||||
// copy role scopes where ACTIVITY is not present
|
||||
foreach ($socialPermissionGroup->getRoleScopes() as $roleScope) {
|
||||
|
||||
@@ -30,6 +30,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
||||
*/
|
||||
private static $prophet;
|
||||
|
||||
#[\Override]
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
@@ -49,13 +50,14 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
||||
|
||||
protected function getEntityType(): \Symfony\Bridge\Doctrine\Form\Type\EntityType
|
||||
{
|
||||
$managerRegistry = (new \Prophecy\Prophet())->prophesize();
|
||||
$managerRegistry = new \Prophecy\Prophet()->prophesize();
|
||||
|
||||
$managerRegistry->willImplement('Doctrine\Common\Persistence\ManagerRegistry');
|
||||
|
||||
return new \Symfony\Bridge\Doctrine\Form\Type\EntityType($managerRegistry->reveal());
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function getExtensions()
|
||||
{
|
||||
$entityType = $this->getEntityType();
|
||||
|
||||
@@ -294,7 +294,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
|
||||
$period1->addPerson($person);
|
||||
$period2->addPerson($person);
|
||||
$period1->getParticipationsContainsPerson($person)->first()->setEndDate(
|
||||
(new \DateTime('now'))->add(new \DateInterval('P1M'))
|
||||
new \DateTime('now')->add(new \DateInterval('P1M'))
|
||||
);
|
||||
|
||||
if ([] === $types = $this->entityManager
|
||||
|
||||
@@ -68,7 +68,7 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
);
|
||||
|
||||
$query = $repository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$nb = $this->entityManager->getConnection()->fetchOne("SELECT COUNT(*) FROM ({$sql}) sq", $params, $types);
|
||||
|
||||
@@ -93,7 +93,7 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
|
||||
$query = $repository->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content);
|
||||
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$nb = $this->entityManager->getConnection()->fetchOne("SELECT COUNT(*) FROM ({$sql}) sq", $params, $types);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class TimelineActivityProvider implements TimelineProviderInterface
|
||||
{
|
||||
private const SUPPORTED_CONTEXTS = ['center', 'person'];
|
||||
private const array SUPPORTED_CONTEXTS = ['center', 'person'];
|
||||
|
||||
protected UserInterface $user;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ use Symfony\Component\Validator\Constraint;
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||
class ActivityValidity extends Constraint
|
||||
{
|
||||
final public const IS_REQUIRED_MESSAGE = ' is required';
|
||||
final public const string IS_REQUIRED_MESSAGE = ' is required';
|
||||
|
||||
final public const ROOT_MESSAGE = 'For this type of activity, ';
|
||||
final public const string ROOT_MESSAGE = 'For this type of activity, ';
|
||||
|
||||
public $noPersonsMessage = 'For this type of activity, you must add at least one person';
|
||||
|
||||
@@ -30,6 +30,7 @@ class ActivityValidity extends Constraint
|
||||
|
||||
public $socialIssuesMessage = 'For this type of activity, you must add at least one social issue';
|
||||
|
||||
#[\Override]
|
||||
public function getTargets(): string
|
||||
{
|
||||
return self::CLASS_CONSTRAINT;
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
class Version20150701091248 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
class Version20150702093317 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
class Version20150704091347 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
|
||||
@@ -22,6 +22,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
class Version20160222103457 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->abortIf(
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
class Version20161114085659 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE ActivityType DROP active');
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210304154629 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
@@ -28,6 +29,7 @@ final class Version20210304154629 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activity DROP comment_date');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210311114250 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210401090853 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
@@ -26,6 +27,7 @@ final class Version20210401090853 extends AbstractMigration
|
||||
$this->addSql('DROP TABLE activitytypecategory');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210408122329 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activitytype DROP personVisible');
|
||||
@@ -56,6 +57,7 @@ final class Version20210408122329 extends AbstractMigration
|
||||
$this->addSql('COMMENT ON COLUMN activitytype.name IS NULL');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210415113216 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activitytype ADD thirdpartyvisible SMALLINT DEFAULT 1 NOT NULL');
|
||||
@@ -31,6 +32,7 @@ final class Version20210415113216 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activitytype DROP documentsLabel');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210422073711 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activity DROP emergency');
|
||||
@@ -31,6 +32,7 @@ final class Version20210422073711 extends AbstractMigration
|
||||
$this->addSql('DROP TABLE activitytpresence');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210422123846 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TABLE activity_person');
|
||||
@@ -34,6 +35,7 @@ final class Version20210422123846 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activitytype DROP usersLabel');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210506071150 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activity ALTER durationTime SET NOT NULL');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210506090417 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activitytypecategory DROP ordering');
|
||||
|
||||
@@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210506094520 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activitytype DROP CONSTRAINT FK_B38CD05112469DE2');
|
||||
$this->addSql('ALTER TABLE activitytype DROP category_id');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210506112500 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
@@ -30,6 +31,7 @@ final class Version20210506112500 extends AbstractMigration
|
||||
$this->addSql('DROP TABLE activity_storedobject');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210520095626 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activity DROP CONSTRAINT FK_AC74095AD7FA8EF0');
|
||||
$this->addSql('ALTER TABLE activity DROP accompanyingPeriod_id');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210528161250 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TABLE chill_activity_activity_chill_person_socialissue');
|
||||
$this->addSql('DROP TABLE chill_activity_activity_chill_person_socialaction');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add socialIssues & socialActions fields to Activity';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210602103243 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activitytype DROP socialIssuesVisible');
|
||||
@@ -27,6 +28,7 @@ final class Version20210602103243 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activitytype DROP socialActionsLabel');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add info for socialIssues & socialActions in ActivityType';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20211119173555 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->throwIrreversibleMigrationException();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'remove comment on deprecated json_array type';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20211207152023 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->throwIrreversibleMigrationException('placevisible and placelabel could not be created');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'DROP place visible and place label, which are replaced by location';
|
||||
|
||||
@@ -16,12 +16,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20220425133027 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activitytype DROP privateCommentLabel');
|
||||
$this->addSql('ALTER TABLE activitytype DROP privateCommentVisible');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'add private comment option to activity types';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20220527124438 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP privateComment_comments');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'add private comment to activity';
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20221014130554 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activity DROP updatedAt');
|
||||
@@ -30,6 +31,7 @@ final class Version20221014130554 extends AbstractMigration
|
||||
$this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Track update and create on activity';
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240918142723 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Fix not null and default values for activityreason, activityreasoncategory, comments on activity';
|
||||
@@ -31,6 +32,7 @@ final class Version20240918142723 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activityreason ALTER name DROP DEFAULT');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20241202173942 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add a unique constraint on the storedobject linked to an activity';
|
||||
@@ -39,6 +40,7 @@ final class Version20241202173942 extends AbstractMigration
|
||||
$this->addSql('CREATE UNIQUE INDEX unique_storedobject_id ON activity_storedobject (storedobject_id)');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP INDEX IF EXISTS unique_storedobject_id');
|
||||
|
||||
@@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
*/
|
||||
class AsideActivityCategoryController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
/* @var QueryBuilder $query */
|
||||
|
||||
@@ -28,6 +28,7 @@ final class AsideActivityController extends CRUDController
|
||||
private readonly Security $security,
|
||||
) {}
|
||||
|
||||
#[\Override]
|
||||
public function createEntity(string $action, Request $request): object
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
@@ -59,6 +60,7 @@ final class AsideActivityController extends CRUDController
|
||||
return $asideActivity;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function buildQueryEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null)
|
||||
{
|
||||
$qb = parent::buildQueryEntities($action, $request);
|
||||
@@ -72,6 +74,7 @@ final class AsideActivityController extends CRUDController
|
||||
return $qb;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function orderQuery(
|
||||
string $action,
|
||||
$query,
|
||||
|
||||
@@ -46,7 +46,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||
->setType(
|
||||
$this->getReference('aside_activity_category_0', AsideActivityCategory::class)
|
||||
)
|
||||
->setDate((new \DateTimeImmutable('today'))
|
||||
->setDate(new \DateTimeImmutable('today')
|
||||
->sub(new \DateInterval('P'.\random_int(1, 100).'D')));
|
||||
|
||||
$manager->persist($activity);
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserJobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'aside_act_agg_user_job';
|
||||
private const string PREFIX = 'aside_act_agg_user_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByUserScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'aside_act_agg_user_scope';
|
||||
private const string PREFIX = 'aside_act_agg_user_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
class ByUserJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'aside_act_filter_user_job';
|
||||
private const string PREFIX = 'aside_act_filter_user_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
class ByUserScopeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'aside_act_filter_user_scope';
|
||||
private const string PREFIX = 'aside_act_filter_user_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -117,6 +117,7 @@ final class AsideActivityFormType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_asideactivitybundle_asideactivity';
|
||||
|
||||
@@ -44,6 +44,7 @@ final class PickAsideActivityCategoryType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): string
|
||||
{
|
||||
return EntityType::class;
|
||||
|
||||
@@ -30,6 +30,7 @@ final class AsideActivityRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, AsideActivity::class);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getClassName(): string
|
||||
{
|
||||
return AsideActivity::class;
|
||||
|
||||
@@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
final public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS';
|
||||
final public const string STATS = 'CHILL_ASIDE_ACTIVITY_STATS';
|
||||
|
||||
private readonly VoterHelperInterface $voterHelper;
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
*/
|
||||
final readonly class CategoryRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public const DEFAULT_ARGS = [
|
||||
public const array DEFAULT_ARGS = [
|
||||
self::SEPERATOR_KEY => ' > ',
|
||||
];
|
||||
|
||||
public const SEPERATOR_KEY = 'default.separator';
|
||||
public const string SEPERATOR_KEY = 'default.separator';
|
||||
|
||||
public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine) {}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ final class AsideActivityControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
#[\Override]
|
||||
protected function tearDown(): void
|
||||
{
|
||||
self::ensureKernelShutdown();
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210706124644 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
@@ -26,6 +27,7 @@ final class Version20210706124644 extends AbstractMigration
|
||||
$this->addSql('DROP TABLE AsideActivityType');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Aside activity category entity created';
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210804082249 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
@@ -41,6 +42,7 @@ final class Version20210804082249 extends AbstractMigration
|
||||
$this->addSql('DROP SCHEMA chill_asideactivity');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Aside activity entity created';
|
||||
|
||||
@@ -16,12 +16,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210806140343 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD duration INT DEFAULT NULL');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Duration changed to type integer';
|
||||
|
||||
@@ -16,12 +16,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210806140710 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP duration');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Duration changed back to timestamp';
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210810084456 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
@@ -30,6 +31,7 @@ final class Version20210810084456 extends AbstractMigration
|
||||
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.date IS \'(DC2Type:datetime_immutable)\'');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'createdat, updatedat and date given a type timestamp';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210922182907 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivityCategory DROP parent');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Parent and children added to aside activity category entity';
|
||||
|
||||
@@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20211004134012 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_asideactivity.asideactivitycategory DROP ordering');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'allow to add an ordering to aside activity categories';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20230816112809 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Update location attribute in asideactivity';
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP INDEX chill_asideactivity.IDX_A866DA0E64D218E');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user