fix code style

This commit is contained in:
Julien Fastré 2022-11-02 11:12:55 +01:00
parent c20b561de5
commit 8d4ec5d675
24 changed files with 56 additions and 53 deletions

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class ByActivityNumberAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -11,9 +11,10 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class SentReceivedAggregator implements AggregatorInterface
@ -41,10 +42,11 @@ class SentReceivedAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}
switch ($value) {
case 'sent':
return 'is sent';
@ -53,7 +55,7 @@ class SentReceivedAggregator implements AggregatorInterface
return 'is received';
default:
throw new \LogicException(sprintf('The value %s is not valid', $value));
throw new LogicException(sprintf('The value %s is not valid', $value));
}
};
}

View File

@ -14,9 +14,10 @@ namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\Export\FilterInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\Query\Expr;
use function in_array;
class HasNoActivityFilter implements FilterInterface
{
@ -36,7 +37,7 @@ class HasNoActivityFilter implements FilterInterface
//TODO check this:
->andWhere('
NOT EXISTS (
SELECT 1 FROM '. Activity::class .' activity
SELECT 1 FROM ' . Activity::class . ' activity
WHERE activity.accompanyingPeriod = acp
)
');
@ -61,4 +62,4 @@ class HasNoActivityFilter implements FilterInterface
{
return 'Filter acp which has no activity';
}
}
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class ByActivityTypeAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -17,4 +17,4 @@ namespace ChillAsideActivityBundle\Export;
abstract class Declarations
{
public const ASIDE_ACTIVITY_TYPE = 'aside_activity';
}
}

View File

@ -16,9 +16,9 @@ use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FormatterInterface;
use Chill\MainBundle\Export\GroupedExportInterface;
use ChillAsideActivityBundle\Export\Declarations;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class CountAsideActivity implements ExportInterface, GroupedExportInterface
{
@ -105,7 +105,3 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface
return [];
}
}

View File

@ -52,4 +52,4 @@ class ByActivityTypeFilter implements FilterInterface
{
return 'Filter by aside activity type';
}
}
}

View File

@ -52,4 +52,4 @@ class ByDateFilter implements FilterInterface
{
return 'Filter by aside activity date';
}
}
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class ByActionNumberAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class CreatorJobAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class ByEndDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class ByMaxDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -41,7 +41,7 @@ class ByStartDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Aggregator\EvaluationAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class HavingEndDateAggregator implements AggregatorInterface
@ -45,10 +46,11 @@ class HavingEndDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}
switch ($value) {
case true:
return 'enddate is specified';
@ -57,9 +59,8 @@ class HavingEndDateAggregator implements AggregatorInterface
return 'enddate is not specified';
default:
throw new \LogicException(sprintf('The value %s is not valid', $value));
throw new LogicException(sprintf('The value %s is not valid', $value));
}
};
}

View File

@ -2,7 +2,7 @@
declare(strict_types=1);
/**
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class CurrentActionAggregator implements AggregatorInterface
@ -27,7 +28,7 @@ class CurrentActionAggregator implements AggregatorInterface
{
$qb
->addSelect('
(CASE true WHEN acpw.startDate IS NULL ELSE false END)
(CASE true WHEN acpw.startDate IS NULL ELSE false END)
AS acpw_current_action_aggregator
')
->addGroupBy('acpw_current_action_aggregator');
@ -45,10 +46,11 @@ class CurrentActionAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return function ($value): string {
return static function ($value): string {
if ('_header' === $value) {
return '';
}
switch ($value) {
case true:
return 'Current action';
@ -57,7 +59,7 @@ class CurrentActionAggregator implements AggregatorInterface
return 'Not current action';
default:
throw new \LogicException(sprintf('The value %s is not valid', $value));
throw new LogicException(sprintf('The value %s is not valid', $value));
}
};
}

View File

@ -52,4 +52,4 @@ class CreatorFilter implements FilterInterface
{
return 'Filter by creator';
}
}
}

View File

@ -52,4 +52,4 @@ class CreatorJobFilter implements FilterInterface
{
return 'Filter by creator job';
}
}
}

View File

@ -15,6 +15,7 @@ use Chill\MainBundle\Export\FilterInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use function in_array;
class HasNoActionFilter implements FilterInterface
{
@ -51,4 +52,4 @@ class HasNoActionFilter implements FilterInterface
{
return 'Filter by which has no action';
}
}
}

View File

@ -15,10 +15,10 @@ use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\PersonBundle\Entity\AccompanyingPeriod\UserHistory;
use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use DateTime;
class HasNoReferrerFilter implements FilterInterface
{
@ -32,12 +32,12 @@ class HasNoReferrerFilter implements FilterInterface
$qb
->andWhere('
NOT EXISTS (
SELECT 1 FROM '. UserHistory::class .' uh
WHERE uh.startDate < :date
SELECT 1 FROM ' . UserHistory::class . ' uh
WHERE uh.startDate < :date
AND (
uh.endDate IS NULL
uh.endDate IS NULL
or uh.endDate > :date
)
)
AND uh.accompanyingPeriod = acp
)
')
@ -69,4 +69,4 @@ class HasNoReferrerFilter implements FilterInterface
{
return 'Filter by which has no referrer';
}
}
}

View File

@ -52,4 +52,4 @@ class HasTemporaryLocationFilter implements FilterInterface
{
return 'Filter by temporary location';
}
}
}

View File

@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\EvaluationFilters;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use DateTime;
class ByEndDateFilter implements FilterInterface
{
@ -64,4 +64,4 @@ class ByEndDateFilter implements FilterInterface
{
return 'Filter by end date evaluations';
}
}
}

View File

@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\EvaluationFilters;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use DateTime;
class ByStartDateFilter implements FilterInterface
{
@ -64,4 +64,4 @@ class ByStartDateFilter implements FilterInterface
{
return 'Filter by start date evaluations';
}
}
}

View File

@ -47,4 +47,4 @@ class CurrentEvaluationsFilter implements FilterInterface
{
return 'Filter by current evaluations';
}
}
}

View File

@ -47,4 +47,4 @@ class CurrentActionFilter implements FilterInterface
{
return 'Filter by current actions';
}
}
}