mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
apply rector rules: php up to php82
This commit is contained in:
@@ -49,15 +49,15 @@ use function array_merge;
|
||||
final class SingleTaskController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private CenterResolverDispatcherInterface $centerResolverDispatcher,
|
||||
private PaginatorFactory $paginatorFactory,
|
||||
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository,
|
||||
private TranslatorInterface $translator,
|
||||
private EventDispatcherInterface $eventDispatcher,
|
||||
private TimelineBuilder $timelineBuilder,
|
||||
private LoggerInterface $logger,
|
||||
private FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
||||
private SingleTaskStateRepository $singleTaskStateRepository
|
||||
private readonly CenterResolverDispatcherInterface $centerResolverDispatcher,
|
||||
private readonly PaginatorFactory $paginatorFactory,
|
||||
private readonly SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly TimelineBuilder $timelineBuilder,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
||||
private readonly SingleTaskStateRepository $singleTaskStateRepository
|
||||
) {
|
||||
}
|
||||
|
||||
|
@@ -186,9 +186,8 @@ class RecurringTask extends AbstractTask
|
||||
*
|
||||
*
|
||||
* @return RecurringTask
|
||||
* @param mixed $occurenceStartDate
|
||||
*/
|
||||
public function setOccurenceStartDate($occurenceStartDate)
|
||||
public function setOccurenceStartDate(mixed $occurenceStartDate)
|
||||
{
|
||||
$this->occurenceStartDate = $occurenceStartDate;
|
||||
|
||||
@@ -200,9 +199,8 @@ class RecurringTask extends AbstractTask
|
||||
*
|
||||
*
|
||||
* @return RecurringTask
|
||||
* @param mixed $occurenceWarningInterval
|
||||
*/
|
||||
public function setOccurenceWarningInterval($occurenceWarningInterval)
|
||||
public function setOccurenceWarningInterval(mixed $occurenceWarningInterval)
|
||||
{
|
||||
$this->occurenceWarningInterval = $occurenceWarningInterval;
|
||||
|
||||
|
@@ -16,7 +16,7 @@ use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
class TaskEvent extends Event
|
||||
{
|
||||
public const PERSIST = 'chill_task.task_persist';
|
||||
final public const PERSIST = 'chill_task.task_persist';
|
||||
|
||||
/**
|
||||
* @var AbstractTask
|
||||
|
@@ -19,11 +19,11 @@ use Symfony\Component\Workflow\Transition;
|
||||
|
||||
class UIEvent extends Event
|
||||
{
|
||||
public const EDIT_FORM = 'chill_task.edit_form';
|
||||
final public const EDIT_FORM = 'chill_task.edit_form';
|
||||
|
||||
public const EDIT_PAGE = 'chill_task.edit_page';
|
||||
final public const EDIT_PAGE = 'chill_task.edit_page';
|
||||
|
||||
public const SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page';
|
||||
final public const SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page';
|
||||
|
||||
/**
|
||||
* @var FormInterface|null
|
||||
|
@@ -28,7 +28,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
class SingleTaskType extends AbstractType
|
||||
{
|
||||
public function __construct(private ParameterBagInterface $parameterBag, private CenterResolverDispatcherInterface $centerResolverDispatcher, private ScopeResolverDispatcher $scopeResolverDispatcher)
|
||||
public function __construct(private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ use Symfony\Component\Security\Core\Security;
|
||||
use function count;
|
||||
use function substr;
|
||||
|
||||
final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepositoryInterface
|
||||
final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepositoryInterface
|
||||
{
|
||||
public function __construct(private CenterResolverManagerInterface $centerResolverDispatcher, private EntityManagerInterface $em, private Security $security, private AuthorizationHelperInterface $authorizationHelper)
|
||||
{
|
||||
@@ -122,8 +122,8 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository
|
||||
|
||||
break;
|
||||
|
||||
case str_starts_with($flag, 'state_'):
|
||||
$state = substr($flag, 6);
|
||||
case str_starts_with((string) $flag, 'state_'):
|
||||
$state = substr((string) $flag, 6);
|
||||
$orXState
|
||||
->add(
|
||||
"JSONB_EXISTS_IN_ARRAY(t.currentStates, :state_{$key}) = 'TRUE'"
|
||||
|
@@ -31,15 +31,15 @@ use function count;
|
||||
*/
|
||||
class SingleTaskRepository extends EntityRepository
|
||||
{
|
||||
public const DATE_STATUS_CURRENT = 'current';
|
||||
final public const DATE_STATUS_CURRENT = 'current';
|
||||
|
||||
public const DATE_STATUS_ENDED = 'ended';
|
||||
final public const DATE_STATUS_ENDED = 'ended';
|
||||
|
||||
public const DATE_STATUS_NOT_STARTED = 'not_started';
|
||||
final public const DATE_STATUS_NOT_STARTED = 'not_started';
|
||||
|
||||
public const DATE_STATUS_WARNING = 'warning';
|
||||
final public const DATE_STATUS_WARNING = 'warning';
|
||||
|
||||
public const DATE_STATUSES = [
|
||||
final public const DATE_STATUSES = [
|
||||
self::DATE_STATUS_ENDED,
|
||||
self::DATE_STATUS_WARNING,
|
||||
self::DATE_STATUS_CURRENT,
|
||||
|
@@ -21,7 +21,7 @@ class SingleTaskStateRepository
|
||||
SQL;
|
||||
|
||||
public function __construct(
|
||||
private Connection $connection
|
||||
private readonly Connection $connection
|
||||
) {
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
class AuthorizationEvent extends Event
|
||||
{
|
||||
public const VOTE = 'chill_task.vote';
|
||||
final public const VOTE = 'chill_task.vote';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
@@ -27,9 +27,9 @@ class AuthorizationEvent extends Event
|
||||
protected $vote;
|
||||
|
||||
public function __construct(
|
||||
private Person|AbstractTask|AccompanyingPeriod|null $subject,
|
||||
private string $attribute,
|
||||
private TokenInterface $token
|
||||
private readonly Person|AbstractTask|AccompanyingPeriod|null $subject,
|
||||
private readonly string $attribute,
|
||||
private readonly TokenInterface $token
|
||||
) {
|
||||
}
|
||||
|
||||
|
@@ -48,12 +48,12 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
|
||||
public const UPDATE = 'CHILL_TASK_TASK_UPDATE';
|
||||
|
||||
private VoterHelperInterface $voter;
|
||||
private readonly VoterHelperInterface $voter;
|
||||
|
||||
public function __construct(
|
||||
private AccessDecisionManagerInterface $accessDecisionManager,
|
||||
private EventDispatcherInterface $eventDispatcher,
|
||||
private LoggerInterface $logger,
|
||||
private readonly AccessDecisionManagerInterface $accessDecisionManager,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly LoggerInterface $logger,
|
||||
VoterHelperFactoryInterface $voterFactory
|
||||
) {
|
||||
$this->voter = $voterFactory
|
||||
|
@@ -31,7 +31,7 @@ class TaskTwigExtension extends AbstractExtension
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction('task_workflow_metadata', [$this, 'getWorkflowMetadata']),
|
||||
new TwigFunction('task_workflow_metadata', $this->getWorkflowMetadata(...)),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use function array_merge;
|
||||
|
||||
class CountNotificationTask implements NotificationCounterInterface
|
||||
{
|
||||
public const CACHE_KEY = 'chill_task.count_notifications.user.%d.%s';
|
||||
final public const CACHE_KEY = 'chill_task.count_notifications.user.%d.%s';
|
||||
|
||||
/**
|
||||
* @var CacheItempPoolInterface
|
||||
@@ -104,7 +104,7 @@ class CountNotificationTask implements NotificationCounterInterface
|
||||
];
|
||||
|
||||
$sum = $this->singleTaskRepository->countByParameters(
|
||||
array_merge($params, ['date_status' => $status])
|
||||
[...$params, 'date_status' => $status]
|
||||
);
|
||||
|
||||
$sumCache->set($sum);
|
||||
|
@@ -40,7 +40,7 @@ final class SingleTaskACLAwareRepositoryTest extends KernelTestCase
|
||||
|
||||
use ProphecyTrait;
|
||||
|
||||
private AuthorizationHelperInterface $authorizationHelper;
|
||||
private readonly AuthorizationHelperInterface $authorizationHelper;
|
||||
|
||||
private CenterRepositoryInterface $centerRepository;
|
||||
|
||||
|
@@ -28,7 +28,7 @@ use function array_map;
|
||||
*/
|
||||
class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
|
||||
{
|
||||
public const TYPE = 'chill_task.transition';
|
||||
final public const TYPE = 'chill_task.transition';
|
||||
|
||||
/**
|
||||
* @var EntityManagerInterface
|
||||
|
@@ -38,7 +38,7 @@ use function strtr;
|
||||
*/
|
||||
class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
|
||||
{
|
||||
public const TYPE = 'chill_task.transition';
|
||||
final public const TYPE = 'chill_task.transition';
|
||||
|
||||
public function __construct(protected EntityManagerInterface $em, protected Registry $registry, protected AuthorizationHelper $authorizationHelper, protected Security $security)
|
||||
{
|
||||
|
@@ -23,11 +23,11 @@ use function implode;
|
||||
|
||||
class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDefinition
|
||||
{
|
||||
public const DEFINITION_METADATA = [
|
||||
final public const DEFINITION_METADATA = [
|
||||
'name' => 'Default task',
|
||||
];
|
||||
|
||||
public const TRANSITION_METADATA = [
|
||||
final public const TRANSITION_METADATA = [
|
||||
'close' => [
|
||||
'verb' => 'close',
|
||||
'class' => 'btn btn-task-label btn-task-close',
|
||||
|
Reference in New Issue
Block a user