Code Duplication    Length = 4-4 lines in 2 locations

classes/admin.php 2 locations

@@ 1349-1352 (lines=4) @@
1346
	*/
1347
	public function push_to_salesforce( $wordpress_object = '', $wordpress_id = '' ) {
1348
		$post_data = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING );
1349
		if ( empty( $wordpress_object ) && empty( $wordpress_id ) ) {
1350
			$wordpress_object = isset( $post_data['wordpress_object'] ) ? sanitize_text_field( wp_unslash( $post_data['wordpress_object'] ) ) : '';
1351
			$wordpress_id     = isset( $post_data['wordpress_id'] ) ? absint( $post_data['wordpress_id'] ) : '';
1352
		}
1353
1354
		// clarify what that variable is in this context.
1355
		$object_type = $wordpress_object;
@@ 1384-1387 (lines=4) @@
1381
	*/
1382
	public function pull_from_salesforce( $salesforce_id = '', $wordpress_object = '' ) {
1383
		$post_data = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING );
1384
		if ( empty( $wordpress_object ) && empty( $salesforce_id ) ) {
1385
			$wordpress_object = isset( $post_data['wordpress_object'] ) ? sanitize_text_field( wp_unslash( $post_data['wordpress_object'] ) ) : '';
1386
			$salesforce_id    = isset( $post_data['salesforce_id'] ) ? sanitize_text_field( wp_unslash( $post_data['salesforce_id'] ) ) : '';
1387
		}
1388
		$type   = $this->salesforce['sfapi']->get_sobject_type( $salesforce_id );
1389
		$result = $this->pull->manual_pull( $type, $salesforce_id, $wordpress_object ); // we want the wp object to make sure we get the right fieldmap
1390
		if ( ! empty( $post_data ) ) {