This commit is contained in:
2022-10-05 15:23:28 +02:00
parent 58b1778544
commit a967e1ed17
194 changed files with 1580 additions and 1386 deletions

View File

@@ -13,7 +13,6 @@ namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use DateTime;
use Doctrine\ORM\QueryBuilder;
use RuntimeException;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
@@ -50,14 +49,17 @@ class DateAggregator implements AggregatorInterface
switch ($data['frequency']) {
case 'month':
$fmt = 'YYYY-MM';
break;
case 'week':
$fmt = 'YYYY-IW';
break;
case 'year':
$fmt = 'YYYY'; $order = 'DESC';
break; // order DESC does not works !
default:
@@ -98,7 +100,6 @@ class DateAggregator implements AggregatorInterface
switch ($data['frequency']) {
case 'month':
case 'week':
//return $this->translator->trans('for week') .' '. $value ;

View File

@@ -16,7 +16,6 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Closure;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use function in_array;

View File

@@ -61,7 +61,7 @@ class ActivityUserAggregator implements AggregatorInterface
public function getLabels($key, $values, $data): Closure
{
return function ($value) {
return function ($value) {
if ('_header' === $value) {
return 'Activity user';
}

View File

@@ -25,8 +25,8 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function array_key_exists;
use function count;
use function in_array;
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
{
@@ -67,7 +67,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
$qb->addSelect($elem . ' as ' . $alias);
// make a jointure only if needed
if (!in_array( 'actreasons', $qb->getAllAliases(), true)) {
if (!in_array('actreasons', $qb->getAllAliases(), true)) {
$qb->innerJoin('activity.reasons', 'actreasons');
}

View File

@@ -23,6 +23,7 @@ use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class AvgActivityDuration implements ExportInterface, GroupedExportInterface
@@ -57,7 +58,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
public function getLabels($key, array $values, $data)
{
if ('export_avg_activity_duration' !== $key) {
throw new \LogicException("the key {$key} is not used by this export");
throw new LogicException("the key {$key} is not used by this export");
}
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
@@ -99,14 +100,13 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
$qb
->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part
JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
'
)
)
->setParameter('authorized_centers', $centers)
;
->setParameter('authorized_centers', $centers);
return $qb;
}

View File

@@ -23,6 +23,7 @@ use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterface
@@ -58,7 +59,7 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
public function getLabels($key, array $values, $data)
{
if ('export_avg_activity_visit_duration' !== $key) {
throw new \LogicException("the key {$key} is not used by this export");
throw new LogicException("the key {$key} is not used by this export");
}
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
@@ -95,20 +96,18 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
$qb
->join('activity.accompanyingPeriod', 'acp')
->select('AVG(activity.travelTime) as export_avg_activity_visit_duration')
->andWhere($qb->expr()->isNotNull('activity.travelTime'))
;
->andWhere($qb->expr()->isNotNull('activity.travelTime'));
$qb
->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part
JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
'
)
)
->setParameter('authorized_centers', $centers)
;
->setParameter('authorized_centers', $centers);
return $qb;
}

View File

@@ -97,14 +97,13 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$qb
->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part
JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
'
)
)
->setParameter('authorized_centers', $centers)
;
->setParameter('authorized_centers', $centers);
$qb->select('COUNT(DISTINCT activity.id) as export_count_activity');

View File

@@ -23,6 +23,7 @@ use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class SumActivityDuration implements ExportInterface, GroupedExportInterface
@@ -58,7 +59,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
public function getLabels($key, array $values, $data)
{
if ('export_sum_activity_duration' !== $key) {
throw new \LogicException("the key {$key} is not used by this export");
throw new LogicException("the key {$key} is not used by this export");
}
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
@@ -100,14 +101,13 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
$qb
->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part
JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
'
)
)
->setParameter('authorized_centers', $centers)
;
->setParameter('authorized_centers', $centers);
return $qb;
}

View File

@@ -23,6 +23,7 @@ use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class SumActivityVisitDuration implements ExportInterface, GroupedExportInterface
@@ -58,7 +59,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
public function getLabels($key, array $values, $data)
{
if ('export_sum_activity_visit_duration' !== $key) {
throw new \LogicException("the key {$key} is not used by this export");
throw new LogicException("the key {$key} is not used by this export");
}
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
@@ -100,14 +101,13 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
$qb
->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part
JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
'
)
)
->setParameter('authorized_centers', $centers)
;
->setParameter('authorized_centers', $centers);
return $qb;
}

