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
|
|||||
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
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
![]() |
|||||
28 | } |
||||
29 | } |
||||
30 |
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.