Code Duplication    Length = 6-6 lines in 2 locations

admin.php 1 location

@@ 33-38 (lines=6) @@
30
			var_dump($accessToken);
31
			isTokenFreshByAccessToken($location, $accessToken);
32
33
			if($_POST['vote'] == "up") {
34
				$accountCreator = new Upvote();
35
			}
36
			else if($_POST['vote'] == "down") {
37
				$accountCreator = new Downvote();
38
			}
39
40
			$accountCreator->setAccessToken($accessToken);
41
			$accountCreator->postId = $_POST['postId'];

index.php 1 location

@@ 103-108 (lines=6) @@
100
	
101
	//Vote
102
	if(isset($_GET['vote']) && isset($_GET['postID'])) {
103
		if($_GET['vote'] == "up") {
104
			$accountCreator = new Upvote();
105
		}
106
		else if($_GET['vote'] == "down") {
107
			$accountCreator = new Downvote();
108
		}
109
		$accountCreator->setAccessToken($accessToken);
110
		$data = $accountCreator->execute();
111