View File

@@ -87,8 +87,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$qb = $this->activityRepository
->createQueryBuilder('activity')
->join('activity.person', 'person')
->join('person.centerHistory', 'centerHistory')
;
->join('person.centerHistory', 'centerHistory');
$qb->select('COUNT(activity.id) as export_count_activity');

View File

@@ -18,10 +18,10 @@ use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Andx;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use function in_array;
class ActivityTypeFilter implements FilterInterface
{

View File

@@ -17,8 +17,6 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -79,8 +77,8 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
'multiple' => true,
'expanded' => false,
'attr' => [
'class' => 'select2'
]
'class' => 'select2',
],
]);
}

View File

@@ -19,14 +19,13 @@ use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function array_key_exists;
use function count;
use function in_array;
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
{

View File

@@ -14,11 +14,8 @@ namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class TranslatableActivityType extends AbstractType

View File

@@ -12,11 +12,8 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityType;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use UnexpectedValueException;
final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
{
@@ -24,15 +21,7 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
public function __construct(EntityManagerInterface $em)
{
$this->repository = $em->getRepository(ActivityType::class);
}
/**
* @return array|ActivityType[]
*/
public function findAllActive(): array
{
return $this->findBy(['active' => true]);
$this->repository = $em->getRepository(ActivityType::class);
}
public function find($id): ?ActivityType
@@ -48,6 +37,14 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
return $this->repository->findAll();
}
/**
* @return array|ActivityType[]
*/
public function findAllActive(): array
{
return $this->findBy(['active' => true]);
}
/**
* @return array|ActivityType[]
*/
@@ -65,6 +62,4 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
{
return ActivityType::class;
}
}

View File

@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityType;
@@ -11,5 +20,4 @@ interface ActivityTypeRepositoryInterface extends ObjectRepository
* @return array|ActivityType[]
*/
public function findAllActive(): array;
}
}

View File

@@ -49,16 +49,16 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
return $this->getAttributes();
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
return $this->helper->voteOnAttribute($attribute, $subject, $token);
}
protected function supports($attribute, $subject)
{
return $this->helper->supports($attribute, $subject);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
return $this->helper->voteOnAttribute($attribute, $subject, $token);
}
private function getAttributes()
{
return [self::STATS, self::LISTS];

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialActionAggregat
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class BySocialActionAggregatorTest extends AbstractAggregatorTest
{
private BySocialActionAggregator $aggregator;
@@ -52,8 +56,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
->join('activity.socialActions', 'actsocialaction')
,
->join('activity.socialActions', 'actsocialaction'),
];
}
}

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialIssueAggregato
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
{
private BySocialIssueAggregator $aggregator;
@@ -52,8 +56,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
->join('activity.socialIssues', 'actsocialissue')
,
->join('activity.socialIssues', 'actsocialissue'),
];
}
}

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByThirdpartyAggregator
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
{
private ByThirdpartyAggregator $aggregator;
@@ -52,8 +56,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
->join('activity.thirdParties', 'acttparty')
,
->join('activity.thirdParties', 'acttparty'),
];
}
}

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByUserAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class ByUserAggregatorTest extends AbstractAggregatorTest
{
private ByUserAggregator $aggregator;
@@ -52,8 +56,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
->join('activity.users', 'actusers')
,
->join('activity.users', 'actusers'),
];
}
}

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\DateAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class DateAggregatorTest extends AbstractAggregatorTest
{
private DateAggregator $aggregator;
@@ -43,7 +47,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
],
[
'frequency' => 'year',
]
],
];
}
@@ -59,8 +63,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
$em->createQueryBuilder()
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
,
->join('activity.accompanyingPeriod', 'acp'),
];
}
}

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\LocationTypeAggregator
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class LocationTypeAggregatorTest extends AbstractAggregatorTest
{
private LocationTypeAggregator $aggregator;
@@ -52,8 +56,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
->join('activity.location', 'actloc')
,
->join('activity.location', 'actloc'),
];
}
}

View File

@@ -16,6 +16,10 @@ use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\UserScopeAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
* @coversNothing
*/
final class UserScopeAggregatorTest extends AbstractAggregatorTest
{
private UserScopeAggregator $aggregator;
@@ -52,8 +56,7 @@ final class UserScopeAggregatorTest extends AbstractAggregatorTest
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'acp')
->join('activity.user', 'actuser')
,
->join('activity.user', 'actuser'),
];
}
}

