CommentReplyMessage::message()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 6
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Mamaduka\BpNotifications\Messages;
4
5
class CommentReplyMessage extends UpdateReplyMessage {
6
7
	/**
8
	 * Create a new message instance.
9
	 *
10
	 * @param array $data
11
	 * @return void
12
	 */
13 1
	public function __construct( array $data = [] ) {
14 1
		parent::__construct( $data );
15 1
	}
16
17
	/**
18
	 * Get message text.
19
	 *
20
	 * @return string
21
	 */
22 2 View Code Duplication
	public function message() {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23 2
		if ( $this->data['total'] > 1 ) {
24 1
			return sprintf( 'You have %1$d new comment replies', (int) $this->data['total'] );
25
		}
26
27 1
		return sprintf( '%1$s replied to one your activity comments', bp_core_get_user_displayname( $this->data['user_id' ] ) );
0 ignored issues
show
Bug introduced by
The function bp_core_get_user_displayname was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

27
		return sprintf( '%1$s replied to one your activity comments', /** @scrutinizer ignore-call */ bp_core_get_user_displayname( $this->data['user_id' ] ) );
Loading history...
28
	}
29
}
30