Completed
Push — update/Jetpack_Sync_Settings_s... ( 4d7a03 )
by
unknown
114:48 queued 104:56
created

Jetpack_Sync_Settings::reset_data()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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();
0 ignored issues
show
Unused Code introduced by
The call to the method Automattic\Jetpack\Sync\Settings::is_sending() seems un-needed as the method has no side-effects.

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:

class User
{
    private $email;

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

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:

$user = new User();
$user->getEmail(); // This line could safely be removed as it has no effect.

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:

$user = new User();
$user->setEmail('email@domain'); // This line has a side-effect (it changes an
                                 // instance variable).
Loading history...
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