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

@@ -19,11 +19,11 @@ use UnexpectedValueException;
class AccompanyingPeriodCommentVoter extends Voter
{
public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE';
final public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE';
public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT';
final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT';
public function __construct(private Security $security)
public function __construct(private readonly Security $security)
{
}

View File

@@ -19,9 +19,9 @@ use UnexpectedValueException;
class AccompanyingPeriodResourceVoter extends Voter
{
public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT';
final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT';
public function __construct(private AccessDecisionManagerInterface $accessDecisionManager)
public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager)
{
}

View File

@@ -30,7 +30,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
/**
* all the roles that are linked to an accompanying period.
*/
public const ALL = [
final public const ALL = [
self::SEE,
self::SEE_DETAILS,
self::CREATE,
@@ -42,26 +42,26 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
self::RE_OPEN_COURSE,
];
public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE';
final public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE';
/**
* role to DELETE the course.
*
* Will be true only for the creator, and if the course is still at DRAFT step.
*/
public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE';
final public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE';
/**
* role to EDIT the course.
*
* If the course is closed, it will be always false.
*/
public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE';
final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE';
/**
* Give all the right above.
*/
public const FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL';
final public const FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL';
/**
* Reopen a closed course.
@@ -69,48 +69,48 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
* This forward to the EDIT role, without taking into account that the course
* is closed
*/
public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN';
final public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN';
/**
* Allow user to bulk reassign the courses.
*/
public const REASSIGN_BULK = 'CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK';
final public const REASSIGN_BULK = 'CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK';
public const SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE';
final public const SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE';
/**
* details are for seeing:.
*
* * SocialIssues
*/
public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS';
final public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS';
/**
* Give the ability to see statistics.
*/
public const STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS';
final public const STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS';
/**
* Right to toggle confidentiality.
*/
public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL';
final public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL';
public const TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL';
final public const TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL';
/**
* Right to toggle urgency of parcours.
*/
public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY';
final public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY';
/**
* Right to see confidential period even if not referrer
*/
public const SEE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_CONFIDENTIAL';
final public const SEE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_CONFIDENTIAL';
private VoterHelperInterface $voterHelper;
private readonly VoterHelperInterface $voterHelper;
public function __construct(
private Security $security,
private readonly Security $security,
VoterHelperFactoryInterface $voterHelperFactory
) {
$this->voterHelper = $voterHelperFactory

View File

@@ -24,9 +24,9 @@ use UnexpectedValueException;
*/
class AccompanyingPeriodWorkEvaluationDocumentVoter extends Voter
{
public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW';
final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW';
public function __construct(private AccessDecisionManagerInterface $accessDecisionManager)
public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager)
{
}

View File

@@ -21,16 +21,16 @@ use function in_array;
class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterInterface
{
public const ALL = [
final public const ALL = [
self::SEE,
self::STATS,
];
public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW';
final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW';
public const STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS';
final public const STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS';
public function __construct(private Security $security)
public function __construct(private readonly Security $security)
{
}

View File

@@ -27,25 +27,25 @@ use function in_array;
class AccompanyingPeriodWorkVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface
{
public const ALL = [
final public const ALL = [
self::SEE,
self::CREATE,
self::UPDATE,
self::DELETE,
];
public const CREATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE';
final public const CREATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE';
public const DELETE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE';
final public const DELETE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE';
public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE';
final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE';
public const UPDATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE';
final public const UPDATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE';
private VoterHelperInterface $voterHelper;
private readonly VoterHelperInterface $voterHelper;
public function __construct(
private Security $security,
private readonly Security $security,
VoterHelperFactoryInterface $voterHelperFactory
) {
$this->voterHelper = $voterHelperFactory

View File

@@ -26,16 +26,16 @@ use function in_array;
class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface
{
public const EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT';
final public const EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT';
public const SEE = 'CHILL_PERSON_HOUSEHOLD_SEE';
final public const SEE = 'CHILL_PERSON_HOUSEHOLD_SEE';
/**
* @deprecated use @see{self::SEE} instead
*/
public const SHOW = self::SEE;
final public const SHOW = self::SEE;
public const STATS = 'CHILL_PERSON_HOUSEHOLD_STATS';
final public const STATS = 'CHILL_PERSON_HOUSEHOLD_STATS';
private const ALL = [
self::SEE,
@@ -43,9 +43,9 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, Chi
self::STATS,
];
private VoterHelperInterface $helper;
private readonly VoterHelperInterface $helper;
public function __construct(private Security $security, VoterHelperFactoryInterface $voterHelperFactory)
public function __construct(private readonly Security $security, VoterHelperFactoryInterface $voterHelperFactory)
{
$this->helper = $voterHelperFactory
->generate(self::class)

View File

@@ -21,17 +21,17 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
class PersonVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{
public const CREATE = 'CHILL_PERSON_CREATE';
final public const CREATE = 'CHILL_PERSON_CREATE';
public const DUPLICATE = 'CHILL_PERSON_DUPLICATE';
final public const DUPLICATE = 'CHILL_PERSON_DUPLICATE';
public const LISTS = 'CHILL_PERSON_LISTS';
final public const LISTS = 'CHILL_PERSON_LISTS';
public const SEE = 'CHILL_PERSON_SEE';
final public const SEE = 'CHILL_PERSON_SEE';
public const STATS = 'CHILL_PERSON_STATS';
final public const STATS = 'CHILL_PERSON_STATS';
public const UPDATE = 'CHILL_PERSON_UPDATE';
final public const UPDATE = 'CHILL_PERSON_UPDATE';
protected VoterHelperInterface $voter;

View File

@@ -17,9 +17,9 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
class AuthorizedCenterOnPersonCreation implements AuthorizedCenterOnPersonCreationInterface
{
private bool $showCenters;
private readonly bool $showCenters;
public function __construct(private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, ParameterBagInterface $parameterBag)
public function __construct(private readonly AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, ParameterBagInterface $parameterBag)
{
$this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers'];
}