Passed
Push — master ( d0668c...20ee35 )
by Joas
14:49 queued 14s
created
lib/private/Authentication/Token/IWipeableToken.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
 
27 27
 interface IWipeableToken extends IToken {
28 28
 
29
-	/**
30
-	 * Mark the token for remote wipe
31
-	 */
32
-	public function wipe(): void;
29
+    /**
30
+     * Mark the token for remote wipe
31
+     */
32
+    public function wipe(): void;
33 33
 
34 34
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Notifications/Notifier.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -32,65 +32,65 @@
 block discarded – undo
32 32
 
33 33
 class Notifier implements INotifier {
34 34
 
35
-	/** @var IL10nFactory */
36
-	private $factory;
35
+    /** @var IL10nFactory */
36
+    private $factory;
37 37
 
38
-	public function __construct(IL10nFactory $l10nFactory) {
39
-		$this->factory = $l10nFactory;
40
-	}
38
+    public function __construct(IL10nFactory $l10nFactory) {
39
+        $this->factory = $l10nFactory;
40
+    }
41 41
 
42
-	/**
43
-	 * @inheritDoc
44
-	 */
45
-	public function prepare(INotification $notification, string $languageCode): INotification {
46
-		if ($notification->getApp() !== 'auth') {
47
-			// Not my app => throw
48
-			throw new InvalidArgumentException();
49
-		}
42
+    /**
43
+     * @inheritDoc
44
+     */
45
+    public function prepare(INotification $notification, string $languageCode): INotification {
46
+        if ($notification->getApp() !== 'auth') {
47
+            // Not my app => throw
48
+            throw new InvalidArgumentException();
49
+        }
50 50
 
51
-		// Read the language from the notification
52
-		$l = $this->factory->get('lib', $languageCode);
51
+        // Read the language from the notification
52
+        $l = $this->factory->get('lib', $languageCode);
53 53
 
54
-		switch ($notification->getSubject()) {
55
-			case 'remote_wipe_start':
56
-				$notification->setParsedSubject(
57
-					$l->t('Remote wipe started')
58
-				)->setParsedMessage(
59
-					$l->t('A remote wipe was started on device %s', $notification->getSubjectParameters())
60
-				);
54
+        switch ($notification->getSubject()) {
55
+            case 'remote_wipe_start':
56
+                $notification->setParsedSubject(
57
+                    $l->t('Remote wipe started')
58
+                )->setParsedMessage(
59
+                    $l->t('A remote wipe was started on device %s', $notification->getSubjectParameters())
60
+                );
61 61
 
62
-				return $notification;
63
-			case 'remote_wipe_finish':
64
-				$notification->setParsedSubject(
65
-					$l->t('Remote wipe finished')
66
-				)->setParsedMessage(
67
-					$l->t('The remote wipe on %s has finished', $notification->getSubjectParameters())
68
-				);
62
+                return $notification;
63
+            case 'remote_wipe_finish':
64
+                $notification->setParsedSubject(
65
+                    $l->t('Remote wipe finished')
66
+                )->setParsedMessage(
67
+                    $l->t('The remote wipe on %s has finished', $notification->getSubjectParameters())
68
+                );
69 69
 
70
-				return $notification;
71
-			default:
72
-				// Unknown subject => Unknown notification => throw
73
-				throw new InvalidArgumentException();
74
-		}
75
-	}
70
+                return $notification;
71
+            default:
72
+                // Unknown subject => Unknown notification => throw
73
+                throw new InvalidArgumentException();
74
+        }
75
+    }
76 76
 
77
-	/**
78
-	 * Identifier of the notifier, only use [a-z0-9_]
79
-	 *
80
-	 * @return string
81
-	 * @since 17.0.0
82
-	 */
83
-	public function getID(): string {
84
-		return 'auth';
85
-	}
77
+    /**
78
+     * Identifier of the notifier, only use [a-z0-9_]
79
+     *
80
+     * @return string
81
+     * @since 17.0.0
82
+     */
83
+    public function getID(): string {
84
+        return 'auth';
85
+    }
86 86
 
87
-	/**
88
-	 * Human readable name describing the notifier
89
-	 *
90
-	 * @return string
91
-	 * @since 17.0.0
92
-	 */
93
-	public function getName(): string {
94
-		return $this->factory->get('lib')->t('Authentication');
95
-	}
87
+    /**
88
+     * Human readable name describing the notifier
89
+     *
90
+     * @return string
91
+     * @since 17.0.0
92
+     */
93
+    public function getName(): string {
94
+        return $this->factory->get('lib')->t('Authentication');
95
+    }
96 96
 }
Please login to merge, or discard this patch.
lib/private/Notification/Action.php 1 patch
Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -28,146 +28,146 @@
 block discarded – undo
28 28
 
29 29
 class Action implements IAction {
30 30
 
31
-	/** @var string */
32
-	protected $label;
33
-
34
-	/** @var string */
35
-	protected $labelParsed;
36
-
37
-	/** @var string */
38
-	protected $link;
39
-
40
-	/** @var string */
41
-	protected $requestType;
42
-
43
-	/** @var string */
44
-	protected $icon;
45
-
46
-	/** @var bool */
47
-	protected $primary;
48
-
49
-	public function __construct() {
50
-		$this->label = '';
51
-		$this->labelParsed = '';
52
-		$this->link = '';
53
-		$this->requestType = '';
54
-		$this->primary = false;
55
-	}
56
-
57
-	/**
58
-	 * @param string $label
59
-	 * @return $this
60
-	 * @throws \InvalidArgumentException if the label is invalid
61
-	 * @since 8.2.0
62
-	 */
63
-	public function setLabel(string $label): IAction {
64
-		if ($label === '' || isset($label[32])) {
65
-			throw new \InvalidArgumentException('The given label is invalid');
66
-		}
67
-		$this->label = $label;
68
-		return $this;
69
-	}
70
-
71
-	/**
72
-	 * @return string
73
-	 * @since 8.2.0
74
-	 */
75
-	public function getLabel(): string {
76
-		return $this->label;
77
-	}
78
-
79
-	/**
80
-	 * @param string $label
81
-	 * @return $this
82
-	 * @throws \InvalidArgumentException if the label is invalid
83
-	 * @since 8.2.0
84
-	 */
85
-	public function setParsedLabel(string $label): IAction {
86
-		if ($label === '') {
87
-			throw new \InvalidArgumentException('The given parsed label is invalid');
88
-		}
89
-		$this->labelParsed = $label;
90
-		return $this;
91
-	}
92
-
93
-	/**
94
-	 * @return string
95
-	 * @since 8.2.0
96
-	 */
97
-	public function getParsedLabel(): string {
98
-		return $this->labelParsed;
99
-	}
100
-
101
-	/**
102
-	 * @param $primary bool
103
-	 * @return $this
104
-	 * @since 9.0.0
105
-	 */
106
-	public function setPrimary(bool $primary): IAction {
107
-		$this->primary = $primary;
108
-		return $this;
109
-	}
110
-
111
-	/**
112
-	 * @return bool
113
-	 * @since 9.0.0
114
-	 */
115
-	public function isPrimary(): bool {
116
-		return $this->primary;
117
-	}
118
-
119
-	/**
120
-	 * @param string $link
121
-	 * @param string $requestType
122
-	 * @return $this
123
-	 * @throws \InvalidArgumentException if the link is invalid
124
-	 * @since 8.2.0
125
-	 */
126
-	public function setLink(string $link, string $requestType): IAction {
127
-		if ($link === '' || isset($link[256])) {
128
-			throw new \InvalidArgumentException('The given link is invalid');
129
-		}
130
-		if (!in_array($requestType, [
131
-			self::TYPE_GET,
132
-			self::TYPE_POST,
133
-			self::TYPE_PUT,
134
-			self::TYPE_DELETE,
135
-			self::TYPE_WEB,
136
-		], true)) {
137
-			throw new \InvalidArgumentException('The given request type is invalid');
138
-		}
139
-		$this->link = $link;
140
-		$this->requestType = $requestType;
141
-		return $this;
142
-	}
143
-
144
-	/**
145
-	 * @return string
146
-	 * @since 8.2.0
147
-	 */
148
-	public function getLink(): string {
149
-		return $this->link;
150
-	}
151
-
152
-	/**
153
-	 * @return string
154
-	 * @since 8.2.0
155
-	 */
156
-	public function getRequestType(): string {
157
-		return $this->requestType;
158
-	}
159
-
160
-	/**
161
-	 * @return bool
162
-	 */
163
-	public function isValid(): bool {
164
-		return $this->label !== '' && $this->link !== '';
165
-	}
166
-
167
-	/**
168
-	 * @return bool
169
-	 */
170
-	public function isValidParsed(): bool {
171
-		return $this->labelParsed !== '' && $this->link !== '';
172
-	}
31
+    /** @var string */
32
+    protected $label;
33
+
34
+    /** @var string */
35
+    protected $labelParsed;
36
+
37
+    /** @var string */
38
+    protected $link;
39
+
40
+    /** @var string */
41
+    protected $requestType;
42
+
43
+    /** @var string */
44
+    protected $icon;
45
+
46
+    /** @var bool */
47
+    protected $primary;
48
+
49
+    public function __construct() {
50
+        $this->label = '';
51
+        $this->labelParsed = '';
52
+        $this->link = '';
53
+        $this->requestType = '';
54
+        $this->primary = false;
55
+    }
56
+
57
+    /**
58
+     * @param string $label
59
+     * @return $this
60
+     * @throws \InvalidArgumentException if the label is invalid
61
+     * @since 8.2.0
62
+     */
63
+    public function setLabel(string $label): IAction {
64
+        if ($label === '' || isset($label[32])) {
65
+            throw new \InvalidArgumentException('The given label is invalid');
66
+        }
67
+        $this->label = $label;
68
+        return $this;
69
+    }
70
+
71
+    /**
72
+     * @return string
73
+     * @since 8.2.0
74
+     */
75
+    public function getLabel(): string {
76
+        return $this->label;
77
+    }
78
+
79
+    /**
80
+     * @param string $label
81
+     * @return $this
82
+     * @throws \InvalidArgumentException if the label is invalid
83
+     * @since 8.2.0
84
+     */
85
+    public function setParsedLabel(string $label): IAction {
86
+        if ($label === '') {
87
+            throw new \InvalidArgumentException('The given parsed label is invalid');
88
+        }
89
+        $this->labelParsed = $label;
90
+        return $this;
91
+    }
92
+
93
+    /**
94
+     * @return string
95
+     * @since 8.2.0
96
+     */
97
+    public function getParsedLabel(): string {
98
+        return $this->labelParsed;
99
+    }
100
+
101
+    /**
102
+     * @param $primary bool
103
+     * @return $this
104
+     * @since 9.0.0
105
+     */
106
+    public function setPrimary(bool $primary): IAction {
107
+        $this->primary = $primary;
108
+        return $this;
109
+    }
110
+
111
+    /**
112
+     * @return bool
113
+     * @since 9.0.0
114
+     */
115
+    public function isPrimary(): bool {
116
+        return $this->primary;
117
+    }
118
+
119
+    /**
120
+     * @param string $link
121
+     * @param string $requestType
122
+     * @return $this
123
+     * @throws \InvalidArgumentException if the link is invalid
124
+     * @since 8.2.0
125
+     */
126
+    public function setLink(string $link, string $requestType): IAction {
127
+        if ($link === '' || isset($link[256])) {
128
+            throw new \InvalidArgumentException('The given link is invalid');
129
+        }
130
+        if (!in_array($requestType, [
131
+            self::TYPE_GET,
132
+            self::TYPE_POST,
133
+            self::TYPE_PUT,
134
+            self::TYPE_DELETE,
135
+            self::TYPE_WEB,
136
+        ], true)) {
137
+            throw new \InvalidArgumentException('The given request type is invalid');
138
+        }
139
+        $this->link = $link;
140
+        $this->requestType = $requestType;
141
+        return $this;
142
+    }
143
+
144
+    /**
145
+     * @return string
146
+     * @since 8.2.0
147
+     */
148
+    public function getLink(): string {
149
+        return $this->link;
150
+    }
151
+
152
+    /**
153
+     * @return string
154
+     * @since 8.2.0
155
+     */
156
+    public function getRequestType(): string {
157
+        return $this->requestType;
158
+    }
159
+
160
+    /**
161
+     * @return bool
162
+     */
163
+    public function isValid(): bool {
164
+        return $this->label !== '' && $this->link !== '';
165
+    }
166
+
167
+    /**
168
+     * @return bool
169
+     */
170
+    public function isValidParsed(): bool {
171
+        return $this->labelParsed !== '' && $this->link !== '';
172
+    }
173 173
 }
Please login to merge, or discard this patch.
lib/public/Notification/IApp.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,23 +30,23 @@
 block discarded – undo
30 30
  * @since 9.0.0
31 31
  */
32 32
 interface IApp {
33
-	/**
34
-	 * @param INotification $notification
35
-	 * @throws \InvalidArgumentException When the notification is not valid
36
-	 * @since 9.0.0
37
-	 */
38
-	public function notify(INotification $notification): void;
33
+    /**
34
+     * @param INotification $notification
35
+     * @throws \InvalidArgumentException When the notification is not valid
36
+     * @since 9.0.0
37
+     */
38
+    public function notify(INotification $notification): void;
39 39
 
40
-	/**
41
-	 * @param INotification $notification
42
-	 * @since 9.0.0
43
-	 */
44
-	public function markProcessed(INotification $notification): void;
40
+    /**
41
+     * @param INotification $notification
42
+     * @since 9.0.0
43
+     */
44
+    public function markProcessed(INotification $notification): void;
45 45
 
46
-	/**
47
-	 * @param INotification $notification
48
-	 * @return int
49
-	 * @since 9.0.0
50
-	 */
51
-	public function getCount(INotification $notification): int;
46
+    /**
47
+     * @param INotification $notification
48
+     * @return int
49
+     * @since 9.0.0
50
+     */
51
+    public function getCount(INotification $notification): int;
52 52
 }
Please login to merge, or discard this patch.
lib/public/Notification/AlreadyProcessedException.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@
 block discarded – undo
28 28
  */
29 29
 class AlreadyProcessedException extends \RuntimeException {
30 30
 
31
-	/**
32
-	 * @since 17.0.0
33
-	 */
34
-	public function __construct() {
35
-		parent::__construct('Notification is processed already');
36
-	}
31
+    /**
32
+     * @since 17.0.0
33
+     */
34
+    public function __construct() {
35
+        parent::__construct('Notification is processed already');
36
+    }
37 37
 
38 38
 }
Please login to merge, or discard this patch.
lib/public/Notification/INotifier.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,29 +31,29 @@
 block discarded – undo
31 31
  */
32 32
 interface INotifier {
33 33
 
34
-	/**
35
-	 * Identifier of the notifier, only use [a-z0-9_]
36
-	 *
37
-	 * @return string
38
-	 * @since 17.0.0
39
-	 */
40
-	public function getID(): string;
34
+    /**
35
+     * Identifier of the notifier, only use [a-z0-9_]
36
+     *
37
+     * @return string
38
+     * @since 17.0.0
39
+     */
40
+    public function getID(): string;
41 41
 
42
-	/**
43
-	 * Human readable name describing the notifier
44
-	 *
45
-	 * @return string
46
-	 * @since 17.0.0
47
-	 */
48
-	public function getName(): string;
42
+    /**
43
+     * Human readable name describing the notifier
44
+     *
45
+     * @return string
46
+     * @since 17.0.0
47
+     */
48
+    public function getName(): string;
49 49
 
50
-	/**
51
-	 * @param INotification $notification
52
-	 * @param string $languageCode The code of the language that should be used to prepare the notification
53
-	 * @return INotification
54
-	 * @throws \InvalidArgumentException When the notification was not prepared by a notifier
55
-	 * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
56
-	 * @since 9.0.0
57
-	 */
58
-	public function prepare(INotification $notification, string $languageCode): INotification;
50
+    /**
51
+     * @param INotification $notification
52
+     * @param string $languageCode The code of the language that should be used to prepare the notification
53
+     * @return INotification
54
+     * @throws \InvalidArgumentException When the notification was not prepared by a notifier
55
+     * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
56
+     * @since 9.0.0
57
+     */
58
+    public function prepare(INotification $notification, string $languageCode): INotification;
59 59
 }
Please login to merge, or discard this patch.
lib/public/Notification/IAction.php 1 patch
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -31,99 +31,99 @@
 block discarded – undo
31 31
  */
32 32
 interface IAction {
33 33
 
34
-	/**
35
-	 * @since 17.0.0
36
-	 */
37
-	public const TYPE_GET = 'GET';
38
-	/**
39
-	 * @since 17.0.0
40
-	 */
41
-	public const TYPE_POST = 'POST';
42
-	/**
43
-	 * @since 17.0.0
44
-	 */
45
-	public const TYPE_PUT = 'PUT';
46
-	/**
47
-	 * @since 17.0.0
48
-	 */
49
-	public const TYPE_DELETE = 'DELETE';
50
-	/**
51
-	 * @since 17.0.0
52
-	 */
53
-	public const TYPE_WEB = 'WEB';
34
+    /**
35
+     * @since 17.0.0
36
+     */
37
+    public const TYPE_GET = 'GET';
38
+    /**
39
+     * @since 17.0.0
40
+     */
41
+    public const TYPE_POST = 'POST';
42
+    /**
43
+     * @since 17.0.0
44
+     */
45
+    public const TYPE_PUT = 'PUT';
46
+    /**
47
+     * @since 17.0.0
48
+     */
49
+    public const TYPE_DELETE = 'DELETE';
50
+    /**
51
+     * @since 17.0.0
52
+     */
53
+    public const TYPE_WEB = 'WEB';
54 54
 
55
-	/**
56
-	 * @param string $label
57
-	 * @return $this
58
-	 * @throws \InvalidArgumentException if the label is invalid
59
-	 * @since 9.0.0
60
-	 */
61
-	public function setLabel(string $label): IAction;
55
+    /**
56
+     * @param string $label
57
+     * @return $this
58
+     * @throws \InvalidArgumentException if the label is invalid
59
+     * @since 9.0.0
60
+     */
61
+    public function setLabel(string $label): IAction;
62 62
 
63
-	/**
64
-	 * @return string
65
-	 * @since 9.0.0
66
-	 */
67
-	public function getLabel(): string;
63
+    /**
64
+     * @return string
65
+     * @since 9.0.0
66
+     */
67
+    public function getLabel(): string;
68 68
 
69
-	/**
70
-	 * @param string $label
71
-	 * @return $this
72
-	 * @throws \InvalidArgumentException if the label is invalid
73
-	 * @since 9.0.0
74
-	 */
75
-	public function setParsedLabel(string $label): IAction;
69
+    /**
70
+     * @param string $label
71
+     * @return $this
72
+     * @throws \InvalidArgumentException if the label is invalid
73
+     * @since 9.0.0
74
+     */
75
+    public function setParsedLabel(string $label): IAction;
76 76
 
77
-	/**
78
-	 * @return string
79
-	 * @since 9.0.0
80
-	 */
81
-	public function getParsedLabel(): string;
77
+    /**
78
+     * @return string
79
+     * @since 9.0.0
80
+     */
81
+    public function getParsedLabel(): string;
82 82
 
83
-	/**
84
-	 * @param bool $primary
85
-	 * @return $this
86
-	 * @throws \InvalidArgumentException if $primary is invalid
87
-	 * @since 9.0.0
88
-	 */
89
-	public function setPrimary(bool $primary): IAction;
83
+    /**
84
+     * @param bool $primary
85
+     * @return $this
86
+     * @throws \InvalidArgumentException if $primary is invalid
87
+     * @since 9.0.0
88
+     */
89
+    public function setPrimary(bool $primary): IAction;
90 90
 
91
-	/**
92
-	 * @return bool
93
-	 * @since 9.0.0
94
-	 */
95
-	public function isPrimary(): bool;
91
+    /**
92
+     * @return bool
93
+     * @since 9.0.0
94
+     */
95
+    public function isPrimary(): bool;
96 96
 
97
-	/**
98
-	 * @param string $link
99
-	 * @param string $requestType
100
-	 * @return $this
101
-	 * @throws \InvalidArgumentException if the link is invalid
102
-	 * @since 9.0.0
103
-	 */
104
-	public function setLink(string $link, string $requestType): IAction;
97
+    /**
98
+     * @param string $link
99
+     * @param string $requestType
100
+     * @return $this
101
+     * @throws \InvalidArgumentException if the link is invalid
102
+     * @since 9.0.0
103
+     */
104
+    public function setLink(string $link, string $requestType): IAction;
105 105
 
106
-	/**
107
-	 * @return string
108
-	 * @since 9.0.0
109
-	 */
110
-	public function getLink(): string;
106
+    /**
107
+     * @return string
108
+     * @since 9.0.0
109
+     */
110
+    public function getLink(): string;
111 111
 
112
-	/**
113
-	 * @return string
114
-	 * @since 9.0.0
115
-	 */
116
-	public function getRequestType(): string;
112
+    /**
113
+     * @return string
114
+     * @since 9.0.0
115
+     */
116
+    public function getRequestType(): string;
117 117
 
118
-	/**
119
-	 * @return bool
120
-	 * @since 9.0.0
121
-	 */
122
-	public function isValid(): bool;
118
+    /**
119
+     * @return bool
120
+     * @since 9.0.0
121
+     */
122
+    public function isValid(): bool;
123 123
 
124
-	/**
125
-	 * @return bool
126
-	 * @since 9.0.0
127
-	 */
128
-	public function isValidParsed(): bool;
124
+    /**
125
+     * @return bool
126
+     * @since 9.0.0
127
+     */
128
+    public function isValidParsed(): bool;
129 129
 }
Please login to merge, or discard this patch.
lib/public/Notification/INotification.php 1 patch
Indentation   +290 added lines, -290 removed lines patch added patch discarded remove patch
@@ -31,294 +31,294 @@
 block discarded – undo
31 31
  * @since 9.0.0
32 32
  */
33 33
 interface INotification {
34
-	/**
35
-	 * @param string $app
36
-	 * @return $this
37
-	 * @throws \InvalidArgumentException if the app id is invalid
38
-	 * @since 9.0.0
39
-	 */
40
-	public function setApp(string $app): INotification;
41
-
42
-	/**
43
-	 * @return string
44
-	 * @since 9.0.0
45
-	 */
46
-	public function getApp(): string;
47
-
48
-	/**
49
-	 * @param string $user
50
-	 * @return $this
51
-	 * @throws \InvalidArgumentException if the user id is invalid
52
-	 * @since 9.0.0
53
-	 */
54
-	public function setUser(string $user): INotification;
55
-
56
-	/**
57
-	 * @return string
58
-	 * @since 9.0.0
59
-	 */
60
-	public function getUser(): string;
61
-
62
-	/**
63
-	 * @param \DateTime $dateTime
64
-	 * @return $this
65
-	 * @throws \InvalidArgumentException if the $dateTime is invalid
66
-	 * @since 9.0.0
67
-	 */
68
-	public function setDateTime(\DateTime $dateTime): INotification;
69
-
70
-	/**
71
-	 * @return \DateTime
72
-	 * @since 9.0.0
73
-	 */
74
-	public function getDateTime(): \DateTime;
75
-
76
-	/**
77
-	 * @param string $type
78
-	 * @param string $id
79
-	 * @return $this
80
-	 * @throws \InvalidArgumentException if the object type or id is invalid
81
-	 * @since 9.0.0
82
-	 */
83
-	public function setObject(string $type, string $id): INotification;
84
-
85
-	/**
86
-	 * @return string
87
-	 * @since 9.0.0
88
-	 */
89
-	public function getObjectType(): string;
90
-
91
-	/**
92
-	 * @return string
93
-	 * @since 9.0.0
94
-	 */
95
-	public function getObjectId(): string;
96
-
97
-	/**
98
-	 * @param string $subject
99
-	 * @param array $parameters
100
-	 * @return $this
101
-	 * @throws \InvalidArgumentException if the subject or parameters are invalid
102
-	 * @since 9.0.0
103
-	 */
104
-	public function setSubject(string $subject, array $parameters = []): INotification;
105
-
106
-	/**
107
-	 * @return string
108
-	 * @since 9.0.0
109
-	 */
110
-	public function getSubject(): string;
111
-
112
-	/**
113
-	 * @return array
114
-	 * @since 9.0.0
115
-	 */
116
-	public function getSubjectParameters(): array;
117
-
118
-	/**
119
-	 * Set a parsed subject
120
-	 *
121
-	 * HTML is not allowed in the parsed subject and will be escaped
122
-	 * automatically by the clients. You can use the RichObjectString system
123
-	 * provided by the Nextcloud server to highlight important parameters via
124
-	 * the setRichSubject method, but make sure, that a plain text message is
125
-	 * always set via setParsedSubject, to support clients which can not handle
126
-	 * rich strings.
127
-	 *
128
-	 * See https://github.com/nextcloud/server/issues/1706 for more information.
129
-	 *
130
-	 * @param string $subject
131
-	 * @return $this
132
-	 * @throws \InvalidArgumentException if the subject is invalid
133
-	 * @since 9.0.0
134
-	 */
135
-	public function setParsedSubject(string $subject): INotification;
136
-
137
-	/**
138
-	 * @return string
139
-	 * @since 9.0.0
140
-	 */
141
-	public function getParsedSubject(): string;
142
-
143
-	/**
144
-	 * Set a RichObjectString subject
145
-	 *
146
-	 * HTML is not allowed in the rich subject and will be escaped automatically
147
-	 * by the clients, but you can use the RichObjectString system provided by
148
-	 * the Nextcloud server to highlight important parameters.
149
-	 * Also make sure, that a plain text subject is always set via
150
-	 * setParsedSubject, to support clients which can not handle rich strings.
151
-	 *
152
-	 * See https://github.com/nextcloud/server/issues/1706 for more information.
153
-	 *
154
-	 * @param string $subject
155
-	 * @param array $parameters
156
-	 * @return $this
157
-	 * @throws \InvalidArgumentException if the subject or parameters are invalid
158
-	 * @since 11.0.0
159
-	 */
160
-	public function setRichSubject(string $subject, array $parameters = []): INotification;
161
-
162
-	/**
163
-	 * @return string
164
-	 * @since 11.0.0
165
-	 */
166
-	public function getRichSubject(): string;
167
-
168
-	/**
169
-	 * @return array[]
170
-	 * @since 11.0.0
171
-	 */
172
-	public function getRichSubjectParameters(): array;
173
-
174
-	/**
175
-	 * @param string $message
176
-	 * @param array $parameters
177
-	 * @return $this
178
-	 * @throws \InvalidArgumentException if the message or parameters are invalid
179
-	 * @since 9.0.0
180
-	 */
181
-	public function setMessage(string $message, array $parameters = []): INotification;
182
-
183
-	/**
184
-	 * @return string
185
-	 * @since 9.0.0
186
-	 */
187
-	public function getMessage(): string;
188
-
189
-	/**
190
-	 * @return array
191
-	 * @since 9.0.0
192
-	 */
193
-	public function getMessageParameters(): array;
194
-
195
-	/**
196
-	 * Set a parsed message
197
-	 *
198
-	 * HTML is not allowed in the parsed message and will be escaped
199
-	 * automatically by the clients. You can use the RichObjectString system
200
-	 * provided by the Nextcloud server to highlight important parameters via
201
-	 * the setRichMessage method, but make sure, that a plain text message is
202
-	 * always set via setParsedMessage, to support clients which can not handle
203
-	 * rich strings.
204
-	 *
205
-	 * See https://github.com/nextcloud/server/issues/1706 for more information.
206
-	 *
207
-	 * @param string $message
208
-	 * @return $this
209
-	 * @throws \InvalidArgumentException if the message is invalid
210
-	 * @since 9.0.0
211
-	 */
212
-	public function setParsedMessage(string $message): INotification;
213
-
214
-	/**
215
-	 * @return string
216
-	 * @since 9.0.0
217
-	 */
218
-	public function getParsedMessage(): string;
219
-
220
-	/**
221
-	 * Set a RichObjectString message
222
-	 *
223
-	 * HTML is not allowed in the rich message and will be escaped automatically
224
-	 * by the clients, but you can use the RichObjectString system provided by
225
-	 * the Nextcloud server to highlight important parameters.
226
-	 * Also make sure, that a plain text message is always set via
227
-	 * setParsedMessage, to support clients which can not handle rich strings.
228
-	 *
229
-	 * See https://github.com/nextcloud/server/issues/1706 for more information.
230
-	 *
231
-	 * @param string $message
232
-	 * @param array $parameters
233
-	 * @return $this
234
-	 * @throws \InvalidArgumentException if the message or parameters are invalid
235
-	 * @since 11.0.0
236
-	 */
237
-	public function setRichMessage(string $message, array $parameters = []): INotification;
238
-
239
-	/**
240
-	 * @return string
241
-	 * @since 11.0.0
242
-	 */
243
-	public function getRichMessage(): string;
244
-
245
-	/**
246
-	 * @return array[]
247
-	 * @since 11.0.0
248
-	 */
249
-	public function getRichMessageParameters(): array;
250
-
251
-	/**
252
-	 * @param string $link
253
-	 * @return $this
254
-	 * @throws \InvalidArgumentException if the link is invalid
255
-	 * @since 9.0.0
256
-	 */
257
-	public function setLink(string $link): INotification;
258
-
259
-	/**
260
-	 * @return string
261
-	 * @since 9.0.0
262
-	 */
263
-	public function getLink(): string;
264
-
265
-	/**
266
-	 * @param string $icon
267
-	 * @return $this
268
-	 * @throws \InvalidArgumentException if the icon is invalid
269
-	 * @since 11.0.0
270
-	 */
271
-	public function setIcon(string $icon): INotification;
272
-
273
-	/**
274
-	 * @return string
275
-	 * @since 11.0.0
276
-	 */
277
-	public function getIcon(): string;
278
-
279
-	/**
280
-	 * @return IAction
281
-	 * @since 9.0.0
282
-	 */
283
-	public function createAction(): IAction;
284
-
285
-	/**
286
-	 * @param IAction $action
287
-	 * @return $this
288
-	 * @throws \InvalidArgumentException if the action is invalid
289
-	 * @since 9.0.0
290
-	 */
291
-	public function addAction(IAction $action): INotification;
292
-
293
-	/**
294
-	 * @return IAction[]
295
-	 * @since 9.0.0
296
-	 */
297
-	public function getActions(): array;
298
-
299
-	/**
300
-	 * @param IAction $action
301
-	 * @return $this
302
-	 * @throws \InvalidArgumentException if the action is invalid
303
-	 * @since 9.0.0
304
-	 */
305
-	public function addParsedAction(IAction $action): INotification;
306
-
307
-	/**
308
-	 * @return IAction[]
309
-	 * @since 9.0.0
310
-	 */
311
-	public function getParsedActions(): array;
312
-
313
-	/**
314
-	 * @return bool
315
-	 * @since 9.0.0
316
-	 */
317
-	public function isValid(): bool;
318
-
319
-	/**
320
-	 * @return bool
321
-	 * @since 9.0.0
322
-	 */
323
-	public function isValidParsed(): bool;
34
+    /**
35
+     * @param string $app
36
+     * @return $this
37
+     * @throws \InvalidArgumentException if the app id is invalid
38
+     * @since 9.0.0
39
+     */
40
+    public function setApp(string $app): INotification;
41
+
42
+    /**
43
+     * @return string
44
+     * @since 9.0.0
45
+     */
46
+    public function getApp(): string;
47
+
48
+    /**
49
+     * @param string $user
50
+     * @return $this
51
+     * @throws \InvalidArgumentException if the user id is invalid
52
+     * @since 9.0.0
53
+     */
54
+    public function setUser(string $user): INotification;
55
+
56
+    /**
57
+     * @return string
58
+     * @since 9.0.0
59
+     */
60
+    public function getUser(): string;
61
+
62
+    /**
63
+     * @param \DateTime $dateTime
64
+     * @return $this
65
+     * @throws \InvalidArgumentException if the $dateTime is invalid
66
+     * @since 9.0.0
67
+     */
68
+    public function setDateTime(\DateTime $dateTime): INotification;
69
+
70
+    /**
71
+     * @return \DateTime
72
+     * @since 9.0.0
73
+     */
74
+    public function getDateTime(): \DateTime;
75
+
76
+    /**
77
+     * @param string $type
78
+     * @param string $id
79
+     * @return $this
80
+     * @throws \InvalidArgumentException if the object type or id is invalid
81
+     * @since 9.0.0
82
+     */
83
+    public function setObject(string $type, string $id): INotification;
84
+
85
+    /**
86
+     * @return string
87
+     * @since 9.0.0
88
+     */
89
+    public function getObjectType(): string;
90
+
91
+    /**
92
+     * @return string
93
+     * @since 9.0.0
94
+     */
95
+    public function getObjectId(): string;
96
+
97
+    /**
98
+     * @param string $subject
99
+     * @param array $parameters
100
+     * @return $this
101
+     * @throws \InvalidArgumentException if the subject or parameters are invalid
102
+     * @since 9.0.0
103
+     */
104
+    public function setSubject(string $subject, array $parameters = []): INotification;
105
+
106
+    /**
107
+     * @return string
108
+     * @since 9.0.0
109
+     */
110
+    public function getSubject(): string;
111
+
112
+    /**
113
+     * @return array
114
+     * @since 9.0.0
115
+     */
116
+    public function getSubjectParameters(): array;
117
+
118
+    /**
119
+     * Set a parsed subject
120
+     *
121
+     * HTML is not allowed in the parsed subject and will be escaped
122
+     * automatically by the clients. You can use the RichObjectString system
123
+     * provided by the Nextcloud server to highlight important parameters via
124
+     * the setRichSubject method, but make sure, that a plain text message is
125
+     * always set via setParsedSubject, to support clients which can not handle
126
+     * rich strings.
127
+     *
128
+     * See https://github.com/nextcloud/server/issues/1706 for more information.
129
+     *
130
+     * @param string $subject
131
+     * @return $this
132
+     * @throws \InvalidArgumentException if the subject is invalid
133
+     * @since 9.0.0
134
+     */
135
+    public function setParsedSubject(string $subject): INotification;
136
+
137
+    /**
138
+     * @return string
139
+     * @since 9.0.0
140
+     */
141
+    public function getParsedSubject(): string;
142
+
143
+    /**
144
+     * Set a RichObjectString subject
145
+     *
146
+     * HTML is not allowed in the rich subject and will be escaped automatically
147
+     * by the clients, but you can use the RichObjectString system provided by
148
+     * the Nextcloud server to highlight important parameters.
149
+     * Also make sure, that a plain text subject is always set via
150
+     * setParsedSubject, to support clients which can not handle rich strings.
151
+     *
152
+     * See https://github.com/nextcloud/server/issues/1706 for more information.
153
+     *
154
+     * @param string $subject
155
+     * @param array $parameters
156
+     * @return $this
157
+     * @throws \InvalidArgumentException if the subject or parameters are invalid
158
+     * @since 11.0.0
159
+     */
160
+    public function setRichSubject(string $subject, array $parameters = []): INotification;
161
+
162
+    /**
163
+     * @return string
164
+     * @since 11.0.0
165
+     */
166
+    public function getRichSubject(): string;
167
+
168
+    /**
169
+     * @return array[]
170
+     * @since 11.0.0
171
+     */
172
+    public function getRichSubjectParameters(): array;
173
+
174
+    /**
175
+     * @param string $message
176
+     * @param array $parameters
177
+     * @return $this
178
+     * @throws \InvalidArgumentException if the message or parameters are invalid
179
+     * @since 9.0.0
180
+     */
181
+    public function setMessage(string $message, array $parameters = []): INotification;
182
+
183
+    /**
184
+     * @return string
185
+     * @since 9.0.0
186
+     */
187
+    public function getMessage(): string;
188
+
189
+    /**
190
+     * @return array
191
+     * @since 9.0.0
192
+     */
193
+    public function getMessageParameters(): array;
194
+
195
+    /**
196
+     * Set a parsed message
197
+     *
198
+     * HTML is not allowed in the parsed message and will be escaped
199
+     * automatically by the clients. You can use the RichObjectString system
200
+     * provided by the Nextcloud server to highlight important parameters via
201
+     * the setRichMessage method, but make sure, that a plain text message is
202
+     * always set via setParsedMessage, to support clients which can not handle
203
+     * rich strings.
204
+     *
205
+     * See https://github.com/nextcloud/server/issues/1706 for more information.
206
+     *
207
+     * @param string $message
208
+     * @return $this
209
+     * @throws \InvalidArgumentException if the message is invalid
210
+     * @since 9.0.0
211
+     */
212
+    public function setParsedMessage(string $message): INotification;
213
+
214
+    /**
215
+     * @return string
216
+     * @since 9.0.0
217
+     */
218
+    public function getParsedMessage(): string;
219
+
220
+    /**
221
+     * Set a RichObjectString message
222
+     *
223
+     * HTML is not allowed in the rich message and will be escaped automatically
224
+     * by the clients, but you can use the RichObjectString system provided by
225
+     * the Nextcloud server to highlight important parameters.
226
+     * Also make sure, that a plain text message is always set via
227
+     * setParsedMessage, to support clients which can not handle rich strings.
228
+     *
229
+     * See https://github.com/nextcloud/server/issues/1706 for more information.
230
+     *
231
+     * @param string $message
232
+     * @param array $parameters
233
+     * @return $this
234
+     * @throws \InvalidArgumentException if the message or parameters are invalid
235
+     * @since 11.0.0
236
+     */
237
+    public function setRichMessage(string $message, array $parameters = []): INotification;
238
+
239
+    /**
240
+     * @return string
241
+     * @since 11.0.0
242
+     */
243
+    public function getRichMessage(): string;
244
+
245
+    /**
246
+     * @return array[]
247
+     * @since 11.0.0
248
+     */
249
+    public function getRichMessageParameters(): array;
250
+
251
+    /**
252
+     * @param string $link
253
+     * @return $this
254
+     * @throws \InvalidArgumentException if the link is invalid
255
+     * @since 9.0.0
256
+     */
257
+    public function setLink(string $link): INotification;
258
+
259
+    /**
260
+     * @return string
261
+     * @since 9.0.0
262
+     */
263
+    public function getLink(): string;
264
+
265
+    /**
266
+     * @param string $icon
267
+     * @return $this
268
+     * @throws \InvalidArgumentException if the icon is invalid
269
+     * @since 11.0.0
270
+     */
271
+    public function setIcon(string $icon): INotification;
272
+
273
+    /**
274
+     * @return string
275
+     * @since 11.0.0
276
+     */
277
+    public function getIcon(): string;
278
+
279
+    /**
280
+     * @return IAction
281
+     * @since 9.0.0
282
+     */
283
+    public function createAction(): IAction;
284
+
285
+    /**
286
+     * @param IAction $action
287
+     * @return $this
288
+     * @throws \InvalidArgumentException if the action is invalid
289
+     * @since 9.0.0
290
+     */
291
+    public function addAction(IAction $action): INotification;
292
+
293
+    /**
294
+     * @return IAction[]
295
+     * @since 9.0.0
296
+     */
297
+    public function getActions(): array;
298
+
299
+    /**
300
+     * @param IAction $action
301
+     * @return $this
302
+     * @throws \InvalidArgumentException if the action is invalid
303
+     * @since 9.0.0
304
+     */
305
+    public function addParsedAction(IAction $action): INotification;
306
+
307
+    /**
308
+     * @return IAction[]
309
+     * @since 9.0.0
310
+     */
311
+    public function getParsedActions(): array;
312
+
313
+    /**
314
+     * @return bool
315
+     * @since 9.0.0
316
+     */
317
+    public function isValid(): bool;
318
+
319
+    /**
320
+     * @return bool
321
+     * @since 9.0.0
322
+     */
323
+    public function isValidParsed(): bool;
324 324
 }
Please login to merge, or discard this patch.
apps/lookup_server_connector/lib/UpdateLookupServer.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -34,51 +34,51 @@
 block discarded – undo
34 34
  * @package OCA\LookupServerConnector
35 35
  */
36 36
 class UpdateLookupServer {
37
-	/** @var IConfig */
38
-	private $config;
39
-	/** @var IJobList */
40
-	private $jobList;
37
+    /** @var IConfig */
38
+    private $config;
39
+    /** @var IJobList */
40
+    private $jobList;
41 41
 
42
-	/**
43
-	 * @param IJobList $jobList
44
-	 * @param IConfig $config
45
-	 */
46
-	public function __construct(IJobList $jobList,
47
-								IConfig $config) {
48
-		$this->config = $config;
49
-		$this->jobList = $jobList;
50
-	}
42
+    /**
43
+     * @param IJobList $jobList
44
+     * @param IConfig $config
45
+     */
46
+    public function __construct(IJobList $jobList,
47
+                                IConfig $config) {
48
+        $this->config = $config;
49
+        $this->jobList = $jobList;
50
+    }
51 51
 
52
-	/**
53
-	 * @param IUser $user
54
-	 */
55
-	public function userUpdated(IUser $user): void {
56
-		if (!$this->shouldUpdateLookupServer()) {
57
-			return;
58
-		}
52
+    /**
53
+     * @param IUser $user
54
+     */
55
+    public function userUpdated(IUser $user): void {
56
+        if (!$this->shouldUpdateLookupServer()) {
57
+            return;
58
+        }
59 59
 
60
-		// Reset retry counter
61
-		$this->config->deleteUserValue(
62
-			$user->getUID(),
63
-			'lookup_server_connector',
64
-			'update_retries'
65
-		);
66
-		$this->jobList->add(RetryJob::class, ['userId' => $user->getUID()]);
67
-	}
60
+        // Reset retry counter
61
+        $this->config->deleteUserValue(
62
+            $user->getUID(),
63
+            'lookup_server_connector',
64
+            'update_retries'
65
+        );
66
+        $this->jobList->add(RetryJob::class, ['userId' => $user->getUID()]);
67
+    }
68 68
 
69
-	/**
70
-	 * check if we should update the lookup server, we only do it if
71
-	 *
72
-	 * + we have an internet connection
73
-	 * + the lookup server update was not disabled by the admin
74
-	 * + we have a valid lookup server URL
75
-	 *
76
-	 * @return bool
77
-	 */
78
-	private function shouldUpdateLookupServer(): bool {
79
-		return $this->config->getSystemValueBool('has_internet_connection', true) === true &&
80
-			$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' &&
81
-			$this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== '';
82
-	}
69
+    /**
70
+     * check if we should update the lookup server, we only do it if
71
+     *
72
+     * + we have an internet connection
73
+     * + the lookup server update was not disabled by the admin
74
+     * + we have a valid lookup server URL
75
+     *
76
+     * @return bool
77
+     */
78
+    private function shouldUpdateLookupServer(): bool {
79
+        return $this->config->getSystemValueBool('has_internet_connection', true) === true &&
80
+            $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' &&
81
+            $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== '';
82
+    }
83 83
 
84 84
 }
Please login to merge, or discard this patch.