WPApi   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 6
c 2
b 0
f 2
lcom 2
cbo 2
dl 0
loc 52
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __clone() 0 3 1
A plugin() 0 8 2
A theme() 0 8 2
1
<?php
2
3
namespace WPApi;
4
5
class WPApi
6
{
7
    /**
8
     * Plugin instance.
9
     *
10
     * @var Plugin
11
     */
12
    private static $plugin;
13
14
    /**
15
     * Theme instance.
16
     *
17
     * @var Theme
18
     */
19
    private static $theme;
20
21
    private function __construct()
22
    {
23
    }
24
25
    private function __clone()
26
    {
27
    }
28
29
    /**
30
     * create plugin instance.
31
     *
32
     * @return Plugin
33
     */
34
    public static function plugin()
35
    {
36
        if (!self::$plugin) {
37
            self::$plugin = new Plugin();
38
        }
39
40
        return self::$plugin;
41
    }
42
43
    /**
44
     * create theme instance.
45
     *
46
     * @return Theme
47
     */
48
    public static function theme()
49
    {
50
        if (!self::$theme) {
51
            self::$theme = new Theme();
52
        }
53
54
        return self::$theme;
55
    }
56
}
57