Passed
Push — 441-mapping-wordpress-id-field... ( a67f11...c8777d )
by Jonathan
03:35
created

Object_Sync_Sf_Sync_Transients::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 3
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Handles getting and setting the transients.
4
 *
5
 * @class   Object_Sync_Sf_Sync_Transients
6
 * @package Object_Sync_Salesforce
7
 */
8
9
defined( 'ABSPATH' ) || exit;
10
11
/**
12
 * Object_Sync_Sf_Sync_Transients class.
13
 */
14
class Object_Sync_Sf_Sync_Transients {
15
16
	/**
17
	 * Current version of the plugin
18
	 *
19
	 * @var string
20
	 */
21
	public $version;
22
23
	/**
24
	 * The plugin's prefix when saving options to the database
25
	 *
26
	 * @var string
27
	 */
28
	public $option_prefix;
29
30
	/**
31
	 * Transient keys that can be upgraded
32
	 *
33
	 * @var string
34
	 * @deprecated   this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version.
35
	 */
36
	private $upgradeable_keys;
37
38
	/**
39
	 * Constructor for transient records class
40
	 */
41
	public function __construct() {
42
		$this->version          = object_sync_for_salesforce()->version;
43
		$this->option_prefix    = object_sync_for_salesforce()->option_prefix;
44
		$this->upgradeable_keys = $this->get_upgradeable_keys();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->get_upgradeable_keys() of type array is incompatible with the declared type string of property $upgradeable_keys.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

44
		/** @scrutinizer ignore-deprecated */ $this->upgradeable_keys = $this->get_upgradeable_keys();

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...:get_upgradeable_keys() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

44
		$this->upgradeable_keys = /** @scrutinizer ignore-deprecated */ $this->get_upgradeable_keys();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
45
46
	}
47
48
	/**
49
	 * Generate a transient key
50
	 *
51
	 * @param array $params the pieces to put together.
52
	 * @param bool  $legacy whether this is a legacy key. This is for deprecated keys and will be removed in a future version.
53
	 * @return string $key the full transient key.
54
	 */
55
	private function generate_transient_key( $params, $legacy = false ) {
56
		array_unshift( $params, substr( $this->option_prefix, 0, -1 ) ); // add the prefixes.
57
		$params = array_filter( $params, fn( $value ) => ! is_null( $value ) && '' !== $value ); // remove null and empty values.
58
59
		// legacy keys don't have a fieldmap.
60
		if ( true === $legacy && isset( $params['fieldmap_id'] ) ) {
61
			unset( $params['fieldmap_id'] );
62
		}
63
64
		// make the key a string.
65
		$key = implode( '_', $params );
66
67
		// note: the WordPress codex indicates that option names do not need to be escaped.
68
		// see: https://developer.wordpress.org/reference/functions/update_option/.
69
70
		return $key;
71
	}
72
73
	/**
74
	 * Set individual transient records for sync operations
75
	 *
76
	 * @param string $operation what is the transient related to? last pull, current pull, merge, delete, etc.
77
	 * @param string $object_type the Salesforce object type.
78
	 * @param int    $fieldmap_id the ID of the specific fieldmap that is running.
79
	 * @param mixed  $value the value to be saved in the option.
80
	 * @param int    $expiration whether to expire the transient.
81
	 * @return bool  $result value of the save operation.
82
	 */
83
	public function set( $operation, $object_type = '', $fieldmap_id = '', $value = '', $expiration = 0 ) {
84
		// generate the option key parameters.
85
		$params = array(
86
			'operation'   => $operation,
87
			'object_type' => $object_type,
88
			'fieldmap_id' => $fieldmap_id,
89
		);
90
		$key    = $this->generate_transient_key( $params );
91
		$value  = isset( $value ) ? $value : '';
92
93
		/*
94
		 * examples
95
		 * object_sync_for_salesforce_pull_last_sync_Contact_1
96
		 * object_sync_for_salesforce_currently_pulling_query_Contact_1
97
		 * object_sync_for_salesforce_pull_merge_last_Contact_1
98
		 * object_sync_for_salesforce_pull_delete_last_Contact_1
99
		 */
100
101
		$result = set_transient( $key, $value, $expiration );
102
103
		if ( true === $result ) {
104
			$legacy_key = $this->generate_transient_key( $params, true );
105
			// if the legacy key exists and the keys are not the same, we might need to upgrade.
106
			if ( get_transient( $legacy_key ) && $key !== $legacy_key ) {
107
				$this->legacy_transient_upgrade( $operation, $object_type, $fieldmap_id );
0 ignored issues
show
Bug introduced by
It seems like $fieldmap_id can also be of type string; however, parameter $fieldmap_id of Object_Sync_Sf_Sync_Tran...acy_transient_upgrade() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

107
				$this->legacy_transient_upgrade( $operation, $object_type, /** @scrutinizer ignore-type */ $fieldmap_id );
Loading history...
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...acy_transient_upgrade() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

107
				/** @scrutinizer ignore-deprecated */ $this->legacy_transient_upgrade( $operation, $object_type, $fieldmap_id );

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
108
			}
109
		}
110
		return $result;
111
	}
112
113
	/**
114
	 * Set individual transient records for sync operations
115
	 *
116
	 * @param string $operation what is the option related to? last pull, current pull, merge, delete, etc.
117
	 * @param string $object_type the Salesforce object type.
118
	 * @param int    $fieldmap_id the ID of the specific fieldmap that is running.
119
	 * @param mixed  $value the value to be saved in the option.
120
	 * @param int    $expiration whether to expire the transient.
121
	 * @return bool  $result value of the save operation.
122
	 * @deprecated   this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version.
123
	 */
124
	private function legacy_transient_upgrade( $operation, $object_type = '', $fieldmap_id = '', $value = '', $expiration = 0 ) {
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

124
	private function legacy_transient_upgrade( $operation, $object_type = '', $fieldmap_id = '', /** @scrutinizer ignore-unused */ $value = '', $expiration = 0 ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $expiration is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

124
	private function legacy_transient_upgrade( $operation, $object_type = '', $fieldmap_id = '', $value = '', /** @scrutinizer ignore-unused */ $expiration = 0 ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
125
		$result       = false;
126
		$legacy_value = $this->legacy_get( $operation, $object_type, $fieldmap_id );
0 ignored issues
show
Bug introduced by
It seems like $fieldmap_id can also be of type string; however, parameter $fieldmap_id of Object_Sync_Sf_Sync_Transients::legacy_get() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

126
		$legacy_value = $this->legacy_get( $operation, $object_type, /** @scrutinizer ignore-type */ $fieldmap_id );
Loading history...
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Transients::legacy_get() has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

126
		$legacy_value = /** @scrutinizer ignore-deprecated */ $this->legacy_get( $operation, $object_type, $fieldmap_id );

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
127
		if ( false !== $legacy_value ) {
128
			// generate the option key parameters.
129
			$params = array(
130
				'operation'   => $operation,
131
				'object_type' => $object_type,
132
				'fieldmap_id' => $fieldmap_id,
133
			);
134
			$key    = $this->generate_transient_key( $params, true );
135
			$this->add_upgradeable_key( $key );
0 ignored issues
show
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...::add_upgradeable_key() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

135
			/** @scrutinizer ignore-deprecated */ $this->add_upgradeable_key( $key );

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
136
			$result = $this->set( $operation, $object_type, $fieldmap_id, $legacy_value );
0 ignored issues
show
Bug introduced by
It seems like $fieldmap_id can also be of type string; however, parameter $fieldmap_id of Object_Sync_Sf_Sync_Transients::set() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

136
			$result = $this->set( $operation, $object_type, /** @scrutinizer ignore-type */ $fieldmap_id, $legacy_value );
Loading history...
137
			if ( true === $result ) {
138
				$this->legacy_delete( $key );
0 ignored issues
show
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Transients::legacy_delete() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

138
				/** @scrutinizer ignore-deprecated */ $this->legacy_delete( $key );

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
139
			}
140
		}
141
		return $result;
142
	}
143
144
	/**
145
	 * Get individual transient records for sync operations
146
	 *
147
	 * @param string $operation what is the option related to? last pull, current pull, merge, delete, etc.
148
	 * @param string $object_type the WordPress or Salesforce object type.
149
	 * @param int    $fieldmap_id the ID of the specific fieldmap that is running.
150
	 * @param mixed  $default the default value for the transient.
151
	 * @return mixed $value the value of the item. False if it's empty.
152
	 */
153
	public function get( $operation, $object_type = '', $fieldmap_id = '', $default = false ) {
154
		// generate the transient key parameters.
155
		$params = array(
156
			'operation'   => $operation,
157
			'object_type' => $object_type,
158
			'fieldmap_id' => $fieldmap_id,
159
		);
160
		$key    = $this->generate_transient_key( $params );
161
		$value  = get_transient( $key );
162
163
		/*
164
		 * examples
165
		 * object_sync_for_salesforce_pull_last_sync_Contact_1
166
		 * object_sync_for_salesforce_currently_pulling_query_Contact_1
167
		 * object_sync_for_salesforce_pull_merge_last_Contact_1
168
		 * object_sync_for_salesforce_pull_delete_last_Contact_1
169
		 */
170
171
		// if the new transient value does exist but it has a default value, try to upgrade the old one.
172
		if ( get_transient( $key ) && $default === $value ) {
173
			$legacy_key = $this->generate_transient_key( $params, true );
174
			// if the keys are not the same, we might need to upgrade.
175
			if ( $key !== $legacy_key ) {
176
				$this->legacy_transient_upgrade( $operation, $object_type, $fieldmap_id, $value );
0 ignored issues
show
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...acy_transient_upgrade() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

176
				/** @scrutinizer ignore-deprecated */ $this->legacy_transient_upgrade( $operation, $object_type, $fieldmap_id, $value );

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
Bug introduced by
It seems like $fieldmap_id can also be of type string; however, parameter $fieldmap_id of Object_Sync_Sf_Sync_Tran...acy_transient_upgrade() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

176
				$this->legacy_transient_upgrade( $operation, $object_type, /** @scrutinizer ignore-type */ $fieldmap_id, $value );
Loading history...
177
			}
178
		}
179
		return $value;
180
	}
181
182
	/**
183
	 * Get legacy named individual transiuent records for sync operations
184
	 *
185
	 * @param string $operation what is the transient related to? last pull, current pull, merge, delete, etc.
186
	 * @param string $object_type the WordPress or Salesforce object type.
187
	 * @param int    $fieldmap_id the ID of the specific fieldmap that is running.
188
	 * @return mixed $value the value of the item. False if it's empty.
189
	 * @deprecated   this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version.
190
	 */
191
	public function legacy_get( $operation, $object_type = '', $fieldmap_id ) {
192
		// generate the transient key parameters.
193
		$params = array(
194
			'operation'   => $operation,
195
			'object_type' => $object_type,
196
			'fieldmap_id' => $fieldmap_id,
197
		);
198
		$key    = $this->generate_transient_key( $params, true );
199
		$value  = get_transient( $key );
200
		return $value;
201
	}
202
203
	/**
204
	 * Delete the individual transient records for sync operation
205
	 *
206
	 * @param string $operation what is the transient related to? last pull, current pull, merge, delete, etc.
207
	 * @param string $object_type the WordPress or Salesforce object type.
208
	 * @param int    $fieldmap_id the ID of the specific fieldmap that is running.
209
	 * @return bool  $result True if successful, false otherwise.
210
	 */
211
	public function delete( $operation, $object_type = '', $fieldmap_id = '' ) {
212
		// generate the transient key parameters.
213
		$params = array(
214
			'operation'   => $operation,
215
			'object_type' => $object_type,
216
			'fieldmap_id' => $fieldmap_id,
217
		);
218
		$key    = $this->generate_transient_key( $params );
219
		$result = delete_transient( $key );
220
		return $result;
221
	}
222
223
	/**
224
	 * Delete the legacy individual transient records for sync operation
225
	 *
226
	 * @param string $key the legacy key to delete.
227
	 * @return bool  $result True if successful, false otherwise.
228
	 * @deprecated   this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version.
229
	 */
230
	public function legacy_delete( $key ) {
231
		$result = delete_transient( $key );
232
		if ( true === $result ) {
233
			$this->remove_upgradeable_key( $key );
0 ignored issues
show
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...emove_upgradeable_key() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

233
			/** @scrutinizer ignore-deprecated */ $this->remove_upgradeable_key( $key );

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
234
		}
235
		return $result;
236
	}
237
238
	/**
239
	 * Add an transient key to the array of upgradeable keys.
240
	 *
241
	 * @param string $key the key to add to the array.
242
	 * @return array $this->upgradeable_keys the array of keys.
243
	 * @deprecated   this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version.
244
	 */
245
	private function add_upgradeable_key( $key ) {
246
		$keys   = $this->get_upgradeable_keys();
0 ignored issues
show
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...:get_upgradeable_keys() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

246
		$keys   = /** @scrutinizer ignore-deprecated */ $this->get_upgradeable_keys();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
247
		$keys[] = $key;
248
		$keys   = array_unique( $keys );
249
		$result = update_option( $this->option_prefix . 'upgradeable_keys', $keys );
250
		if ( true === $result ) {
251
			$this->upgradeable_keys = $keys;
0 ignored issues
show
Documentation Bug introduced by
It seems like $keys of type array is incompatible with the declared type string of property $upgradeable_keys.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

251
			/** @scrutinizer ignore-deprecated */ $this->upgradeable_keys = $keys;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
252
			return $this->upgradeable_keys;
0 ignored issues
show
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

252
			return /** @scrutinizer ignore-deprecated */ $this->upgradeable_keys;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
253
		}
254
	}
255
256
	/**
257
	 * Remove a transient key from the array of upgradeable keys.
258
	 *
259
	 * @param string $key the key to remove from the array.
260
	 * @return array $this->upgradeable_keys the array of keys.
261
	 * @deprecated   this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version.
262
	 */
263
	private function remove_upgradeable_key( $key ) {
264
		$keys      = $this->get_upgradeable_keys();
0 ignored issues
show
Deprecated Code introduced by
The function Object_Sync_Sf_Sync_Tran...:get_upgradeable_keys() has been deprecated: this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

264
		$keys      = /** @scrutinizer ignore-deprecated */ $this->get_upgradeable_keys();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
265
		$array_key = array_search( $key, $keys, true );
266
		if ( false !== $array_key ) {
267
			unset( $keys[ $array_key ] );
268
		}
269
		$result = update_option( $this->option_prefix . 'upgradeable_keys', $keys );
270
		if ( true === $result ) {
271
			$this->upgradeable_keys = $keys;
0 ignored issues
show
Documentation Bug introduced by
It seems like $keys of type array is incompatible with the declared type string of property $upgradeable_keys.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

271
			/** @scrutinizer ignore-deprecated */ $this->upgradeable_keys = $keys;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
272
			if ( empty( $keys ) ) {
273
				delete_option( $this->option_prefix . 'upgradeable_keys' );
274
			}
275
			return $this->upgradeable_keys;
0 ignored issues
show
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

275
			return /** @scrutinizer ignore-deprecated */ $this->upgradeable_keys;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
276
		}
277
	}
278
279
	/**
280
	 * Get the array of upgradeable keys.
281
	 *
282
	 * @return array $this->upgradeable_keys the array of keys.
283
	 * @deprecated   this was added in 2.1.0 to upgrade old transient keys, but will be removed in a future version.
284
	 */
285
	private function get_upgradeable_keys() {
286
		$keys                   = get_option( $this->option_prefix . 'upgradeable_keys', array() );
287
		$keys                   = array_unique( $keys );
0 ignored issues
show
Bug introduced by
It seems like $keys can also be of type false; however, parameter $array of array_unique() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

287
		$keys                   = array_unique( /** @scrutinizer ignore-type */ $keys );
Loading history...
288
		$this->upgradeable_keys = $keys;
0 ignored issues
show
Documentation Bug introduced by
It seems like $keys of type array is incompatible with the declared type string of property $upgradeable_keys.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

288
		/** @scrutinizer ignore-deprecated */ $this->upgradeable_keys = $keys;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
289
		return $this->upgradeable_keys;
0 ignored issues
show
Deprecated Code introduced by
The property Object_Sync_Sf_Sync_Transients::$upgradeable_keys has been deprecated: this was added in 2.1.0 to upgrade old option keys, but will be removed in a future version. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

289
		return /** @scrutinizer ignore-deprecated */ $this->upgradeable_keys;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
290
	}
291
}
292