Completed
Branch BUG-10666-add-check-for-iconv (39eca5)
by
unknown
47:19 queued 36:07
created

ConstantsAbstract::pluginPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace EventEspresso\core\domain;
4
5
defined('EVENT_ESPRESSO_VERSION') || exit('No direct access allowed');
6
7
/**
8
 * ConstantsAbstract
9
 * A container for all constants used in this domain.
10
 *
11
 * @package EventEspresso\core\domain
12
 * @author  Darren Ethier
13
 * @since   1.0.0
14
 */
15
abstract class ConstantsAbstract
16
{
17
    /**
18
     * Equivalent to `__FILE__` for main plugin file.
19
     * @var string
20
     */
21
    private static $plugin_file ='';
22
23
24
    /**
25
     * String indicating version for plugin
26
     * @var string
27
     */
28
    private static $version = '';
29
30
31
    /**
32
     * Initializes internal static properties.
33
     * @param $plugin_file
34
     * @param $version
35
     */
36
    public static function init($plugin_file, $version)
37
    {
38
        self::$plugin_file = $plugin_file;
39
        self::$version     = $version;
40
    }
41
42
43
    /**
44
     * @return string
45
     */
46
    public static function pluginFile()
47
    {
48
        return self::$plugin_file;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public static function pluginBasename()
55
    {
56
        return plugin_basename(self::$plugin_file);
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public static function pluginPath()
63
    {
64
        return plugin_dir_path(self::$plugin_file);
65
    }
66
67
68
    /**
69
     * @return string
70
     */
71
    public static function pluginUrl()
72
    {
73
        return plugin_dir_url(self::$plugin_file);
74
    }
75
76
77
    /**
78
     * @return string
79
     */
80
    public static function version()
81
    {
82
        return self::$version;
83
    }
84
85
}