Completed
Push — master ( 2700b4...4ccb05 )
by Torben
04:03 queued 02:37
created

SettingsService::getClearCacheUids()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
ccs 9
cts 9
cp 1
cc 4
nc 8
nop 1
crap 4
1
<?php
2
namespace DERHANSEN\SfEventMgt\Service;
3
4
/*
5
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.txt file that was distributed with this source code.
9
 */
10
11
/**
12
 * SettingsService
13
 *
14
 * @author Torben Hansen <[email protected]>
15
 */
16
class SettingsService
17
{
18
    /**
19
     * Returns an array (key-value pair) of custom notifications that can be used in
20
     * select boxes
21
     *
22
     * @param array $settings Settings
23
     *
24
     * @return array
25
     */
26
    public function getCustomNotifications($settings)
27
    {
28
        if (!is_array($settings['notification']['customNotifications'])) {
29
            return [];
30
        }
31
        $notifications = [];
32
        foreach ($settings['notification']['customNotifications'] as $notificationKey => $notificationValue) {
33 6
            $notifications[$notificationKey] = $notificationValue['title'];
34
        }
35 6
36 2
        return $notifications;
37
    }
38
}
39