|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use Automattic\Jetpack\Sync\Settings; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class Jetpack_Sync_Settings |
|
7
|
|
|
* |
|
8
|
|
|
* @deprecated Use Automattic\Jetpack\Sync\Settings |
|
9
|
|
|
*/ |
|
10
|
|
|
class Jetpack_Sync_Settings { |
|
11
|
|
|
|
|
12
|
|
|
static function get_settings() { |
|
13
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
14
|
|
|
return Settings::get_settings(); |
|
15
|
|
|
} |
|
16
|
|
|
|
|
17
|
|
|
static function get_setting( $setting ) { |
|
18
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
19
|
|
|
return Settings::get_setting( $setting ); |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
static function update_settings( $new_settings ) { |
|
23
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
24
|
|
|
Settings::update_settings( $new_settings ); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
static function is_network_setting( $setting ) { |
|
28
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
29
|
|
|
return Settings::is_network_setting( $setting ); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
static function get_blacklisted_post_types_sql() { |
|
33
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
34
|
|
|
return Settings::get_blacklisted_post_types_sql(); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
static function get_whitelisted_post_meta_sql() { |
|
38
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
39
|
|
|
return Settings::get_whitelisted_post_meta_sql(); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
static function get_whitelisted_comment_meta_sql() { |
|
43
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
44
|
|
|
return Settings::get_whitelisted_comment_meta_sql(); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
static function get_comments_filter_sql() { |
|
48
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
49
|
|
|
return Settings::get_comments_filter_sql(); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
static function reset_data() { |
|
53
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
54
|
|
|
Settings::reset_data(); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
static function set_importing( $is_importing ) { |
|
58
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
59
|
|
|
Settings::set_importing( $is_importing ); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
static function is_importing() { |
|
63
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
64
|
|
|
Settings::is_importing(); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
static function is_sync_enabled() { |
|
68
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
69
|
|
|
Settings::is_sync_enabled(); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
static function set_doing_cron( $is_doing_cron ) { |
|
73
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
74
|
|
|
Settings::set_doing_cron( $is_doing_cron ); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
static function is_doing_cron() { |
|
78
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
79
|
|
|
Settings::is_doing_cron(); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
static function is_syncing() { |
|
83
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
84
|
|
|
return Settings::is_syncing(); |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
static function set_is_syncing( $is_syncing ) { |
|
88
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
89
|
|
|
Settings::set_is_syncing( $is_syncing ); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
static function is_sending() { |
|
93
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
94
|
|
|
Settings::is_sending(); |
|
|
|
|
|
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
static function set_is_sending( $is_sending ) { |
|
98
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Settings' ); |
|
99
|
|
|
Settings::set_is_sending( $is_sending ); |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
} |
|
103
|
|
|
|
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail(), this method _has_ side-effects. In the following case, we could not remove the method call: