-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetResultsRefactor.php
47 lines (44 loc) · 1.22 KB
/
GetResultsRefactor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by IntelliJ IDEA.
* User: solomontsao
* Date: 10/28/17
* Time: 6:15 AM
*/
namespace switchstatements;
class GetResultsRefactor
{
public function GetResults($type="SearchResults")
{
$results = null;
$searchResultClass = new SearchResultList();
$favoriteResultClass = new FavoritesResultList();
$wishlistResultClass = new WishlistResultList();
///// new Christmas List
$christmaslistResultClass = new ChristmasResultList();
switch ($type)
{
case "SearchResults":
$results = $searchResultClass->GetSearchResults();
break;
case "Favorites":
$results = $favoriteResultClass->GetFavoriteResults();
break;
case "WishList":
$results = $wishlistResultClass->getWishlistResults();
break;
case "ChristmasList":
$results = $christmaslistResultClass->getChristmasResults();
break;
}
return $results;
}
/////another whatever 10k lines of code
/// asdfsadfsadf
/// fasdfsadf
/// sadfasd
/// dfasdfasdf
/// asdfasdfasdf
/// asdfasdfas
/// asdfasdfasdf
}