Code Duplication    Length = 6-6 lines in 3 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'];

php/jodel-web.php 1 location

@@ 136-141 (lines=6) @@
133
134
	if(!deviceUidHasVotedThisPostId($deviceUid_forId1, $_GET['postID']))
135
	{
136
		if($_GET['vote'] == "up")
137
		{
138
			$accountCreator = new Upvote();
139
		}
140
		else if($_GET['vote'] == "down")
141
		{
142
			$accountCreator = new Downvote();
143
		}
144
		$accountCreator->setAccessToken($accessToken_forId1);

vote-ajax.php 1 location

@@ 50-55 (lines=6) @@
47
				$accessToken = isTokenFreshByAccessToken($location, $accessToken);
48
49
50
				if($_POST['vote'] == "up") {
51
					$accountCreator = new Upvote();
52
				}
53
				else if($_POST['vote'] == "down") {
54
					$accountCreator = new Downvote();
55
				}
56
57
				$accountCreator->setAccessToken($accessToken);
58
				$accountCreator->postId = $_POST['postId'];