mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-13 07:37:36 +00:00
Refactor constructor in CountNotificationTask using promoted properties
- Simplified constructor by utilizing property promotion for dependencies in PHP 8.
This commit is contained in:
@@ -22,16 +22,8 @@ class CountNotificationTask implements NotificationCounterInterface
|
||||
{
|
||||
final public const string CACHE_KEY = 'chill_task.count_notifications.user.%d.%s';
|
||||
|
||||
protected CacheItemPoolInterface $cachePool;
|
||||
|
||||
protected SingleTaskRepository $singleTaskRepository;
|
||||
|
||||
public function __construct(
|
||||
SingleTaskRepository $singleTaskRepository,
|
||||
CacheItemPoolInterface $cachePool,
|
||||
) {
|
||||
$this->singleTaskRepository = $singleTaskRepository;
|
||||
$this->cachePool = $cachePool;
|
||||
public function __construct(protected SingleTaskRepository $singleTaskRepository, protected CacheItemPoolInterface $cachePool)
|
||||
{
|
||||
}
|
||||
|
||||
public function addNotification(UserInterface $u): int
|
||||
|
||||
Reference in New Issue
Block a user