Complex classes like Sender often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Sender, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 16 | class Sender { |
||
| 17 | /** |
||
| 18 | * Name of the option that stores the time of the next sync. |
||
| 19 | * |
||
| 20 | * @access public |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | const NEXT_SYNC_TIME_OPTION_NAME = 'jetpack_next_sync_time'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Sync timeout after a WPCOM error. |
||
| 28 | * |
||
| 29 | * @access public |
||
| 30 | * |
||
| 31 | * @var int |
||
| 32 | */ |
||
| 33 | const WPCOM_ERROR_SYNC_DELAY = 60; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Sync timeout after a queue has been locked. |
||
| 37 | * |
||
| 38 | * @access public |
||
| 39 | * |
||
| 40 | * @var int |
||
| 41 | */ |
||
| 42 | const QUEUE_LOCKED_SYNC_DELAY = 10; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Maximum bytes to checkout without exceeding the memory limit. |
||
| 46 | * |
||
| 47 | * @access private |
||
| 48 | * |
||
| 49 | * @var int |
||
| 50 | */ |
||
| 51 | private $dequeue_max_bytes; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Maximum bytes in a single encoded item. |
||
| 55 | * |
||
| 56 | * @access private |
||
| 57 | * |
||
| 58 | * @var int |
||
| 59 | */ |
||
| 60 | private $upload_max_bytes; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Maximum number of sync items in a single action. |
||
| 64 | * |
||
| 65 | * @access private |
||
| 66 | * |
||
| 67 | * @var int |
||
| 68 | */ |
||
| 69 | private $upload_max_rows; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Maximum time for perfirming a checkout of items from the queue (in seconds). |
||
| 73 | * |
||
| 74 | * @access private |
||
| 75 | * |
||
| 76 | * @var int |
||
| 77 | */ |
||
| 78 | private $max_dequeue_time; |
||
| 79 | |||
| 80 | /** |
||
| 81 | * How many seconds to wait after sending sync items after exceeding the sync wait threshold (in seconds). |
||
| 82 | * |
||
| 83 | * @access private |
||
| 84 | * |
||
| 85 | * @var int |
||
| 86 | */ |
||
| 87 | private $sync_wait_time; |
||
| 88 | |||
| 89 | /** |
||
| 90 | * How much maximum time to wait for the checkout to finish (in seconds). |
||
| 91 | * |
||
| 92 | * @access private |
||
| 93 | * |
||
| 94 | * @var int |
||
| 95 | */ |
||
| 96 | private $sync_wait_threshold; |
||
| 97 | |||
| 98 | /** |
||
| 99 | * How much maximum time to wait for the sync items to be queued for sending (in seconds). |
||
| 100 | * |
||
| 101 | * @access private |
||
| 102 | * |
||
| 103 | * @var int |
||
| 104 | */ |
||
| 105 | private $enqueue_wait_time; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * Incremental sync queue object. |
||
| 109 | * |
||
| 110 | * @access private |
||
| 111 | * |
||
| 112 | * @var Automattic\Jetpack\Sync\Queue |
||
| 113 | */ |
||
| 114 | private $sync_queue; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * Full sync queue object. |
||
| 118 | * |
||
| 119 | * @access private |
||
| 120 | * |
||
| 121 | * @var Automattic\Jetpack\Sync\Queue |
||
| 122 | */ |
||
| 123 | private $full_sync_queue; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * Codec object for encoding and decoding sync items. |
||
| 127 | * |
||
| 128 | * @access private |
||
| 129 | * |
||
| 130 | * @var Automattic\Jetpack\Sync\Codec_Interface |
||
| 131 | */ |
||
| 132 | private $codec; |
||
| 133 | |||
| 134 | /** |
||
| 135 | * The current user before we change or clear it. |
||
| 136 | * |
||
| 137 | * @access private |
||
| 138 | * |
||
| 139 | * @var \WP_User |
||
| 140 | */ |
||
| 141 | private $old_user; |
||
| 142 | |||
| 143 | /** |
||
| 144 | * Container for the singleton instance of this class. |
||
| 145 | * |
||
| 146 | * @access private |
||
| 147 | * @static |
||
| 148 | * |
||
| 149 | * @var Automattic\Jetpack\Sync\Sender |
||
| 150 | */ |
||
| 151 | private static $instance; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Retrieve the singleton instance of this class. |
||
| 155 | * |
||
| 156 | * @access public |
||
| 157 | * @static |
||
| 158 | * |
||
| 159 | * @return Sender |
||
| 160 | */ |
||
| 161 | public static function get_instance() { |
||
| 162 | if ( null === self::$instance ) { |
||
| 163 | self::$instance = new self(); |
||
|
|
|||
| 164 | } |
||
| 165 | |||
| 166 | return self::$instance; |
||
| 167 | } |
||
| 168 | |||
| 169 | /** |
||
| 170 | * Constructor. |
||
| 171 | * This is necessary because you can't use "new" when you declare instance properties >:( |
||
| 172 | * |
||
| 173 | * @access protected |
||
| 174 | * @static |
||
| 175 | */ |
||
| 176 | protected function __construct() { |
||
| 177 | $this->set_defaults(); |
||
| 178 | $this->init(); |
||
| 179 | } |
||
| 180 | |||
| 181 | /** |
||
| 182 | * Initialize the sender. |
||
| 183 | * Prepares the current user and initializes all sync modules. |
||
| 184 | * |
||
| 185 | * @access private |
||
| 186 | */ |
||
| 187 | private function init() { |
||
| 188 | add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_set_user_from_token' ), 1 ); |
||
| 189 | add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_clear_user_from_token' ), 20 ); |
||
| 190 | add_filter( 'jetpack_xmlrpc_methods', array( $this, 'register_jetpack_xmlrpc_methods' ) ); |
||
| 191 | foreach ( Modules::get_modules() as $module ) { |
||
| 192 | $module->init_before_send(); |
||
| 193 | } |
||
| 194 | } |
||
| 195 | |||
| 196 | /** |
||
| 197 | * Detect if this is a XMLRPC request with a valid signature. |
||
| 198 | * If so, changes the user to the new one. |
||
| 199 | * |
||
| 200 | * @access public |
||
| 201 | */ |
||
| 202 | public function maybe_set_user_from_token() { |
||
| 203 | $connection = new Manager(); |
||
| 204 | $verified_user = $connection->verify_xml_rpc_signature(); |
||
| 205 | if ( Constants::is_true( 'XMLRPC_REQUEST' ) && |
||
| 206 | ! is_wp_error( $verified_user ) |
||
| 207 | && $verified_user |
||
| 208 | ) { |
||
| 209 | $old_user = wp_get_current_user(); |
||
| 210 | $this->old_user = isset( $old_user->ID ) ? $old_user->ID : 0; |
||
| 211 | wp_set_current_user( $verified_user['user_id'] ); |
||
| 212 | } |
||
| 213 | } |
||
| 214 | |||
| 215 | /** |
||
| 216 | * If we used to have a previous current user, revert back to it. |
||
| 217 | * |
||
| 218 | * @access public |
||
| 219 | */ |
||
| 220 | public function maybe_clear_user_from_token() { |
||
| 221 | if ( isset( $this->old_user ) ) { |
||
| 222 | wp_set_current_user( $this->old_user ); |
||
| 223 | } |
||
| 224 | } |
||
| 225 | |||
| 226 | /** |
||
| 227 | * Retrieve the next sync time. |
||
| 228 | * |
||
| 229 | * @access public |
||
| 230 | * |
||
| 231 | * @param string $queue_name Name of the queue. |
||
| 232 | * @return float Timestamp of the next sync. |
||
| 233 | */ |
||
| 234 | public function get_next_sync_time( $queue_name ) { |
||
| 235 | return (float) get_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, 0 ); |
||
| 236 | } |
||
| 237 | |||
| 238 | /** |
||
| 239 | * Set the next sync time. |
||
| 240 | * |
||
| 241 | * @access public |
||
| 242 | * |
||
| 243 | * @param int $time Timestamp of the next sync. |
||
| 244 | * @param string $queue_name Name of the queue. |
||
| 245 | * @return boolean True if update was successful, false otherwise. |
||
| 246 | */ |
||
| 247 | public function set_next_sync_time( $time, $queue_name ) { |
||
| 248 | return update_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, $time, true ); |
||
| 249 | } |
||
| 250 | |||
| 251 | /** |
||
| 252 | * Trigger a full sync. |
||
| 253 | * |
||
| 254 | * @access public |
||
| 255 | * |
||
| 256 | * @return boolean|\WP_Error True if this sync sending was successful, error object otherwise. |
||
| 257 | */ |
||
| 258 | public function do_full_sync() { |
||
| 259 | $sync_module = Modules::get_module( 'full-sync' ); |
||
| 260 | if ( ! $sync_module ) { |
||
| 261 | return; |
||
| 262 | } |
||
| 263 | if ( ! Settings::get_setting( 'full_sync_sender_enabled' ) ) { |
||
| 264 | return; |
||
| 265 | } |
||
| 266 | $this->continue_full_sync_enqueue(); |
||
| 267 | // immediate full sync sends data in continue_full_sync_enqueue. |
||
| 268 | if ( false === strpos( get_class( $sync_module ), 'Full_Sync_Immediately' ) ) { |
||
| 269 | return $this->do_sync_and_set_delays( $this->full_sync_queue ); |
||
| 270 | } else { |
||
| 271 | $status = $sync_module->get_status(); |
||
| 272 | // Sync not started or Sync finished. |
||
| 273 | if ( false === $status['started'] || ( ! empty( $status['started'] ) && ! empty( $status['finished'] ) ) ) { |
||
| 274 | return false; |
||
| 275 | } else { |
||
| 276 | return true; |
||
| 277 | } |
||
| 278 | } |
||
| 279 | } |
||
| 280 | |||
| 281 | /** |
||
| 282 | * Enqueue the next sync items for sending. |
||
| 283 | * Will not be done if the current request is a WP import one. |
||
| 284 | * Will be delayed until the next sync time comes. |
||
| 285 | * |
||
| 286 | * @access private |
||
| 287 | */ |
||
| 288 | private function continue_full_sync_enqueue() { |
||
| 289 | if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { |
||
| 290 | return false; |
||
| 291 | } |
||
| 292 | |||
| 293 | if ( $this->get_next_sync_time( 'full-sync-enqueue' ) > microtime( true ) ) { |
||
| 294 | return false; |
||
| 295 | } |
||
| 296 | |||
| 297 | Modules::get_module( 'full-sync' )->continue_enqueuing(); |
||
| 298 | |||
| 299 | $this->set_next_sync_time( time() + $this->get_enqueue_wait_time(), 'full-sync-enqueue' ); |
||
| 300 | } |
||
| 301 | |||
| 302 | /** |
||
| 303 | * Trigger incremental sync. |
||
| 304 | * |
||
| 305 | * @access public |
||
| 306 | * |
||
| 307 | * @return boolean|\WP_Error True if this sync sending was successful, error object otherwise. |
||
| 308 | */ |
||
| 309 | public function do_sync() { |
||
| 310 | return $this->do_sync_and_set_delays( $this->sync_queue ); |
||
| 311 | } |
||
| 312 | |||
| 313 | /** |
||
| 314 | * Trigger sync for a certain sync queue. |
||
| 315 | * Responsible for setting next sync time. |
||
| 316 | * Will not be delayed if the current request is a WP import one. |
||
| 317 | * Will be delayed until the next sync time comes. |
||
| 318 | * |
||
| 319 | * @access public |
||
| 320 | * |
||
| 321 | * @param Automattic\Jetpack\Sync\Queue $queue Queue object. |
||
| 322 | * @return boolean|\WP_Error True if this sync sending was successful, error object otherwise. |
||
| 323 | */ |
||
| 324 | public function do_sync_and_set_delays( $queue ) { |
||
| 325 | // Don't sync if importing. |
||
| 326 | if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { |
||
| 327 | return new \WP_Error( 'is_importing' ); |
||
| 328 | } |
||
| 329 | |||
| 330 | // Don't sync if request is marked as read only. |
||
| 331 | if ( Constants::is_true( 'JETPACK_SYNC_READ_ONLY' ) ) { |
||
| 332 | return new \WP_Error( 'jetpack_sync_read_only' ); |
||
| 333 | } |
||
| 334 | |||
| 335 | if ( ! Settings::is_sender_enabled( $queue->id ) ) { |
||
| 336 | return new \WP_Error( 'sender_disabled_for_queue_' . $queue->id ); |
||
| 337 | } |
||
| 338 | |||
| 339 | // Don't sync if we are throttled. |
||
| 340 | if ( $this->get_next_sync_time( $queue->id ) > microtime( true ) ) { |
||
| 341 | return new \WP_Error( 'sync_throttled' ); |
||
| 342 | } |
||
| 343 | |||
| 344 | $start_time = microtime( true ); |
||
| 345 | |||
| 346 | Settings::set_is_syncing( true ); |
||
| 347 | |||
| 348 | $sync_result = $this->do_sync_for_queue( $queue ); |
||
| 349 | |||
| 350 | Settings::set_is_syncing( false ); |
||
| 351 | |||
| 352 | $exceeded_sync_wait_threshold = ( microtime( true ) - $start_time ) > (float) $this->get_sync_wait_threshold(); |
||
| 353 | |||
| 354 | if ( is_wp_error( $sync_result ) ) { |
||
| 355 | if ( 'unclosed_buffer' === $sync_result->get_error_code() ) { |
||
| 356 | $this->set_next_sync_time( time() + self::QUEUE_LOCKED_SYNC_DELAY, $queue->id ); |
||
| 357 | } |
||
| 358 | if ( 'wpcom_error' === $sync_result->get_error_code() ) { |
||
| 359 | $this->set_next_sync_time( time() + self::WPCOM_ERROR_SYNC_DELAY, $queue->id ); |
||
| 360 | } |
||
| 361 | } elseif ( $exceeded_sync_wait_threshold ) { |
||
| 362 | // If we actually sent data and it took a while, wait before sending again. |
||
| 363 | $this->set_next_sync_time( time() + $this->get_sync_wait_time(), $queue->id ); |
||
| 364 | } |
||
| 365 | |||
| 366 | return $sync_result; |
||
| 367 | } |
||
| 368 | |||
| 369 | /** |
||
| 370 | * Retrieve the next sync items to send. |
||
| 371 | * |
||
| 372 | * @access public |
||
| 373 | * |
||
| 374 | * @param (array|Automattic\Jetpack\Sync\Queue_Buffer) $buffer_or_items Queue buffer or array of objects. |
||
| 375 | * @param boolean $encode Whether to encode the items. |
||
| 376 | * @return array Sync items to send. |
||
| 377 | */ |
||
| 378 | public function get_items_to_send( $buffer_or_items, $encode = true ) { |
||
| 425 | |||
| 426 | /** |
||
| 427 | * If supported, flush all response data to the client and finish the request. |
||
| 428 | * This allows for time consuming tasks to be performed without leaving the connection open. |
||
| 429 | * |
||
| 430 | * @access private |
||
| 431 | */ |
||
| 432 | private function fastcgi_finish_request() { |
||
| 437 | |||
| 438 | /** |
||
| 439 | * Perform sync for a certain sync queue. |
||
| 440 | * |
||
| 441 | * @access public |
||
| 442 | * |
||
| 443 | * @param Automattic\Jetpack\Sync\Queue $queue Queue object. |
||
| 444 | * @return boolean|\WP_Error True if this sync sending was successful, error object otherwise. |
||
| 445 | */ |
||
| 446 | public function do_sync_for_queue( $queue ) { |
||
| 447 | do_action( 'jetpack_sync_before_send_queue_' . $queue->id ); |
||
| 448 | if ( $queue->size() === 0 ) { |
||
| 549 | |||
| 550 | /** |
||
| 551 | * Immediately sends a single item without firing or enqueuing it |
||
| 552 | * |
||
| 553 | * @param string $action_name The action. |
||
| 554 | * @param array $data The data associated with the action. |
||
| 555 | * |
||
| 556 | * @return Items processed. TODO: this doesn't make much sense anymore, it should probably be just a bool. |
||
| 557 | */ |
||
| 558 | public function send_action( $action_name, $data = null ) { |
||
| 583 | |||
| 584 | /** |
||
| 585 | * Create an synthetic action for direct sending to WPCOM during full sync (for example) |
||
| 586 | * |
||
| 587 | * @access private |
||
| 588 | * |
||
| 589 | * @param string $action_name The action. |
||
| 590 | * @param array $data The data associated with the action. |
||
| 591 | * @return array An array of synthetic sync actions keyed by current microtime(true) |
||
| 592 | */ |
||
| 593 | private function create_action_to_send( $action_name, $data ) { |
||
| 604 | |||
| 605 | /** |
||
| 606 | * Returns any object that is able to be synced. |
||
| 607 | * |
||
| 608 | * @access public |
||
| 609 | * |
||
| 610 | * @param array $args the synchronized object parameters. |
||
| 611 | * @return string Encoded sync object. |
||
| 612 | */ |
||
| 613 | public function sync_object( $args ) { |
||
| 622 | |||
| 623 | /** |
||
| 624 | * Register additional sync XML-RPC methods available to Jetpack for authenticated users. |
||
| 625 | * |
||
| 626 | * @access public |
||
| 627 | * @since 7.8 |
||
| 628 | * |
||
| 629 | * @param array $jetpack_methods XML-RPC methods available to the Jetpack Server. |
||
| 630 | * @return array Filtered XML-RPC methods. |
||
| 631 | */ |
||
| 632 | public function register_jetpack_xmlrpc_methods( $jetpack_methods ) { |
||
| 636 | |||
| 637 | /** |
||
| 638 | * Get the incremental sync queue object. |
||
| 639 | * |
||
| 640 | * @access public |
||
| 641 | * |
||
| 642 | * @return Automattic\Jetpack\Sync\Queue Queue object. |
||
| 643 | */ |
||
| 644 | public function get_sync_queue() { |
||
| 647 | |||
| 648 | /** |
||
| 649 | * Get the full sync queue object. |
||
| 650 | * |
||
| 651 | * @access public |
||
| 652 | * |
||
| 653 | * @return Automattic\Jetpack\Sync\Queue Queue object. |
||
| 654 | */ |
||
| 655 | public function get_full_sync_queue() { |
||
| 658 | |||
| 659 | /** |
||
| 660 | * Get the codec object. |
||
| 661 | * |
||
| 662 | * @access public |
||
| 663 | * |
||
| 664 | * @return Automattic\Jetpack\Sync\Codec_Interface Codec object. |
||
| 665 | */ |
||
| 666 | public function get_codec() { |
||
| 669 | |||
| 670 | /** |
||
| 671 | * Determine the codec object. |
||
| 672 | * Use gzip deflate if supported. |
||
| 673 | * |
||
| 674 | * @access public |
||
| 675 | */ |
||
| 676 | public function set_codec() { |
||
| 683 | |||
| 684 | /** |
||
| 685 | * Compute and send all the checksums. |
||
| 686 | * |
||
| 687 | * @access public |
||
| 688 | */ |
||
| 689 | public function send_checksum() { |
||
| 693 | |||
| 694 | /** |
||
| 695 | * Reset the incremental sync queue. |
||
| 696 | * |
||
| 697 | * @access public |
||
| 698 | */ |
||
| 699 | public function reset_sync_queue() { |
||
| 702 | |||
| 703 | /** |
||
| 704 | * Reset the full sync queue. |
||
| 705 | * |
||
| 706 | * @access public |
||
| 707 | */ |
||
| 708 | public function reset_full_sync_queue() { |
||
| 711 | |||
| 712 | /** |
||
| 713 | * Set the maximum bytes to checkout without exceeding the memory limit. |
||
| 714 | * |
||
| 715 | * @access public |
||
| 716 | * |
||
| 717 | * @param int $size Maximum bytes to checkout. |
||
| 718 | */ |
||
| 719 | public function set_dequeue_max_bytes( $size ) { |
||
| 722 | |||
| 723 | /** |
||
| 724 | * Set the maximum bytes in a single encoded item. |
||
| 725 | * |
||
| 726 | * @access public |
||
| 727 | * |
||
| 728 | * @param int $max_bytes Maximum bytes in a single encoded item. |
||
| 729 | */ |
||
| 730 | public function set_upload_max_bytes( $max_bytes ) { |
||
| 733 | |||
| 734 | /** |
||
| 735 | * Set the maximum number of sync items in a single action. |
||
| 736 | * |
||
| 737 | * @access public |
||
| 738 | * |
||
| 739 | * @param int $max_rows Maximum number of sync items. |
||
| 740 | */ |
||
| 741 | public function set_upload_max_rows( $max_rows ) { |
||
| 744 | |||
| 745 | /** |
||
| 746 | * Set the sync wait time (in seconds). |
||
| 747 | * |
||
| 748 | * @access public |
||
| 749 | * |
||
| 750 | * @param int $seconds Sync wait time. |
||
| 751 | */ |
||
| 752 | public function set_sync_wait_time( $seconds ) { |
||
| 755 | |||
| 756 | /** |
||
| 757 | * Get current sync wait time (in seconds). |
||
| 758 | * |
||
| 759 | * @access public |
||
| 760 | * |
||
| 761 | * @return int Sync wait time. |
||
| 762 | */ |
||
| 763 | public function get_sync_wait_time() { |
||
| 766 | |||
| 767 | /** |
||
| 768 | * Set the enqueue wait time (in seconds). |
||
| 769 | * |
||
| 770 | * @access public |
||
| 771 | * |
||
| 772 | * @param int $seconds Enqueue wait time. |
||
| 773 | */ |
||
| 774 | public function set_enqueue_wait_time( $seconds ) { |
||
| 777 | |||
| 778 | /** |
||
| 779 | * Get current enqueue wait time (in seconds). |
||
| 780 | * |
||
| 781 | * @access public |
||
| 782 | * |
||
| 783 | * @return int Enqueue wait time. |
||
| 784 | */ |
||
| 785 | public function get_enqueue_wait_time() { |
||
| 788 | |||
| 789 | /** |
||
| 790 | * Set the sync wait threshold (in seconds). |
||
| 791 | * |
||
| 792 | * @access public |
||
| 793 | * |
||
| 794 | * @param int $seconds Sync wait threshold. |
||
| 795 | */ |
||
| 796 | public function set_sync_wait_threshold( $seconds ) { |
||
| 799 | |||
| 800 | /** |
||
| 801 | * Get current sync wait threshold (in seconds). |
||
| 802 | * |
||
| 803 | * @access public |
||
| 804 | * |
||
| 805 | * @return int Sync wait threshold. |
||
| 806 | */ |
||
| 807 | public function get_sync_wait_threshold() { |
||
| 810 | |||
| 811 | /** |
||
| 812 | * Set the maximum time for perfirming a checkout of items from the queue (in seconds). |
||
| 813 | * |
||
| 814 | * @access public |
||
| 815 | * |
||
| 816 | * @param int $seconds Maximum dequeue time. |
||
| 817 | */ |
||
| 818 | public function set_max_dequeue_time( $seconds ) { |
||
| 821 | |||
| 822 | /** |
||
| 823 | * Initialize the sync queues, codec and set the default settings. |
||
| 824 | * |
||
| 825 | * @access public |
||
| 826 | */ |
||
| 827 | public function set_defaults() { |
||
| 843 | |||
| 844 | /** |
||
| 845 | * Reset sync queues, modules and settings. |
||
| 846 | * |
||
| 847 | * @access public |
||
| 848 | */ |
||
| 849 | public function reset_data() { |
||
| 863 | |||
| 864 | /** |
||
| 865 | * Perform cleanup at the event of plugin uninstallation. |
||
| 866 | * |
||
| 867 | * @access public |
||
| 868 | */ |
||
| 869 | public function uninstall() { |
||
| 880 | } |
||
| 881 |
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..