@@ 19-34 (lines=16) @@ | ||
16 | $this->type = $this->pullType($params); |
|
17 | } |
|
18 | ||
19 | protected function pullCountry($params) |
|
20 | { |
|
21 | $z = null; |
|
22 | $x = [ |
|
23 | "usa" => ["us", "usa"], |
|
24 | "canada" => ["ca", "canada"], |
|
25 | ]; |
|
26 | ||
27 | foreach ($x as $key => $possibilities) { |
|
28 | foreach ($possibilities as $value) { |
|
29 | $z = in_array($value, $params) ? $key : $z; |
|
30 | } |
|
31 | } |
|
32 | ||
33 | return $z; |
|
34 | } |
|
35 | ||
36 | protected function pullCase($params) |
|
37 | { |
|
@@ 48-63 (lines=16) @@ | ||
45 | return $z; |
|
46 | } |
|
47 | ||
48 | protected function pullType($params) |
|
49 | { |
|
50 | $z = null; |
|
51 | $x = [ |
|
52 | "abbr" => ["abbr", "abbrev", "abbreviation"], |
|
53 | "full" => ["full", "long", "whole"], |
|
54 | ]; |
|
55 | ||
56 | foreach ($x as $key => $possibilities) { |
|
57 | foreach ($possibilities as $value) { |
|
58 | $z = in_array($value, $params) ? $key : $z; |
|
59 | } |
|
60 | } |
|
61 | ||
62 | return $z; |
|
63 | } |
|
64 | ||
65 | public function getCountry() |
|
66 | { |