@@ -51,7 +51,7 @@ public function __construct(
5151 * @param string $type One of the activity types, 'batchtime' or 'self'
5252 * @return bool|int
5353 */
54- public function getUserSetting ($ user , $ method , $ type ) {
54+ public function getUserSetting (string $ user , string $ method , string $ type ): bool | int {
5555 if ($ method === 'email ' && $ this ->config ->getAppValue ('activity ' , 'enable_email ' , 'yes ' ) === 'no ' ) {
5656 return false ;
5757 }
@@ -86,7 +86,7 @@ public function getUserSetting($user, $method, $type) {
8686 * @param string $type
8787 * @return bool|int
8888 */
89- public function getAdminSetting ($ method , $ type ) {
89+ public function getAdminSetting (string $ method , string $ type ): bool | int {
9090 $ defaultSetting = $ this ->getDefaultSetting ($ method , $ type );
9191 if (is_bool ($ defaultSetting )) {
9292 return (bool )$ this ->config ->getAppValue (
@@ -110,7 +110,7 @@ public function getAdminSetting($method, $type) {
110110 * @param string $type One of the activity types, 'batchtime', 'self' or 'selfemail'
111111 * @return bool|int
112112 */
113- protected function getDefaultSetting ($ method , $ type ) {
113+ protected function getDefaultSetting (string $ method , string $ type ): bool | int {
114114 if ($ method === 'setting ' ) {
115115 if ($ type === 'batchtime ' ) {
116116 return self ::BATCH_TIME_HOURLY ;
@@ -149,7 +149,7 @@ protected function getDefaultSetting($method, $type) {
149149 * @param string $type One of the activity types, 'batchtime', 'self' or 'selfemail'
150150 * @return bool
151151 */
152- protected function canModifySetting ($ method , $ type ) {
152+ protected function canModifySetting (string $ method , string $ type ): bool {
153153 if ($ method === 'setting ' ) {
154154 return true ;
155155 }
@@ -172,7 +172,7 @@ protected function canModifySetting($method, $type) {
172172 /**
173173 * Get a list with all notification types
174174 */
175- public function getNotificationTypes () {
175+ public function getNotificationTypes (): array {
176176 $ settings = $ this ->manager ->getSettings ();
177177
178178 $ return = array_map (function (ActivitySettings $ setting ) {
@@ -198,7 +198,7 @@ public function getNotificationTypes() {
198198 * @return array Returns a "username => b:true" Map for method = notification
199199 * Returns a "username => i:batchtime" Map for method = email
200200 */
201- public function filterUsersBySetting ($ users , $ method , $ type ) {
201+ public function filterUsersBySetting (array $ users , string $ method , string $ type ): array {
202202 if (empty ($ users )) {
203203 return [];
204204 }
0 commit comments