Code Duplication    Length = 9-9 lines in 3 locations

src/wordlift/dataset/class-sync-post-hooks.php 1 location

@@ 75-83 (lines=9) @@
72
73
	}
74
75
	public function delete_post( $post_id ) {
76
77
		try {
78
			$this->sync_service->delete_one( Object_Type_Enum::POST, $post_id );
79
		} catch ( \Exception $e ) {
80
			$this->log->error( "An error occurred while trying to delete post $post_id: " . $e->getMessage(), $e );
81
		}
82
83
	}
84
85
}

src/wordlift/dataset/class-sync-user-hooks.php 2 locations

@@ 72-80 (lines=9) @@
69
70
	}
71
72
	private function sync( $user_id ) {
73
74
		try {
75
			$this->sync_service->sync_one( Object_Type_Enum::USER, (int) $user_id );
76
		} catch ( \Exception $e ) {
77
			$this->log->error( "An error occurred while trying to sync user $user_id: " . $e->getMessage(), $e );
78
		}
79
80
	}
81
82
	public function delete_user( $user_id ) {
83
@@ 82-90 (lines=9) @@
79
80
	}
81
82
	public function delete_user( $user_id ) {
83
84
		try {
85
			$this->sync_service->delete_one( Object_Type_Enum::USER, $user_id );
86
		} catch ( \Exception $e ) {
87
			$this->log->error( "An error occurred while trying to delete user $user_id: " . $e->getMessage(), $e );
88
		}
89
90
	}
91
92
}