View File

@@ -11,16 +11,19 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Aggregator\PersonAggregators;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface;
use Prophecy\PhpUnit\ProphecyTrait;
/**
* @internal
* @coversNothing
*/
final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
{
use ProphecyTrait;
private ActivityReasonAggregator $aggregator;
protected function setUp(): void
@@ -33,7 +36,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get('request_stack')
->push($request->reveal());
}

View File

@@ -22,7 +22,7 @@ use Prophecy\PhpUnit\ProphecyTrait;
final class ListActivityTest extends AbstractExportTest
{
use ProphecyTrait;
private ListActivity $export;
protected function setUp(): void

View File

@@ -53,7 +53,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_activitytypes' => $a
'accepted_activitytypes' => $a,
];
}

View File

@@ -51,7 +51,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_socialactions' => $a
'accepted_socialactions' => $a,
];
}

View File

@@ -51,7 +51,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_socialissues' => $a
'accepted_socialissues' => $a,
];
}
@@ -70,8 +70,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
$em->createQueryBuilder()
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.socialIssues', 'actsocialissue')
,
->join('activity.socialIssues', 'actsocialissue'),
];
}
}

View File

@@ -51,7 +51,7 @@ final class ByUserFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_users' => $a
'accepted_users' => $a,
];
}

View File

@@ -39,8 +39,8 @@ final class EmergencyFilterTest extends AbstractFilterTest
public function getFormData(): array
{
return [
['accepted_emergency' => true ],
['accepted_emergency' => false ],
['accepted_emergency' => true],
['accepted_emergency' => false],
];
}

View File

@@ -51,7 +51,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_locationtype' => $a
'accepted_locationtype' => $a,
];
}

View File

@@ -39,8 +39,8 @@ final class SentReceivedFilterTest extends AbstractFilterTest
public function getFormData(): array
{
return [
['accepted_sentreceived' => Activity::SENTRECEIVED_SENT ],
['accepted_sentreceived' => Activity::SENTRECEIVED_RECEIVED ]
['accepted_sentreceived' => Activity::SENTRECEIVED_SENT],
['accepted_sentreceived' => Activity::SENTRECEIVED_RECEIVED],
];
}

View File

@@ -51,7 +51,7 @@ final class UserFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_users' => $a
'accepted_users' => $a,
];
}

View File

@@ -51,7 +51,7 @@ final class UserScopeFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'accepted_userscope' => $a
'accepted_userscope' => $a,
];
}

View File

@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Tests\Export\Filter;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\ActivityDateFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
/**
@@ -40,9 +41,9 @@ final class ActivityDateFilterTest extends AbstractFilterTest
{
return [
[
'date_from' => \DateTime::createFromFormat('Y-m-d', '2020-01-01'),
'date_to' => \DateTime::createFromFormat('Y-m-d', '2021-01-01'),
]
'date_from' => DateTime::createFromFormat('Y-m-d', '2020-01-01'),
'date_to' => DateTime::createFromFormat('Y-m-d', '2021-01-01'),
],
];
}

View File

@@ -23,7 +23,7 @@ use Prophecy\PhpUnit\ProphecyTrait;
final class ActivityReasonFilterTest extends AbstractFilterTest
{
use ProphecyTrait;
private ActivityReasonFilter $filter;
protected function setUp(): void
@@ -34,7 +34,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get('request_stack')

View File

@@ -51,7 +51,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'types' => $a
'types' => $a,
];
}

View File

@@ -51,7 +51,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'reasons' => $a
'reasons' => $a,
];
}

View File

@@ -15,6 +15,7 @@ use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Export\Filter\PersonFilters\PersonHavingActivityBetweenDateFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
/**
@@ -51,9 +52,9 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
foreach ($array as $a) {
$data[] = [
'date_from' => \DateTime::createFromFormat('Y-m-d', '2021-07-01'),
'date_to' => \DateTime::createFromFormat('Y-m-d', '2022-07-01'),
'reasons' => $a
'date_from' => DateTime::createFromFormat('Y-m-d', '2021-07-01'),
'date_to' => DateTime::createFromFormat('Y-m-d', '2022-07-01'),
'reasons' => $a,
];
}