mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
apply rector rules: php up to php82
This commit is contained in:
@@ -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)),
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
);
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user