1 | <?php |
||
26 | class SessionParameters |
||
27 | { |
||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | public $apiKey; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | public $country; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | public $currency; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | public $locale; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | public $originPlace; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | public $destinationPlace; |
||
57 | |||
58 | /** |
||
59 | * @var string |
||
60 | */ |
||
61 | public $outboundDate; |
||
62 | |||
63 | /** |
||
64 | * @var integer |
||
65 | */ |
||
66 | public $adults; |
||
67 | |||
68 | /** |
||
69 | * @var string |
||
70 | */ |
||
71 | public $inboundDate; |
||
72 | |||
73 | /** |
||
74 | * @var string |
||
75 | */ |
||
76 | public $locationSchema; |
||
77 | |||
78 | /** |
||
79 | * @var string |
||
80 | */ |
||
81 | public $cabinClass; |
||
82 | |||
83 | /** |
||
84 | * @var integer |
||
85 | */ |
||
86 | public $children; |
||
87 | |||
88 | /** |
||
89 | * @var integer |
||
90 | */ |
||
91 | public $infants; |
||
92 | |||
93 | /** |
||
94 | * @var float |
||
95 | */ |
||
96 | private $maxPrice; |
||
97 | |||
98 | /** |
||
99 | * @return array |
||
|
|||
100 | */ |
||
101 | public function toArray() |
||
102 | { |
||
103 | $params = [ |
||
104 | 'apiKey' => $this->apiKey, |
||
105 | 'country' => $this->country, |
||
106 | 'currency' => $this->currency, |
||
107 | 'locale' => $this->locale, |
||
108 | 'originplace' => $this->originPlace, |
||
109 | 'destinationplace' => $this->destinationPlace, |
||
110 | 'outbounddate' => $this->outboundDate, |
||
111 | 'adults' => $this->adults |
||
112 | ]; |
||
113 | |||
114 | if ($this->inboundDate) { |
||
115 | $params['inbounddate'] = $this->inboundDate; |
||
116 | } |
||
117 | |||
118 | if ($this->locationSchema) { |
||
119 | $params['locationschema'] = $this->locationSchema; |
||
120 | } |
||
121 | |||
122 | if ($this->cabinClass) { |
||
123 | $params['cabinclass'] = $this->cabinClass; |
||
124 | } |
||
125 | |||
126 | if ($this->infants) { |
||
127 | $params['infants'] = $this->infants; |
||
128 | } |
||
129 | |||
130 | if ($this->children) { |
||
131 | $params['children'] = $this->children; |
||
132 | } |
||
133 | |||
134 | return $params; |
||
135 | } |
||
136 | |||
137 | /** |
||
138 | * @return float |
||
139 | */ |
||
140 | public function getMaxPrice() |
||
144 | |||
145 | /** |
||
146 | * @param float $maxPrice |
||
147 | */ |
||
148 | public function setMaxPrice($maxPrice) |
||
152 | |||
153 | /** |
||
154 | * @return string |
||
155 | */ |
||
156 | public function __toString() |
||
171 | } |
||
172 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.