Completed
Push — fix/readd-missing-stat-data ( 924e8b...94b7fa )
by
unknown
50:51 queued 41:19
created

Jetpack_Sync_Module_Stats   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 18
rs 10
wmc 4
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A init_listeners() 0 3 1
A init_before_send() 0 3 1
A add_stats() 0 3 1
1
<?php
2
3
class Jetpack_Sync_Module_Stats extends Jetpack_Sync_Module {
4
5
	function name() {
6
		return 'stats';
7
	}
8
9
	function init_listeners( $callback ) {
10
		add_action( 'jetpack_heartbeat', $callback );
11
	}
12
13
	public function init_before_send() {
14
		add_filter( 'jetpack_sync_before_send_jetpack_heartbeat', array( $this, 'add_stats' ) );
15
	}
16
17
	public function add_stats() {
18
		return array( Jetpack::get_stat_data( false ) );
19
	}
20
}
21