summaryrefslogtreecommitdiffstats
path: root/lib/private/Notification
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-28 09:23:43 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-31 10:37:40 +0100
commit54c0501ffad3fe732e6b118c9caeae8d5b42804a (patch)
tree6b0af30e201d3fd10302410ff1f79053af3d899f /lib/private/Notification
parent2c0b5dee19f1276a40a6dfdf5e13e7d5bafb20f3 (diff)
downloadnextcloud-server-54c0501ffad3fe732e6b118c9caeae8d5b42804a.tar.gz
nextcloud-server-54c0501ffad3fe732e6b118c9caeae8d5b42804a.zip
Type hints already make sure it is an array
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Notification')
-rw-r--r--lib/private/Notification/Notification.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/private/Notification/Notification.php b/lib/private/Notification/Notification.php
index 39fc6ab9465..ffcb36af6e5 100644
--- a/lib/private/Notification/Notification.php
+++ b/lib/private/Notification/Notification.php
@@ -239,12 +239,10 @@ class Notification implements INotification {
if (!is_string($subject) || $subject === '' || isset($subject[64])) {
throw new \InvalidArgumentException('The given subject is invalid');
}
- $this->subject = $subject;
- if (!is_array($parameters)) {
- throw new \InvalidArgumentException('The given subject parameters are invalid');
- }
+ $this->subject = $subject;
$this->subjectParameters = $parameters;
+
return $this;
}
@@ -297,11 +295,8 @@ class Notification implements INotification {
if (!is_string($subject) || $subject === '') {
throw new \InvalidArgumentException('The given parsed subject is invalid');
}
- $this->subjectRich = $subject;
- if (!is_array($parameters)) {
- throw new \InvalidArgumentException('The given subject parameters are invalid');
- }
+ $this->subjectRich = $subject;
$this->subjectRichParameters = $parameters;
return $this;
@@ -334,12 +329,10 @@ class Notification implements INotification {
if (!is_string($message) || $message === '' || isset($message[64])) {
throw new \InvalidArgumentException('The given message is invalid');
}
- $this->message = $message;
- if (!is_array($parameters)) {
- throw new \InvalidArgumentException('The given message parameters are invalid');
- }
+ $this->message = $message;
$this->messageParameters = $parameters;
+
return $this;
}
@@ -392,11 +385,8 @@ class Notification implements INotification {
if (!is_string($message) || $message === '') {
throw new \InvalidArgumentException('The given parsed message is invalid');
}
- $this->messageRich = $message;
- if (!is_array($parameters)) {
- throw new \InvalidArgumentException('The given message parameters are invalid');
- }
+ $this->messageRich = $message;
$this->messageRichParameters = $parameters;
return $this;