apply rector rules

This commit is contained in:
2023-07-28 02:40:02 +02:00
parent 157cdf6dfc
commit f570fe92a5
112 changed files with 252 additions and 562 deletions

View File

@@ -25,7 +25,7 @@ class LoadAccompanyingPeriodOrigin extends AbstractFixture implements OrderedFix
public static $references = [];
private $phoneCall = ['en' => 'phone call', 'fr' => 'appel téléphonique'];
private array $phoneCall = ['en' => 'phone call', 'fr' => 'appel téléphonique'];
public function getOrder()
{

View File

@@ -32,9 +32,9 @@ use Twig\Environment;
class LoadCustomFields extends AbstractFixture implements
OrderedFixtureInterface
{
private $cfText;
private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfText = null;
private $cfChoice;
private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfChoice = null;
/**
/**

View File

@@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectManager;
*/
class LoadMaritalStatus extends AbstractFixture implements OrderedFixtureInterface
{
private $maritalStatuses = [
private array $maritalStatuses = [
['id' => 'single', 'name' => ['en' => 'single', 'fr' => 'célibataire']],
['id' => 'married', 'name' => ['en' => 'married', 'fr' => 'marié(e)']],
['id' => 'widow', 'name' => ['en' => 'widow', 'fr' => 'veuf veuve ']],

View File

@@ -90,9 +90,9 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
protected NativeLoader $loader;
private $genders = [Person::MALE_GENDER, Person::FEMALE_GENDER, Person::BOTH_GENDER];
private array $genders = [Person::MALE_GENDER, Person::FEMALE_GENDER, Person::BOTH_GENDER];
private $peoples = [
private array $peoples = [
[
'lastName' => 'Depardieu',
'firstName' => 'Gérard',

View File

@@ -23,7 +23,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
*/
class Configuration implements ConfigurationInterface
{
private $validationBirthdateNotAfterInfos = 'The period before today during which'
private string $validationBirthdateNotAfterInfos = 'The period before today during which'
. ' any birthdate is not allowed. The birthdate is expressed as ISO8601 : '
. 'https://en.wikipedia.org/wiki/ISO_8601#Durations';

View File

@@ -40,20 +40,14 @@ abstract class AddressPart extends FunctionNode
'country_id',
];
/**
* @var \Doctrine\ORM\Query\AST\Node
*/
private $date;
private \Doctrine\ORM\Query\AST\Node|string|null $date = null;
/**
* @var \Doctrine\ORM\Query\AST\Node
*/
private $part;
/**
* @var \Doctrine\ORM\Query\AST\Node
*/
private $pid;
private ?\Doctrine\ORM\Query\AST\PathExpression $pid = null;
/**
* return the part of the address.

View File

@@ -226,12 +226,11 @@ class AccompanyingPeriod implements
private ?int $id = null;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
* @Groups({"read"})
* @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CONFIRMED})
*/
private $intensity = self::INTENSITY_OCCASIONAL;
private string $intensity = self::INTENSITY_OCCASIONAL;
/**
* @ORM\ManyToOne(
@@ -597,8 +596,6 @@ class AccompanyingPeriod implements
*
* Search for the person's participation and set the end date at
* 'now'.
*
* @param mixed $person
*/
public function closeParticipationFor(mixed $person): ?AccompanyingPeriodParticipation
{
@@ -1241,7 +1238,6 @@ class AccompanyingPeriod implements
*
* For closing a Person file, you should use Person::setClosed instead.
*
* @param mixed $closingDate
*
* @return AccompanyingPeriod
*/

View File

@@ -34,7 +34,7 @@ class AccompanyingPeriodWorkGoal
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriodWork::class, inversedBy="goals")
*/
private $accompanyingPeriodWork;
private ?\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork $accompanyingPeriodWork = null;
/**
* @ORM\ManyToOne(targetEntity=Goal::class)

View File

@@ -216,54 +216,49 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* Array where customfield's data are stored.
*
* @var array
*
* @ORM\Column(type="json")
*/
private $cFData;
private ?array $cFData = null;
/**
* The marital status of the person.
*
* @var Civility
*
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Civility")
* @ORM\JoinColumn(nullable=true)
*/
private $civility;
private ?\Chill\MainBundle\Entity\Civility $civility = null;
/**
* Contact information for contacting the person.
*
* @var string
*
* @ORM\Column(type="text", nullable=true)
*/
private $contactInfo = '';
private string $contactInfo = '';
/**
* The person's country of birth.
*
* @var Country
*
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Country")
*
* sf4 check: option inversedBy="birthsIn" return error mapping !!
*
* @ORM\JoinColumn(nullable=true)
*/
private $countryOfBirth;
private ?\Chill\MainBundle\Entity\Country $countryOfBirth = null;
/**
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
*/
private $createdAt;
private ?\DateTimeInterface $createdAt = null;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=true)
*/
private $createdBy;
private ?\Chill\MainBundle\Entity\User $createdBy = null;
/**
* Cache the computation of household.
@@ -299,14 +294,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's email.
*
* @var string
*
* @ORM\Column(type="text", nullable=true)
* @Assert\Email(
* checkMX=true
* )
*/
private $email = '';
private string $email = '';
/**
* The person's first name.
@@ -330,12 +324,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's gender.
*
* @var string
*
* @ORM\Column(type="string", length=9, nullable=true)
* @Assert\NotNull(message="The gender must be set")
*/
private $gender;
private ?string $gender = null;
/**
* Comment on gender.
@@ -388,12 +381,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The marital status of the person.
*
* @var MaritalStatus
*
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\MaritalStatus")
* @ORM\JoinColumn(nullable=true)
*/
private $maritalStatus;
private ?\Chill\PersonBundle\Entity\MaritalStatus $maritalStatus = null;
/**
* Comment on marital status.
@@ -415,11 +407,10 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* A remark over the person.
*
* @var string
*
* @ORM\Column(type="text")
*/
private $memo = ''; // TO-CHANGE in remark
private string $memo = ''; // TO-CHANGE in remark
/**
* The person's mobile phone number.
@@ -432,15 +423,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's nationality.
*
* @var Country
*
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Country")
*
* sf4 check: option inversedBy="nationals" return error mapping !!
*
* @ORM\JoinColumn(nullable=true)
*/
private $nationality;
private ?\Chill\MainBundle\Entity\Country $nationality = null;
/**
* Number of children.
@@ -488,20 +477,17 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's place of birth.
*
* @var string
*
* @ORM\Column(type="string", length=255, name="place_of_birth")
*/
private $placeOfBirth = '';
private string $placeOfBirth = '';
/**
* @var bool
*
* @deprecated
*
* @ORM\Column(type="boolean")
*/
private $proxyAccompanyingPeriodOpenState = false; //TO-DELETE ?
private bool $proxyAccompanyingPeriodOpenState = false; //TO-DELETE ?
/**
* @ORM\OneToMany(targetEntity=PersonResource::class, mappedBy="personOwner")
@@ -527,14 +513,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
*/
private $updatedAt;
private ?\DateTimeInterface $updatedAt = null;
/**
* @ORM\ManyToOne(
* targetEntity=User::class
* )
*/
private $updatedBy;
private ?\Chill\MainBundle\Entity\User $updatedBy = null;
/**
* Person constructor.

View File

@@ -48,14 +48,12 @@ class PersonAltName
private $label;
/**
* @var Person
*
* @ORM\ManyToOne(
* targetEntity="Chill\PersonBundle\Entity\Person",
* inversedBy="altNames"
* )
*/
private $person;
private ?\Chill\PersonBundle\Entity\Person $person = null;
/**
* Get id.

View File

@@ -24,10 +24,9 @@ use Doctrine\ORM\Mapping as ORM;
class PersonNotDuplicate
{
/**
* @var DateTime
* @ORM\Column(type="datetime")
*/
private $date;
private \DateTime $date;
/**
* The person's id.
@@ -41,25 +40,19 @@ class PersonNotDuplicate
private $id;
/**
* @var Person
*
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private $person1;
private ?\Chill\PersonBundle\Entity\Person $person1 = null;
/**
* @var Person
*
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private $person2;
private ?\Chill\PersonBundle\Entity\Person $person2 = null;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private $user;
private ?\Chill\MainBundle\Entity\User $user = null;
public function __construct()
{

View File

@@ -32,7 +32,7 @@ class Goal
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $desactivationDate;
private ?\DateTimeInterface $desactivationDate = null;
/**
* @ORM\Id

View File

@@ -40,12 +40,12 @@ class SocialAction
/**
* @ORM\Column(type="dateinterval", nullable=true)
*/
private $defaultNotificationDelay;
private ?\DateInterval $defaultNotificationDelay = null;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $desactivationDate;
private ?\DateTimeInterface $desactivationDate = null;
/**
* @var Collection<Evaluation>
@@ -71,7 +71,7 @@ class SocialAction
/**
* @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="socialActions")
*/
private $issue;
private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $issue = null;
/**
* @ORM\Column(type="float", name="ordering", options={"default": 0.0})
@@ -81,7 +81,7 @@ class SocialAction
/**
* @ORM\ManyToOne(targetEntity=SocialAction::class, inversedBy="children")
*/
private $parent;
private ?\Chill\PersonBundle\Entity\SocialWork\SocialAction $parent = null;
/**
* @var Collection<Result>
@@ -93,7 +93,7 @@ class SocialAction
/**
* @ORM\Column(type="json")
*/
private $title = [];
private array $title = [];
public function __construct()
{

View File

@@ -36,7 +36,7 @@ class SocialIssue
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $desactivationDate;
private ?\DateTimeInterface $desactivationDate = null;
/**
* @ORM\Id
@@ -53,7 +53,7 @@ class SocialIssue
/**
* @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="children")
*/
private $parent;
private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $parent = null;
/**
* @var Collection<SocialAction>
@@ -65,7 +65,7 @@ class SocialIssue
* @ORM\Column(type="json")
* @Groups({"read"})
*/
private $title = [];
private array $title = [];
public function __construct()
{

View File

@@ -48,7 +48,7 @@ use function uniqid;
*/
class ListPerson implements ExportElementValidatedInterface, ListInterface, GroupedExportInterface
{
private $slugs = [];
private array $slugs = [];
public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly CustomFieldProvider $customFieldProvider, private readonly ListPersonHelper $listPersonHelper, private readonly EntityManagerInterface $entityManager, private readonly TranslatableStringHelper $translatableStringHelper)
{

View File

@@ -46,10 +46,7 @@ class PrivacyEvent extends \Symfony\Contracts\EventDispatcher\Event
{
final public const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event';
/**
* @var array
*/
private $persons = [];
private array $persons = [];
/**
* PrivacyEvent constructor.

View File

@@ -33,22 +33,16 @@ final class PersonControllerUpdateTest extends WebTestCase
/**
* @var string The url using for editing the person's information
*/
private $editUrl;
private string $editUrl;
/**
* @var \Doctrine\ORM\EntityManagerInterface The entity manager
*/
private $em;
private ?object $em = null;
/**
* @var Person The person on which the test is executed
*/
private $person;
private ?\Chill\PersonBundle\Entity\Person $person = null;
/**
* @var string The url using for seeing the person's information
*/
private $viewUrl;
private string $viewUrl;
/**
* Prepare client and create a random person.

View File

@@ -30,22 +30,16 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
/**
* @var string The url using for editing the person's information
*/
private $editUrl;
private string $editUrl;
/**
* @var \Doctrine\ORM\EntityManagerInterface The entity manager
*/
private $em;
private ?object $em = null;
/**
* @var Person The person on which the test is executed
*/
private $person;
private ?\Chill\PersonBundle\Entity\Person $person = null;
/**
* @var string The url using for seeing the person's information
*/
private $viewUrl;
private string $viewUrl;
/**
* Prepare client and create a random person.

View File

@@ -20,20 +20,14 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class PersonControllerViewTest extends WebTestCase
{
/**
* @var \Doctrine\ORM\EntityManagerInterface The entity manager
*/
private $em;
private ?object $em = null;
/**
* @var Person A person used on which to run the test
*/
private $person;
private ?\Chill\PersonBundle\Entity\Person $person = null;
/**
* @var string The url to view the person details
*/
private $viewUrl;
private string $viewUrl;
protected function setUp(): void
{

View File

@@ -20,20 +20,14 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase
{
/**
* @var \Doctrine\ORM\EntityManagerInterface The entity manager
*/
private $em;
private ?object $em = null;
/**
* @var Person A person used on which to run the test
*/
private $person;
private ?\Chill\PersonBundle\Entity\Person $person = null;
/**
* @var string The url to view the person details
*/
private $viewUrl;
private string $viewUrl;
protected function setUp(): void
{

View File

@@ -24,7 +24,7 @@ final class CountPersonTest extends AbstractExportTest
/**
* @var
*/
private $export;
private ?object $export = null;
protected function setUp(): void
{

View File

@@ -20,7 +20,7 @@ use Doctrine\Migrations\AbstractMigration;
*/
final class Version20210326113045 extends AbstractMigration
{
private $datas = [];
private array $datas = [];
/**
* The distinct clause makes that for each group of duplicates, it keeps only the first row in the returned result set.