diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-25 17:16:54 +0200 |
---|---|---|
committer | Côme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com> | 2022-11-29 14:36:29 +0000 |
commit | d9151ff35c4280b8e5bbb92e33fe2b89c2bee458 (patch) | |
tree | c0b5864c0c667156b82763382b4541d1fa073d37 /apps/dav/lib | |
parent | db995d464d06ace8231c41633287ce689b7d33b1 (diff) | |
download | nextcloud-server-d9151ff35c4280b8e5bbb92e33fe2b89c2bee458.tar.gz nextcloud-server-d9151ff35c4280b8e5bbb92e33fe2b89c2bee458.zip |
Get rid of all useless calls to setParsedSubject now that setRichSubject is able to do it
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/Activity/Provider/Base.php | 18 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/Activity/Provider/Base.php | 16 |
2 files changed, 3 insertions, 31 deletions
diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Base.php b/apps/dav/lib/CalDAV/Activity/Provider/Base.php index 672129a8311..841011574d0 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Base.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Base.php @@ -30,11 +30,9 @@ use OCP\IGroup; use OCP\IGroupManager; use OCP\IL10N; use OCP\IURLGenerator; -use OCP\IUser; use OCP\IUserManager; abstract class Base implements IProvider { - /** @var IUserManager */ protected $userManager; @@ -58,20 +56,8 @@ abstract class Base implements IProvider { $this->url = $urlGenerator; } - /** - * @param IEvent $event - * @param string $subject - * @param array $parameters - */ - protected function setSubjects(IEvent $event, $subject, array $parameters) { - $placeholders = $replacements = []; - foreach ($parameters as $placeholder => $parameter) { - $placeholders[] = '{' . $placeholder . '}'; - $replacements[] = $parameter['name']; - } - - $event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) - ->setRichSubject($subject, $parameters); + protected function setSubjects(IEvent $event, string $subject, array $parameters): void { + $event->setRichSubject($subject, $parameters); } /** diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Base.php b/apps/dav/lib/CardDAV/Activity/Provider/Base.php index 3e7a966c08a..a59c3b57262 100644 --- a/apps/dav/lib/CardDAV/Activity/Provider/Base.php +++ b/apps/dav/lib/CardDAV/Activity/Provider/Base.php @@ -32,11 +32,9 @@ use OCP\IGroup; use OCP\IGroupManager; use OCP\IL10N; use OCP\IURLGenerator; -use OCP\IUser; use OCP\IUserManager; abstract class Base implements IProvider { - /** @var IUserManager */ protected $userManager; @@ -60,20 +58,8 @@ abstract class Base implements IProvider { $this->url = $urlGenerator; } - /** - * @param IEvent $event - * @param string $subject - * @param array $parameters - */ protected function setSubjects(IEvent $event, string $subject, array $parameters): void { - $placeholders = $replacements = []; - foreach ($parameters as $placeholder => $parameter) { - $placeholders[] = '{' . $placeholder . '}'; - $replacements[] = $parameter['name']; - } - - $event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) - ->setRichSubject($subject, $parameters); + $event->setRichSubject($subject, $parameters); } /** |