apply rector rules: php up to php82

This commit is contained in:
2023-07-19 23:16:01 +02:00
parent 7b637d1287
commit 023a29cb78
744 changed files with 1369 additions and 1381 deletions

View File

@@ -326,7 +326,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
switch ($f) {
case 'person_countryOfBirth':
case 'person_nationality':
$suffix = substr($f, 7);
$suffix = substr((string) $f, 7);
$qb->addSelect(sprintf('IDENTITY(person.%s) as %s', $suffix, $f));
break;
@@ -339,7 +339,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
case 'person_address_country_name':
case 'person_address_country_code':
// remove 'person_'
$suffix = substr($f, 7);
$suffix = substr((string) $f, 7);
$qb->addSelect(sprintf(
'GET_PERSON_ADDRESS_%s(person.id, :address_date) AS %s',
@@ -362,8 +362,8 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
break;
default:
$prefix = substr($f, 0, 7);
$suffix = substr($f, 7);
$prefix = substr((string) $f, 0, 7);
$suffix = substr((string) $f, 7);
match ($prefix) {
'person_' => $qb->addSelect(sprintf('person.%s as %s', $suffix, $f)),

View File

@@ -19,7 +19,7 @@ use Doctrine\ORM\Query\Expr;
class ReportDateFilter implements FilterInterface
{
public function __construct(private RollingDateConverterInterface $rollingDateConverter)
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter)
{
}

View File

@@ -37,8 +37,8 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface
private $user;
public function __construct(
private EntityManagerInterface $em,
private AuthorizationHelper $helper,
private readonly EntityManagerInterface $em,
private readonly AuthorizationHelper $helper,
TokenStorageInterface $tokenStorage
) {
if (!$tokenStorage->getToken()->getUser() instanceof \Chill\MainBundle\Entity\User) {

View File

@@ -23,13 +23,13 @@ use function in_array;
class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{
public const CREATE = 'CHILL_REPORT_CREATE';
final public const CREATE = 'CHILL_REPORT_CREATE';
public const LISTS = 'CHILL_REPORT_LISTS';
final public const LISTS = 'CHILL_REPORT_LISTS';
public const SEE = 'CHILL_REPORT_SEE';
final public const SEE = 'CHILL_REPORT_SEE';
public const UPDATE = 'CHILL_REPORT_UPDATE';
final public const UPDATE = 'CHILL_REPORT_UPDATE';
/**
* @var AuthorizationHelper

View File

@@ -160,7 +160,7 @@ final class ReportControllerTest extends WebTestCase
*
* @depends testNewReportPage
*/
public function testInvalidDate(Form $form)
public function testInvalidDate(Form $form): never
{
$client = $this->getAuthenticatedClient();
$this->markTestSkipped('This test raise an error since symfony 2.7. '
@@ -379,7 +379,7 @@ final class ReportControllerTest extends WebTestCase
$matches = [];
preg_match(
'|/report/([0-9]*)/view$|',
$client->getHistory()->current()->getUri(),
(string) $client->getHistory()->current()->getUri(),
$matches
);

View File

@@ -35,7 +35,7 @@ use function strtr;
*/
class TimelineReportProvider implements TimelineProviderInterface
{
public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues)
public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private readonly Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues)
{
}