Code Duplication    Length = 31-35 lines in 2 locations

index.php 2 locations

@@ 118-148 (lines=31) @@
115
		if(array_key_exists('recent', $posts))
116
		{
117
			$posts = $posts['recent'];
118
			if(!array_key_exists(0, $posts))
119
			{
120
				$posts[0] = array(
121
			    "post_id" => "0",
122
			    "discovered_by" => 0,
123
			    "message" => "Not found",
124
			    "created_at" => "2017-02-11T16:44:50.385Z",
125
			    "updated_at" => "2017-02-11T16:44:50.385Z",
126
			    "pin_count" => 0,
127
			    "color" => "FFBA00",
128
			    "got_thanks" => FALSE,
129
			    "post_own" => "friend",
130
			    "discovered" => 0,
131
			    "distance" => 9,
132
			    "vote_count" => 0,
133
			    "location" =>
134
			    array("name" => "Berlin",
135
			      "loc_coordinates" =>
136
			      array(
137
			        "lat" => 0,
138
			        "lng" => 0
139
			      ),
140
			      "loc_accuracy" => 0,
141
			      "country" => "",
142
			      "city" => "",
143
			    ),
144
			    "tags" =>
145
			    array(),
146
			    "user_handle" => "0"
147
			 );
148
			}
149
		}
150
		else
151
		{
@@ 150-184 (lines=35) @@
147
			 );
148
			}
149
		}
150
		else
151
		{
152
			$posts = array();
153
			$posts[0] = 
154
			array(
155
			    "post_id" => "0",
156
			    "discovered_by" => 0,
157
			    "message" => "Bad Request",
158
			    "created_at" => "2017-02-11T16:44:50.385Z",
159
			    "updated_at" => "2017-02-11T16:44:50.385Z",
160
			    "pin_count" => 0,
161
			    "color" => "FFBA00",
162
			    "got_thanks" => FALSE,
163
			    "post_own" => "friend",
164
			    "discovered" => 0,
165
			    "distance" => 9,
166
			    "vote_count" => 0,
167
			    "location" =>
168
			    array("name" => "Berlin",
169
			      "loc_coordinates" =>
170
			      array(
171
			        "lat" => 0,
172
			        "lng" => 0
173
			      ),
174
			      "loc_accuracy" => 0,
175
			      "country" => "",
176
			      "city" => "",
177
			    ),
178
			    "tags" =>
179
			    array(),
180
			    "user_handle" => "0"
181
			 );
182
183
184
		}
185
		$loops = 29;
186
		$isDetailedView = FALSE;
187
	}