Code Duplication    Length = 28-30 lines in 3 locations

includes/admin/emails/class-donation-receipt-email.php 1 location

@@ 170-197 (lines=28) @@
167
		 * @param int $form_id
168
		 * @return array
169
		 */
170
		public function get_email_attachments( $form_id = null) {
171
			/**
172
			 * Filter the attachments.
173
			 * Note: this filter will deprecate soon.
174
			 *
175
			 * @since 1.0
176
			 */
177
			$attachments = apply_filters(
178
				'give_receipt_attachments',
179
				array(),
180
				$this->payment->ID,
181
				$this->payment->payment_meta
182
			);
183
184
			/**
185
			 * Filter the attachments.
186
			 *
187
			 * @since 2.0
188
			 */
189
			$attachments = apply_filters(
190
				"give_{$this->config['id']}_get_email_attachments",
191
				$attachments,
192
				$this,
193
				$form_id
194
			);
195
196
			return $attachments;
197
		}
198
199
200
		/**

includes/admin/emails/class-new-donation-email.php 1 location

@@ 153-182 (lines=30) @@
150
		 * @param int $form_id
151
		 * @return array
152
		 */
153
		public function get_email_attachments( $form_id = null ) {
154
			/**
155
			 * Filters the donation notification email attachments.
156
			 * By default, there is no attachment but plugins can hook in to provide one more multiple.
157
			 * Note: This filter will deprecate soon.
158
			 *
159
			 * @since 1.0
160
			 */
161
			$attachments = apply_filters(
162
				'give_admin_donation_notification_attachments',
163
				array(),
164
				$this->payment->ID,
165
				$this->payment->payment_meta
166
			);
167
168
			/**
169
			 * Filters the donation notification email attachments.
170
			 * By default, there is no attachment but plugins can hook in to provide one more multiple.
171
			 *
172
			 * @since 2.0
173
			 */
174
			$attachments = apply_filters(
175
				"give_{$this->config['id']}_get_email_attachments",
176
				$attachments,
177
				$this,
178
				$form_id
179
			);
180
181
			return $attachments;
182
		}
183
184
		/**
185
		 * Set email data

includes/admin/emails/class-offline-donation-instruction-email.php 1 location

@@ 142-169 (lines=28) @@
139
		 * @param int $form_id
140
		 * @return array
141
		 */
142
		public function get_email_attachments( $form_id = null ) {
143
			/**
144
			 * Filter the attachments.
145
			 * Note: This filter will deprecate soon.
146
			 *
147
			 * @since 1.0
148
			 */
149
			$attachment = apply_filters(
150
				'give_offline_donation_attachments',
151
				array(),
152
				$this->payment->ID,
153
				$this->payment->payment_meta
154
			);
155
156
			/**
157
			 * Filter the email attachment.
158
			 *
159
			 * @since 2.0
160
			 */
161
			$attachment = apply_filters(
162
				"give_{$this->config['id']}_get_email_attachment",
163
				$attachment,
164
				$this,
165
				$form_id
166
			);
167
168
			return $attachment;
169
		}
170
171
172
		/**