Code Duplication    Length = 14-15 lines in 2 locations

php/JodelAccount.php 2 locations

@@ 115-128 (lines=14) @@
112
        
113
        $location = new Location();
114
        
115
        if ($result->num_rows > 0)
116
        {
117
            // output data of each row
118
            while($row = $result->fetch_assoc())
119
            {
120
                $location->setLat($row['lat']);
121
                $location->setLng($row['lng']);
122
                $location->setCityName($row['name']);
123
            }
124
        }
125
        else
126
        {
127
            error_log("Error no Location found - getLocation");
128
        }
129
130
        if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
131
        {
@@ 203-217 (lines=15) @@
200
        
201
        $location = new Location();
202
        
203
        if ($result->num_rows > 0)
204
        {
205
            // output data of each row
206
            while($row = $result->fetch_assoc())
207
            {
208
                $location->setLat($row['lat']);
209
                $location->setLng($row['lng']);
210
                $location->setCityName($row['name']);
211
            }
212
        }
213
        else
214
        {
215
            echo "Error: 0 results";
216
            error_log("Error no Location found - getLocation");
217
        }
218
219
        return $location;
220
    }