php csfixes

This commit is contained in:
Julie Lenaerts 2022-11-02 10:28:52 +01:00 committed by Julien Fastré
parent fc2f8d33e1
commit eeb84d5cfb
26 changed files with 64 additions and 60 deletions

View File

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

View File

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
/** /*
* Chill is a software for social workers * Chill is a software for social workers
* *
* For the full copyright and license information, please view * For the full copyright and license information, please view
@ -11,9 +11,10 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
class SentReceivedAggregator implements AggregatorInterface class SentReceivedAggregator implements AggregatorInterface
@ -41,10 +42,11 @@ class SentReceivedAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return static function ($value): string {
if ('_header' === $value) { if ('_header' === $value) {
return ''; return '';
} }
switch ($value) { switch ($value) {
case 'sent': case 'sent':
return 'is sent'; return 'is sent';
@ -53,7 +55,7 @@ class SentReceivedAggregator implements AggregatorInterface
return 'is received'; return 'is received';
default: 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\ActivityBundle\Entity\Activity;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\Query\Expr; use function in_array;
class HasNoActivityFilter implements FilterInterface class HasNoActivityFilter implements FilterInterface
{ {

View File

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
/** /*
* Chill is a software for social workers * Chill is a software for social workers
* *
* For the full copyright and license information, please view * For the full copyright and license information, please view
@ -11,8 +11,8 @@ declare(strict_types=1);
namespace Chill\AsideActivityBundle\Export\Aggregator; namespace Chill\AsideActivityBundle\Export\Aggregator;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\AsideActivityBundle\Export\Declarations; use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -41,7 +41,7 @@ class ByActivityTypeAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return static function ($value): string {
if ('_header' === $value) { if ('_header' === $value) {
return ''; return '';
} }

View File

@ -11,14 +11,14 @@ declare(strict_types=1);
namespace Chill\AsideActivityBundle\Export\Export; namespace Chill\AsideActivityBundle\Export\Export;
use Chill\AsideActivityBundle\Export\Declarations;
use Chill\AsideActivityBundle\Repository\AsideActivityRepository; use Chill\AsideActivityBundle\Repository\AsideActivityRepository;
use Chill\MainBundle\Export\ExportInterface; use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FormatterInterface; use Chill\MainBundle\Export\FormatterInterface;
use Chill\MainBundle\Export\GroupedExportInterface; use Chill\MainBundle\Export\GroupedExportInterface;
use Chill\AsideActivityBundle\Export\Declarations;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\Query; use Doctrine\ORM\Query;
use LogicException; use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
class CountAsideActivity implements ExportInterface, GroupedExportInterface class CountAsideActivity implements ExportInterface, GroupedExportInterface
{ {
@ -105,7 +105,3 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface
return []; return [];
} }
} }

View File

@ -11,8 +11,8 @@ declare(strict_types=1);
namespace Chill\AsideActivityBundle\Export\Filter; namespace Chill\AsideActivityBundle\Export\Filter;
use Chill\MainBundle\Export\FilterInterface;
use Chill\AsideActivityBundle\Export\Declarations; use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;

View File

@ -11,8 +11,8 @@ declare(strict_types=1);
namespace Chill\AsideActivityBundle\Export\Filter; namespace Chill\AsideActivityBundle\Export\Filter;
use Chill\MainBundle\Export\FilterInterface;
use Chill\AsideActivityBundle\Export\Declarations; use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;

View File

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

View File

@ -18,6 +18,7 @@ use Chill\PersonBundle\Entity\Household\HouseholdComposition;
use Chill\PersonBundle\Entity\Household\HouseholdMember; use Chill\PersonBundle\Entity\Household\HouseholdMember;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Repository\Household\HouseholdCompositionTypeRepositoryInterface; use Chill\PersonBundle\Repository\Household\HouseholdCompositionTypeRepositoryInterface;
use DateTimeImmutable;
use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -96,7 +97,7 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface
$builder->add('date_calc', ChillDateType::class, [ $builder->add('date_calc', ChillDateType::class, [
'label' => 'export.aggregator.course.by_household_composition.Calc date', 'label' => 'export.aggregator.course.by_household_composition.Calc date',
'input_format' => 'datetime_immutable', 'input_format' => 'datetime_immutable',
'data' => new \DateTimeImmutable('now'), 'data' => new DateTimeImmutable('now'),
]); ]);
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
/** /*
* Chill is a software for social workers * Chill is a software for social workers
* *
* For the full copyright and license information, please view * 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\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
class HavingEndDateAggregator implements AggregatorInterface class HavingEndDateAggregator implements AggregatorInterface
@ -45,10 +46,11 @@ class HavingEndDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return static function ($value): string {
if ('_header' === $value) { if ('_header' === $value) {
return ''; return '';
} }
switch ($value) { switch ($value) {
case true: case true:
return 'enddate is specified'; return 'enddate is specified';
@ -57,9 +59,8 @@ class HavingEndDateAggregator implements AggregatorInterface
return 'enddate is not specified'; return 'enddate is not specified';
default: 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); declare(strict_types=1);
/** /*
* Chill is a software for social workers * Chill is a software for social workers
* *
* For the full copyright and license information, please view * 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\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
class CurrentActionAggregator implements AggregatorInterface class CurrentActionAggregator implements AggregatorInterface
@ -45,10 +46,11 @@ class CurrentActionAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)
{ {
return function ($value): string { return static function ($value): string {
if ('_header' === $value) { if ('_header' === $value) {
return ''; return '';
} }
switch ($value) { switch ($value) {
case true: case true:
return 'Current action'; return 'Current action';
@ -57,7 +59,7 @@ class CurrentActionAggregator implements AggregatorInterface
return 'Not current action'; return 'Not current action';
default: 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

@ -15,6 +15,7 @@ use Chill\MainBundle\Export\FilterInterface;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use function in_array;
class HasNoActionFilter implements FilterInterface class HasNoActionFilter implements FilterInterface
{ {

View File

@ -15,10 +15,10 @@ use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\PersonBundle\Entity\AccompanyingPeriod\UserHistory; use Chill\PersonBundle\Entity\AccompanyingPeriod\UserHistory;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use DateTime;
class HasNoReferrerFilter implements FilterInterface class HasNoReferrerFilter implements FilterInterface
{ {

View File

@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\EvaluationFilters;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use DateTime;
class ByEndDateFilter implements FilterInterface class ByEndDateFilter implements FilterInterface
{ {

View File

@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\EvaluationFilters;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use DateTime;
class ByStartDateFilter implements FilterInterface class ByStartDateFilter implements FilterInterface
{ {