1 | <?php |
||
18 | class Jetpack_Constants { |
||
19 | static $set_constants = array(); |
||
|
|||
20 | |||
21 | /** |
||
22 | * Checks if a "constant" has been set in Jetpack_Constants, and if not, |
||
23 | * checks if the constant was defined with define( 'name', 'value ). |
||
24 | * |
||
25 | * @param $name string The name of the constant |
||
26 | * |
||
27 | * @return bool |
||
28 | */ |
||
29 | public static function is_defined( $name ) { |
||
34 | /** |
||
35 | * Checks if a "constant" has been set in Jetpack_Constants |
||
36 | * and has the value of true |
||
37 | * |
||
38 | * @param $name string The name of the constant |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | public static function is_true( $name ) { |
||
45 | |||
46 | /** |
||
47 | * Attempts to retrieve the "constant" from Jetpack_Constants, and if it hasn't been set, |
||
48 | * then attempts to get the constant with the constant() function. |
||
49 | * |
||
50 | * @param $name |
||
51 | * |
||
52 | * @return mixed null if the constant does not exist or the value of the constant. |
||
53 | */ |
||
54 | public static function get_constant( $name ) { |
||
61 | |||
62 | /** |
||
63 | * Sets the value of the "constant" within Jetpack_Constants. |
||
64 | * |
||
65 | * @param $name string The name of the "constant" |
||
66 | * @param $value string The value of the "constant" |
||
67 | */ |
||
68 | public static function set_constant( $name, $value ) { |
||
71 | |||
72 | /** |
||
73 | * Will unset a "constant" from Jetpack_Constants if the constant exists. |
||
74 | * |
||
75 | * @param $name string The name of the "constant" |
||
76 | * |
||
77 | * @return bool Whether the constant was removed. |
||
78 | */ |
||
79 | public static function clear_single_constant( $name ) { |
||
87 | |||
88 | /** |
||
89 | * Resets all of the constants within Jetpack_Constants. |
||
90 | */ |
||
91 | public static function clear_constants() { |
||
94 | } |
||
95 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.