Completed
Push — master ( 5e98ad...5c516d )
by Alexey
04:03
created

SocialHelper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getObject() 0 7 1
A getConfig() 0 9 2
A checkAppAccess() 0 4 1
1
<?php
2
3
/**
4
 * Social helper
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2015 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Users;
13
14
class SocialHelper extends \Object
15
{
16
    public static function getObject()
17
    {
18
        $class = get_called_class();
19
        $class = substr($class, strrpos($class, '\\') + 1);
20
        $object = Social::get($class, 'object_name');
21
        return $object;
22
    }
23
24
    public static function getConfig()
25
    {
26
        $object = static::getObject();
27
        $configs = [];
28
        foreach ($object->configs as $config) {
29
            $configs[$config->name] = $config->value;
30
        }
31
        return $configs;
32
    }
33
34
    public static function checkAppAccess()
35
    {
36
        return false;
37
    }
38
39
}
40