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 | /** |
||
36 | * Attempts to retrieve the "constant" from Jetpack_Constants, and if it hasn't been set, |
||
37 | * then attempts to get the constant with the constant() function. |
||
38 | * |
||
39 | * @param $name |
||
40 | * |
||
41 | * @return mixed null if the constant does not exist or the value of the constant. |
||
42 | */ |
||
43 | public static function get_constant( $name ) { |
||
50 | |||
51 | /** |
||
52 | * Sets the value of the "constant" within Jetpack_Constants. |
||
53 | * |
||
54 | * @param $name string The name of the "constant" |
||
55 | * @param $value string The value of the "constant" |
||
56 | */ |
||
57 | public static function set_constant( $name, $value ) { |
||
60 | |||
61 | /** |
||
62 | * Will unset a "constant" from Jetpack_Constants if the constant exists. |
||
63 | * |
||
64 | * @param $name string The name of the "constant" |
||
65 | * |
||
66 | * @return bool Whether the constant was removed. |
||
67 | */ |
||
68 | public static function clear_single_constant( $name ) { |
||
76 | |||
77 | /** |
||
78 | * Resets all of the constants within Jetpack_Constants. |
||
79 | */ |
||
80 | public static function clear_constants() { |
||
83 | } |
||
84 |
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.