WPApi::__clone()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
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