Code Duplication    Length = 7-7 lines in 2 locations

includes/admin/reports/class-donor-reports-table.php 1 location

@@ 186-192 (lines=7) @@
183
				$value    = '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>';
184
				break;
185
186
			case 'num_donations' :
187
				$value = sprintf(
188
					'<a href="%s">%s</a>',
189
					admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $item['id'] ) ),
190
						esc_html( $item['num_donations'] )
191
					);
192
				break;
193
194
			case 'amount_spent' :
195
				$value = give_currency_filter( give_format_amount( $item[ $column_name ], array( 'sanitize' => false ) ) );

includes/admin/donors/class-donor-table.php 1 location

@@ 118-124 (lines=7) @@
115
	public function column_default( $donor, $column_name ) {
116
		switch ( $column_name ) {
117
118
			case 'num_donations' :
119
				$value = sprintf(
120
					'<a href="%s">%s</a>',
121
					admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor['id'] ) ),
122
					esc_html( $donor['num_donations'] )
123
				);
124
				break;
125
126
			case 'amount_spent' :
127
				$value = give_currency_filter( give_format_amount( $donor[ $column_name ], array( 'sanitize' => false ) ) );