Completed
Push — 2.0 ( d81882...c954a2 )
by Nicolas
15:27
created

helpers.php ➔ current_permission_value()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 3
nop 3
dl 0
loc 11
rs 9.4285
1
<?php
2
3
if (function_exists('current_permission_value') === false) {
4
    function current_permission_value($model, $permissionTitle, $permissionAction)
5
    {
6
        $value = array_get($model->permissions, "$permissionTitle.$permissionAction");
7
        if ($value === true) {
8
            return 1;
9
        }
10
        if ($value === false) {
11
            return -1;
12
        }
13
        return 0;
14
    }
15
}
16