DraftNotificationsVariable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 23
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUserGroupOptions() 0 5 1
A getUserGroupOption() 0 6 1
1
<?php
2
3
namespace Craft;
4
5
/**
6
 * Draft notifications variable.
7
 */
8
class DraftNotificationsVariable
9
{
10
11
    /**
12
     * @return array
13
     */
14 8
    public function getUserGroupOptions()
15
    {
16 8
        $userGroups = craft()->userGroups->getAllGroups();
17 8
        return array_map(array($this, 'getUserGroupOption'), $userGroups);
18
    }
19
20
    /**
21
     * @param UserGroupModel $group
22
     * @return array
23
     */
24 6
    private function getUserGroupOption(UserGroupModel $group) {
25
        return array(
26 6
            'label' => $group->name,
27 6
            'value' => $group->handle,
28 6
        );
29
    }
30
}