WordPoints_BP_Entity_Activity_Update   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A get_title() 0 3 1
1
<?php
2
3
/**
4
 * Activity update entity class.
5
 *
6
 * @package WordPoints_BuddyPress
7
 * @since 1.0.0
8
 */
9
10
/**
11
 * Represents a BuddyPress activity update.
12
 *
13
 * @since 1.0.0
14
 */
15
class WordPoints_BP_Entity_Activity_Update extends WordPoints_BP_Entity_Activity {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
16
17
	/**
18
	 * @since 1.2.1
19
	 */
20
	protected $bp_activity_type = 'activity_update';
21
22
	/**
23
	 * @since 1.2.1
24
	 */
25
	protected $bp_activity_component = 'activity';
26
27
	/**
28
	 * @since 1.2.1
29
	 */
30
	public function __construct( $slug ) {
31
32
		if ( false !== strpos( $slug, 'group' ) ) {
33
			$this->bp_activity_component = 'groups';
34
		}
35
36
		parent::__construct( $slug );
37
	}
38
39
	/**
40
	 * @since 1.0.0
41
	 */
42
	public function get_title() {
43
		return __( 'Activity Update', 'wordpoints-bp' );
44
	}
45
}
46
47
// EOF
48