Code Duplication    Length = 6-6 lines in 2 locations

admin.php 1 location

@@ 43-48 (lines=6) @@
40
			$accessToken = isTokenFreshByAccessToken($location, $accessToken);
41
42
43
			if($_POST['vote'] == "up") {
44
				$accountCreator = new Upvote();
45
			}
46
			else if($_POST['vote'] == "down") {
47
				$accountCreator = new Downvote();
48
			}
49
50
			$accountCreator->setAccessToken($accessToken);
51
			$accountCreator->postId = $_POST['postId'];

index.php 1 location

@@ 126-131 (lines=6) @@
123
	
124
	//Vote
125
	if(isset($_GET['vote']) && isset($_GET['postID'])) {
126
		if($_GET['vote'] == "up") {
127
			$accountCreator = new Upvote();
128
		}
129
		else if($_GET['vote'] == "down") {
130
			$accountCreator = new Downvote();
131
		}
132
		$accountCreator->setAccessToken($accessToken_forId1);
133
		$accountCreator->postId = $_GET['postID'];
134
		$data = $accountCreator->execute();