mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
php cs fixes
This commit is contained in:
parent
2da6b746fb
commit
59f9ac25ba
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Chill\MainBundle\Repository\GenderRepository;
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
enum GenderEnum: string
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
enum GenderIconEnum: string
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\Gender;
|
||||
@ -10,7 +19,6 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EnumType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@ -22,12 +30,6 @@ class GenderType extends AbstractType
|
||||
->add('label', TranslatableStringFormType::class, [
|
||||
'required' => true,
|
||||
])
|
||||
/* ->add('icon', EnumType::class, [
|
||||
'class' => GenderIconEnum::class,
|
||||
'label_html' => true,
|
||||
'expanded' => false,
|
||||
'mapped' => true,
|
||||
])*/
|
||||
->add('icon', ChoiceType::class, [
|
||||
'choices' => GenderIconEnum::cases(),
|
||||
'expanded' => true,
|
||||
@ -40,6 +42,7 @@ class GenderType extends AbstractType
|
||||
])
|
||||
->add('genderTranslation', EnumType::class, [
|
||||
'class' => GenderEnum::class,
|
||||
'choice_label' => fn (GenderEnum $enum) => $enum->value,
|
||||
'label' => 'gender.admin.Select Gender Translation',
|
||||
])
|
||||
->add('active', ChoiceType::class, [
|
||||
|
@ -1,15 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Repository;
|
||||
|
||||
use Chill\MainBundle\Entity\Gender;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
use UnexpectedValueException;
|
||||
|
||||
class GenderRepository extends ServiceEntityRepository {
|
||||
class GenderRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Gender::class);
|
||||
|
@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Templating\Entity;
|
||||
|
||||
use Chill\MainBundle\Entity\GenderIconEnum;
|
||||
use Chill\MainBundle\Entity\NewsItem;
|
||||
|
||||
/**
|
||||
* @implements ChillEntityRenderInterface<GenderIconEnum>
|
||||
@ -21,8 +20,7 @@ final readonly class ChillGenderIconRender implements ChillEntityRenderInterface
|
||||
{
|
||||
public function renderBox($icon, array $options): string
|
||||
{
|
||||
return
|
||||
'<i class="'. $icon->value .'"></i>';
|
||||
return '<i class="'.$icon->value.'"></i>';
|
||||
}
|
||||
|
||||
public function renderString($icon, array $options): string
|
||||
|
@ -2,6 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -15,6 +15,7 @@ use Chill\MainBundle\DataFixtures\ORM\LoadPostalCodes;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Country;
|
||||
use Chill\MainBundle\Entity\GenderEnum;
|
||||
use Chill\MainBundle\Entity\PostalCode;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
@ -81,7 +82,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
|
||||
|
||||
protected NativeLoader $loader;
|
||||
|
||||
private array $genders = [Person::MALE_GENDER, Person::FEMALE_GENDER, Person::BOTH_GENDER];
|
||||
private array $genders = [GenderEnum::MALE, GenderEnum::FEMALE, GenderEnum::NEUTRAL];
|
||||
|
||||
private array $peoples = [
|
||||
[
|
||||
@ -90,7 +91,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
|
||||
'birthdate' => '1948-12-27',
|
||||
'placeOfBirth' => 'Châteauroux',
|
||||
'nationality' => 'RU',
|
||||
'gender' => Person::MALE_GENDER,
|
||||
'gender' => GenderEnum::MALE,
|
||||
'center' => 'Center A',
|
||||
'accompanyingPeriods' => [
|
||||
[
|
||||
@ -131,7 +132,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
|
||||
'lastName' => 'Depardieu',
|
||||
'firstName' => 'Charline',
|
||||
'birthdate' => '1970-10-15',
|
||||
'gender' => Person::FEMALE_GENDER,
|
||||
'gender' => GenderEnum::FEMALE,
|
||||
'center' => 'Center A',
|
||||
'maritalStatus' => 'ms_legalco',
|
||||
],
|
||||
|
@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Export\Aggregator\PersonAggregators;
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\MainBundle\Repository\GenderRepository;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
@ -12,17 +12,13 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Export\Filter\PersonFilters;
|
||||
|
||||
use Chill\MainBundle\Entity\Gender;
|
||||
use Chill\MainBundle\Entity\GenderEnum;
|
||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\Query\Expr;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EnumType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
@ -31,9 +27,7 @@ class GenderFilter implements
|
||||
ExportElementValidatedInterface,
|
||||
FilterInterface
|
||||
{
|
||||
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
}
|
||||
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -92,7 +86,7 @@ class GenderFilter implements
|
||||
if ('null' === $g) {
|
||||
$genders[] = $this->translator->trans('Not given');
|
||||
} else {
|
||||
$genders[] = $this->translatableStringHelper($g->getLabel());
|
||||
$genders[] = $this->translatableStringHelper->localize($g->getLabel());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,12 +13,10 @@ namespace Chill\PersonBundle\Form\Type;
|
||||
|
||||
use Chill\MainBundle\Entity\Gender;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
|
@ -2,6 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\Migrations\Person;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
Loading…
x
Reference in New Issue
Block a user