DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -115,14 +115,8 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T
protected function generateClass(AccompanyingPeriod $period, Collection $socialIssues): AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
{
return new class ($period, $socialIssues) implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface {
public Collection $socialIssues;
public AccompanyingPeriod $period;
public function __construct($period, $socialIssues)
public function __construct(public $period, public $socialIssues)
{
$this->period = $period;
$this->socialIssues = $socialIssues;
}
public function getAccompanyingPeriod(): AccompanyingPeriod

View File

@@ -472,11 +472,8 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
/**
* @dataProvider dataGenerateRandomRequestorValidData
*
* @param mixed $personId
* @param mixed $thirdPartyId
*/
public function testCommentWithValidData(AccompanyingPeriod $period, $personId, $thirdPartyId)
public function testCommentWithValidData(AccompanyingPeriod $period, mixed $personId, mixed $thirdPartyId)
{
$this->markTestIncomplete('fix test with validation');
$em = self::$container->get(EntityManagerInterface::class);
@@ -550,11 +547,8 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
/**
* @dataProvider dataGenerateRandomRequestorValidData
*
* @param mixed $personId
* @param mixed $thirdPartyId
*/
public function testRequestorWithValidData(AccompanyingPeriod $period, $personId, $thirdPartyId)
public function testRequestorWithValidData(AccompanyingPeriod $period, mixed $personId, mixed $thirdPartyId)
{
$this->markTestIncomplete('fix test with validation');
$em = self::$container->get(EntityManagerInterface::class);
@@ -634,11 +628,8 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
/**
* @dataProvider dataGenerateRandomRequestorValidData
*
* @param mixed $personId
* @param mixed $thirdPartyId
*/
public function testResourceWithValidData(AccompanyingPeriod $period, $personId, $thirdPartyId)
public function testResourceWithValidData(AccompanyingPeriod $period, mixed $personId, mixed $thirdPartyId)
{
$this->markTestIncomplete('fix test with validation');
$em = self::$container->get(EntityManagerInterface::class);

View File

@@ -75,11 +75,8 @@ final class AccompanyingCourseControllerTest extends WebTestCase
/**
* @dataProvider dataGenerateRandomUsers
*
* @param mixed $personId0
* @param mixed $personId1
*/
public function testWithNewUsers($personId0, $personId1)
public function testWithNewUsers(mixed $personId0, mixed $personId1)
{
$this->client->request('GET', '/fr/person/parcours/new', [
'person_id' => [

View File

@@ -64,10 +64,8 @@ final class HouseholdControllerTest extends WebTestCase
/**
* @dataProvider generateValidHouseholdIds
*
* @param mixed $householdId
*/
public function testAddresses($householdId)
public function testAddresses(mixed $householdId)
{
$this->client->request(
Request::METHOD_GET,
@@ -79,10 +77,8 @@ final class HouseholdControllerTest extends WebTestCase
/**
* @dataProvider generateValidHouseholdIds
*
* @param mixed $householdId
*/
public function testAddressMove($householdId)
public function testAddressMove(mixed $householdId)
{
$this->client->request(
Request::METHOD_GET,
@@ -96,10 +92,8 @@ final class HouseholdControllerTest extends WebTestCase
/**
* @dataProvider generateValidHouseholdIds
*
* @param mixed $householdId
*/
public function testEditMetadata($householdId)
public function testEditMetadata(mixed $householdId)
{
$crawler = $this->client->request(
Request::METHOD_GET,
@@ -126,10 +120,8 @@ final class HouseholdControllerTest extends WebTestCase
/**
* @dataProvider generateValidHouseholdIds
*
* @param mixed $householdId
*/
public function testSummary($householdId)
public function testSummary(mixed $householdId)
{
$this->client->request(
Request::METHOD_GET,

View File

@@ -110,10 +110,8 @@ final class HouseholdMemberControllerTest extends WebTestCase
/**
* @dataProvider provideValidDataEditMember
*
* @param mixed $memberId
*/
public function testEditMember($memberId)
public function testEditMember(mixed $memberId)
{
$client = $this->getClientAuthenticated();
@@ -134,12 +132,8 @@ final class HouseholdMemberControllerTest extends WebTestCase
/**
* @dataProvider provideValidDataMove
*
* @param mixed $personId
* @param mixed $householdId
* @param mixed $positionId
*/
public function testLeaveWithoutHousehold($personId, $householdId, $positionId, DateTimeInterface $date)
public function testLeaveWithoutHousehold(mixed $personId, mixed $householdId, mixed $positionId, DateTimeInterface $date)
{
$client = $this->getClientAuthenticated();
@@ -186,12 +180,8 @@ final class HouseholdMemberControllerTest extends WebTestCase
/**
* @dataProvider provideValidDataMove
*
* @param mixed $personId
* @param mixed $householdId
* @param mixed $positionId
*/
public function testMoveMember($personId, $householdId, $positionId, DateTimeInterface $date)
public function testMoveMember(mixed $personId, mixed $householdId, mixed $positionId, DateTimeInterface $date)
{
$client = $this->getClientAuthenticated();
@@ -237,12 +227,8 @@ final class HouseholdMemberControllerTest extends WebTestCase
/**
* @dataProvider provideValidDataMove
*
* @param mixed $personId
* @param mixed $householdId
* @param mixed $positionId
*/
public function testMoveMemberToNewHousehold($personId, $householdId, $positionId, DateTimeInterface $date)
public function testMoveMemberToNewHousehold(mixed $personId, mixed $householdId, mixed $positionId, DateTimeInterface $date)
{
$client = $this->getClientAuthenticated();

View File

@@ -71,10 +71,8 @@ final class PersonApiControllerTest extends WebTestCase
/**
* @dataProvider dataGetPersonFromCenterA
*
* @param mixed $personId
*/
public function testPersonAddressSuggestion($personId): void
public function testPersonAddressSuggestion(mixed $personId): void
{
$client = $this->getClientAuthenticated();
@@ -85,10 +83,8 @@ final class PersonApiControllerTest extends WebTestCase
/**
* @dataProvider dataGetPersonFromCenterB
*
* @param mixed $personId
*/
public function testPersonAddressSuggestionUnauthorized($personId): void
public function testPersonAddressSuggestionUnauthorized(mixed $personId): void
{
$client = $this->getClientAuthenticated();
@@ -100,10 +96,8 @@ final class PersonApiControllerTest extends WebTestCase
/**
* @dataProvider dataGetPersonFromCenterA
*
* @param mixed $personId
*/
public function testPersonGet($personId): void
public function testPersonGet(mixed $personId): void
{
$client = $this->getClientAuthenticated();
@@ -122,10 +116,8 @@ final class PersonApiControllerTest extends WebTestCase
/**
* @dataProvider dataGetPersonFromCenterB
*
* @param mixed $personId
*/
public function testPersonGetUnauthorized($personId): void
public function testPersonGetUnauthorized(mixed $personId): void
{
$client = $this->getClientAuthenticated();

View File

@@ -141,7 +141,7 @@ final class PersonControllerCreateTest extends WebTestCase
* @param int|string $personId The is of the person
* @depends testValidForm
*/
public function testPersonViewAccessible($personId)
public function testPersonViewAccessible(int|string $personId)
{
$client = $this->client;
$client->request('GET', '/fr/person/' . $personId . '/general');

View File

@@ -103,10 +103,8 @@ final class RelationshipApiControllerTest extends WebTestCase
/**
* @dataProvider personProvider
*
* @param mixed $personId
*/
public function testGetRelationshipByPerson($personId)
public function testGetRelationshipByPerson(mixed $personId)
{
$this->client->request(Request::METHOD_GET, sprintf('/api/1.0/relations/relationship/by-person/%d.json', $personId));
@@ -116,13 +114,8 @@ final class RelationshipApiControllerTest extends WebTestCase
/**
* @dataProvider relationProvider
*
* @param mixed $fromPersonId
* @param mixed $toPersonId
* @param mixed $relationId
* @param mixed $isReverse
*/
public function testPostRelationship($fromPersonId, $toPersonId, $relationId, $isReverse): void
public function testPostRelationship(mixed $fromPersonId, mixed $toPersonId, mixed $relationId, mixed $isReverse): void
{
$this->client->request(
Request::METHOD_POST,

View File

@@ -46,11 +46,8 @@ final class PersonCreateEventTest extends TestCase
/**
* @dataProvider generateAltNames
*
* @param mixed $altname
* @param mixed $altnameExpected
*/
public function testAltNamesOnPrePersist($altname, $altnameExpected)
public function testAltNamesOnPrePersist(mixed $altname, mixed $altnameExpected)
{
$listener = new PersonEventListener();
@@ -65,13 +62,8 @@ final class PersonCreateEventTest extends TestCase
/**
* @dataProvider generateNames
*
* @param mixed $firstname
* @param mixed $firstnameExpected
* @param mixed $lastname
* @param mixed $lastnameExpected
*/
public function testOnPrePersist($firstname, $firstnameExpected, $lastname, $lastnameExpected)
public function testOnPrePersist(mixed $firstname, mixed $firstnameExpected, mixed $lastname, mixed $lastnameExpected)
{
$listener = new PersonEventListener();

View File

@@ -225,11 +225,9 @@ final class PersonSearchTest extends WebTestCase
}
/**
* @param mixed $username
*
* @return \Symfony\Component\BrowserKit\Client
*/
private function getAuthenticatedClient($username = 'center a_social')
private function getAuthenticatedClient(mixed $username = 'center a_social')
{
return self::createClient([], [
'PHP_AUTH_USER' => $username,

View File

@@ -108,10 +108,8 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
/**
* @dataProvider dataGeneratorNormalizationNullOrNotNullHaveSameKeys
*
* @param mixed $context
*/
public function testNormalizationNullOrNotNullHaveSameKeys($context)
public function testNormalizationNullOrNotNullHaveSameKeys(mixed $context)
{
$period = new Person();
$notNullData = $this->buildPersonNormalizer()->normalize($period, 'docgen', $context);
@@ -126,11 +124,8 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
/**
* @dataProvider generateData
*
* @param mixed $expected
* @param mixed $msg
*/
public function testNormalize(?Person $person, $expected, $msg)
public function testNormalize(?Person $person, mixed $expected, mixed $msg)
{
$normalized = $this->normalizer->normalize($person, 'docgen', [
'docgen:expects' => Person::class,
@@ -229,11 +224,8 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
* serializers.
*
* @dataProvider generateData
*
* @param mixed $expected
* @param mixed $msg
*/
public function testNormalizeUsingNormalizer(?Person $person, $expected, $msg)
public function testNormalizeUsingNormalizer(?Person $person, mixed $expected, mixed $msg)
{
$normalizer = $this->buildNormalizer();

View File

@@ -58,10 +58,8 @@ final class TimelineAccompanyingPeriodTest extends WebTestCase
/**
* @dataProvider provideDataPersonWithAccompanyingPeriod
*
* @param mixed $personId
*/
public function testEntriesAreShown($personId)
public function testEntriesAreShown(mixed $personId)
{
$this->markTestSkipped('page does not work');

View File

@@ -61,10 +61,8 @@ final class MaxHolderValidatorTest extends ConstraintValidatorTestCase
/**
* @dataProvider provideInvalidHousehold
*
* @param mixed $parameters
*/
public function testHouseholdInvalid(Household $household, $parameters)
public function testHouseholdInvalid(Household $household, mixed $parameters)
{
$constraint = $this->getConstraint();