apply rules rector up to php82

This commit is contained in:
2023-05-01 21:39:45 +02:00
parent 81e8928344
commit 6d63177ff4
733 changed files with 1257 additions and 1322 deletions

View File

@@ -316,7 +316,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR)
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
@@ -338,7 +338,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
}
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), null, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), null, 512, JSON_THROW_ON_ERROR);
// check that the person id is contained
$participationsPersonsIds = array_map(
@@ -358,7 +358,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR)
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
@@ -394,7 +394,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
$this->markTestSkipped('the next tests should appears only on valid accompanying period');
}
$data = json_decode($this->client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $this->client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertArrayHasKey('id', $data);
$this->assertArrayHasKey('type', $data);
$this->assertEquals('social_issue', $data['type']);
@@ -425,7 +425,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
$this->markTestSkipped('the next tests should appears only on valid accompanying period');
}
$data = json_decode($response->getContent(), null, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), null, 512, JSON_THROW_ON_ERROR);
$this->assertEquals(
$data->id,
$periodId,
@@ -487,7 +487,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'accompanying_period_comment', 'content' => 'this is a text'])
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
@@ -506,7 +506,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'accompanying_period_comment', 'id' => $data['id']], JSON_THROW_ON_ERROR)
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
}
@@ -563,7 +563,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR)
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
@@ -590,7 +590,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'thirdparty', 'id' => $thirdPartyId], JSON_THROW_ON_ERROR)
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
@@ -644,7 +644,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'accompanying_period_resource', 'resource' => ['type' => 'person', 'id' => $personId]])
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
@@ -688,7 +688,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
json_encode(['type' => 'accompanying_period_resource', 'resource' => ['type' => 'thirdparty', 'id' => $thirdPartyId]])
);
$response = $this->client->getResponse();
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));

View File

@@ -70,7 +70,7 @@ final class AccompanyingCourseControllerTest extends WebTestCase
$this->assertResponseRedirects();
$location = $this->client->getResponse()->headers->get('Location');
$this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', $location));
$this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', (string) $location));
}
/**
@@ -89,7 +89,7 @@ final class AccompanyingCourseControllerTest extends WebTestCase
$location = $this->client->getResponse()->headers->get('Location');
$matches = [];
$this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', $location, $matches));
$this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', (string) $location, $matches));
$id = $matches[1];
$period = self::$container->get(EntityManagerInterface::class)

View File

@@ -270,7 +270,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase
* Then the response should not redirect to any page
* and an error element is shown
*/
public function testCreatePeriodWithClosingAfterCurrentFails()
public function testCreatePeriodWithClosingAfterCurrentFails(): never
{
$this->markTestSkipped('Multiple period may now cover. This test is kept ' .
'in case of a configuration may add this feature again');
@@ -438,7 +438,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase
* Then the response should not redirect to any page
* and an error element is shown
*/
public function testCreatePeriodWithOpeningAndClosingAfterCurrentFails()
public function testCreatePeriodWithOpeningAndClosingAfterCurrentFails(): never
{
$this->markTestSkipped('Multiple period may now cover. This test is kept ' .
'in case of a configuration may add this feature again');
@@ -470,7 +470,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase
/**
* @group reopening
*/
public function testReOpeningPeriod()
public function testReOpeningPeriod(): never
{
// test that re-opening a period which is opened does not work
$this->client->request(

View File

@@ -69,7 +69,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase
*
* @group configurable_fields
*/
public function testViewPerson()
public function testViewPerson(): never
{
$this->markTestSkipped('This configuration does not allow multiple environnements');
$client = self::createClient(