From 89fa12c6db66503d85bc00f3ad9f18b04ea731d0 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 12 Jan 2024 17:25:56 +0200 Subject: [PATCH] ref --- application/Espo/Hooks/Common/StreamNotesAcl.php | 12 ++++-------- .../Espo/Tools/Stream/Jobs/ProcessNoteAcl.php | 13 +++---------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/application/Espo/Hooks/Common/StreamNotesAcl.php b/application/Espo/Hooks/Common/StreamNotesAcl.php index 1f0fab7a40..13cac15689 100644 --- a/application/Espo/Hooks/Common/StreamNotesAcl.php +++ b/application/Espo/Hooks/Common/StreamNotesAcl.php @@ -31,7 +31,6 @@ namespace Espo\Hooks\Common; use Espo\Core\ORM\Repository\Option\SaveOption; use Espo\ORM\Entity; - use Espo\Tools\Stream\Service as Service; /** @@ -40,21 +39,18 @@ use Espo\Tools\Stream\Service as Service; * * When users or teams of `related` or `parent` record are changed * the note record will be changed too. + * + * @noinspection PhpUnused */ class StreamNotesAcl { public static int $order = 10; - private Service $service; - - public function __construct(Service $service) - { - $this->service = $service; - } + public function __construct(private Service $service) + {} /** * @param array $options - * @throws \Espo\Core\Exceptions\Error */ public function afterSave(Entity $entity, array $options): void { diff --git a/application/Espo/Tools/Stream/Jobs/ProcessNoteAcl.php b/application/Espo/Tools/Stream/Jobs/ProcessNoteAcl.php index 201ab5c5ac..57eb41e4ee 100644 --- a/application/Espo/Tools/Stream/Jobs/ProcessNoteAcl.php +++ b/application/Espo/Tools/Stream/Jobs/ProcessNoteAcl.php @@ -31,23 +31,16 @@ namespace Espo\Tools\Stream\Jobs; use Espo\Core\Job\Job; use Espo\Core\Job\Job\Data; - use Espo\ORM\EntityManager; - use Espo\Tools\Stream\Service as Service; class ProcessNoteAcl implements Job { - private Service $service; - private EntityManager $entityManager; public function __construct( - Service $service, - EntityManager $entityManager - ) { - $this->service = $service; - $this->entityManager = $entityManager; - } + private Service $service, + private EntityManager $entityManager + ) {} public function run(Data $data): void {