Completed
Push — develop ( 85d412...a52dc0 )
by Dieter
07:33
created

RetrieveSeatMap   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 220
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 220
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findMessage() 0 10 2
A decodeProcessingLevel() 0 15 2
1
<?php
2
/**
3
 * amadeus-ws-client
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 * http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 *
19
 * @package Amadeus
20
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
21
 */
22
23
namespace Amadeus\Client\ResponseHandler\Air;
24
25
/**
26
 * RetrieveSeatMap
27
 *
28
 * @package Amadeus\Client\ResponseHandler\Air
29
 * @author Dieter Devlieghere <[email protected]>
30
 */
31
abstract class RetrieveSeatMap
32
{
33
    /**
34
     * Find the error message for a given error code
35
     *
36
     * @param string $code
37
     * @return string|null
38
     */
39
    public static function findMessage($code)
40
    {
41
        $message = null;
42
43
        if (array_key_exists($code, self::$errorList)) {
44
            $message = self::$errorList[$code];
45
        }
46
47
        return $message;
48
    }
49
50
    /**
51
     * Decode error processing level code
52
     *
53
     * @param int|string $level
54
     * @return string|null
55
     */
56
    public static function decodeProcessingLevel($level)
57
    {
58
        $decoded = null;
59
60
        $map = [
61
            0 => 'system',
62
            1 => 'application'
63
        ];
64
65
        if (array_key_exists($level, $map)) {
66
            $decoded = $map[$level];
67
        }
68
69
        return $decoded;
70
    }
71
72
    /**
73
     * @var array
74
     */
75
    public static $errorList = [
76
        '1' => 'Passenger surname not found',
77
        '10' => 'Location of arrival is invalid',
78
        '100' => 'Seat map not available, request seat at check-in',
79
        '101' => 'Seat map contains conditional seats, it may be subject to reseating',
80
        '102' => 'Unable to process',
81
        '103' => 'Segment/Passenger does not qualify for advanced seating',
82
        '11' => 'Departure/Arrival city pair is invalid',
83
        '12' => 'Unique name not found',
84
        '13' => 'Invalid seat number',
85
        '14' => 'Airline code and/or flight number invalid',
86
        '15' => 'Flight cancelled',
87
        '16' => 'Flight check-in held or suspended temporarily',
88
        '17' => 'Passenger surname already checked in',
89
        '18' => 'Seating conflict - request contradicts the facility rules',
90
        '185' => 'Use airline name',
91
        '186' => 'Use passenger status',
92
        '187' => 'Flight changes from smoking to non smoking',
93
        '188' => 'Flight changes from non smoking to smoking',
94
        '189' => 'Pax has pre-reserved exit seat unable to C/I',
95
        '19' => 'Baggage weight is required',
96
        '190' => 'Pax cannot be seated together',
97
        '191' => 'Generic seat change not supported',
98
        '192' => 'Seat change-request in row change not supported',
99
        '193' => 'API pax data required',
100
        '194' => 'Passenger surname not checked in',
101
        '195' => 'Change of equipment on this flight',
102
        '196' => 'Time out occured on host 3',
103
        '197' => 'Error in frequent flyer number',
104
        '198' => 'Class code required',
105
        '199' => 'Check-in separately',
106
        '2' => 'Seat not available on the requested class/zone',
107
        '20' => 'Bag count conflict - weight update for non-existing bag',
108
        '200' => 'FQTV number not accepted',
109
        '201' => 'FQTV number already present',
110
        '202' => 'Baggage details not updated',
111
        '203' => 'SSR details not updated',
112
        '204' => 'Row invalid',
113
        '205' => 'Short connection baggage',
114
        '206' => 'Seat change only supported for single passenger',
115
        '207' => 'Use generic seating only',
116
        '208' => 'Update separately',
117
        '209' => 'Flight changes from seating to openseating (freeseating)',
118
        '21' => 'Seats not available for passenger type',
119
        '210' => 'Flight changes from openseating (freeseating) to seating',
120
        '211' => 'Unable to through-check - complexing/COG/codeshare flight',
121
        '212' => 'API pax data not supported',
122
        '213' => 'Time invalid - max/min connecting time for though checkin',
123
        '214' => 'API date of birth required',
124
        '215' => 'API passport number required',
125
        '217' => 'API pax first name required',
126
        '218' => 'API pax gender required',
127
        '22' => 'Too many connections - need manual tags',
128
        '223' => 'API infant data required',
129
        '224' => 'Passenger holds advance boarding pass',
130
        '225' => 'Seat Map not available as flight operated by another carrier',
131
        '226' => 'Seat Request not available as flight operated by another carrier',
132
        '227' => 'Seat change not possible/seats limited in this area',
133
        '228' => 'Exchange advanced boarding pass - new data',
134
        '229' => 'Change not performed on subsequent flight(s)',
135
        '23' => 'Invalid bag destination - need manual tags',
136
        '230' => 'Unable to seat change - complexing/COG/codeshare flight',
137
        '231' => 'Passenger not E.T. type',
138
        '232' => 'Passenger is E.T. type - needs E.T. indicator',
139
        '233' => 'Passenger is E.T. type - needs E.T. number',
140
        '234' => 'Unable to through check - E.T. passenger',
141
        '235' => 'Tier level not accepted',
142
        '236' => 'Unable to process - codeshare flight',
143
        '237' => 'Forward seat due connection - no seat change allowed',
144
        '238' => 'Australian Visa required - use TIETAC entry each pax',
145
        '239' => 'Advice of handcarry baggage allowance',
146
        '24' => 'Passenger actual weight required for this flight',
147
        '240' => 'Emergency contact information required for U.S. citizen',
148
        '244' => 'Epass passenger - number differs',
149
        '245' => 'Epass passenger - not authorized',
150
        '246' => 'Epass passenger - possible status discrepency',
151
        '247' => 'Message limit exceed',
152
        '248' => 'Insufficient upgrade balance',
153
        '249' => 'Reissue bag tags to correct destination',
154
        '25' => 'Hand baggage details required',
155
        '250' => 'Add API data - retry Check in',
156
        '251' => 'Advise visa and/or documentation status',
157
        '252' => 'Passenger is E.T. type - ticket/reservation conflict',
158
        '253' => 'Passenger is E.T. type - ticket record not accessible',
159
        '254' => 'Cascaded query timed out',
160
        '255' => 'Unable to check-in - Security profile restriction',
161
        '256' => 'Passport number printed on boarding pass required',
162
        '26' => 'No seat selection on this flight',
163
        '264' => 'API pax data not required',
164
        '265' => 'Missing or invalid airport check-in identification (FOID)',
165
        '27' => 'Location of departure is invalid',
166
        '28' => 'Flight rescheduled - through check-in no longer allowed',
167
        '29' => 'Flight full in the requested class',
168
        '3' => 'Invalid seat request',
169
        '30' => 'Passenger surname off-loaded',
170
        '300' => 'Seat Map not available for unticketed passengers',
171
        '31' => 'Passenger surname deleted/cancelled from the flight',
172
        '32' => 'Bag tag number invalid',
173
        '33' => 'Flight gated - through check-in is not allowed',
174
        '34' => 'Time invalid - minimum connecting time for check-in violated',
175
        '35' => 'Flight closed',
176
        '36' => 'Passenger not accessible in the system (error/protection)',
177
        '37' => 'Unique reference for passenger is invalid',
178
        '38' => 'Passenger party reference is invalid',
179
        '39' => 'Booking/Ticketing class conflict',
180
        '4' => 'Bag tag number details required',
181
        '40' => 'Status conflict - status does not exist',
182
        '41' => 'Frequent flyer number is invalid',
183
        '42' => 'Booking/Ticketing class invalid',
184
        '43' => 'Passenger type conflicts with seats held',
185
        '44' => 'Too many passengers',
186
        '45' => 'Unable - group names',
187
        '46' => 'Unable to check-in partial party',
188
        '47' => 'Passenger status conflict',
189
        '48' => 'PNR locator unknown in the receiving system',
190
        '49' => 'Ticket number invalid',
191
        '5' => 'Invalid flight/Date',
192
        '50' => 'Pool airline invalid',
193
        '51' => 'Operating airline invalid',
194
        '52' => 'Not authorized - company level',
195
        '53' => 'Not authorized - station level',
196
        '54' => 'Not authorized - data level',
197
        '55' => 'Passenger regraded',
198
        '56' => 'Passenger seated elsewhere than requested',
199
        '57' => 'Seat not available in the requested class',
200
        '58' => 'Seat not available in the requested zone',
201
        '59' => 'Specific seat not available',
202
        '6' => 'Too many passengers with the same Surname',
203
        '60' => 'Free seating in the requested flight',
204
        '61' => 'Too many infants',
205
        '62' => 'Smoking zone unavailable',
206
        '63' => 'Non-smoking zone unavailable',
207
        '64' => 'Indifferent zone unavailable',
208
        '65' => 'Check visa and/or documentation',
209
        '66' => 'No baggage update required for this flight',
210
        '67' => 'Gender weight is required',
211
        '68' => 'Item conflict',
212
        '69' => 'Item weight is required',
213
        '7' => 'Passenger type or gender conflict',
214
        '70' => 'Modification not possible',
215
        '700' => 'Item/data not found - data not existing in processing host',
216
        '701' => 'Invalid format - data does not match EDIFACT rules',
217
        '702' => 'No action - Processing host can not support the function',
218
        '71' => 'No common itinerary',
219
        '72' => 'Unable to give seat',
220
        '73' => 'Passenger needs initial',
221
        '74' => 'Passenger needs first name',
222
        '75' => 'Collect second flight name',
223
        '76' => 'Check smallpox vaccination',
224
        '77' => 'Check yellow fever vaccination',
225
        '78' => 'Check cholera vaccination',
226
        '79' => 'Passenger has pre-reserved seat',
227
        '8' => 'More precise gender is required',
228
        '80' => 'Flight initialised - retry check in',
229
        '81' => 'Bag through labeling not allowed beyond this station',
230
        '82' => 'Too many bags',
231
        '83' => 'Flight operated as',
232
        '84' => 'Function not supported',
233
        '85' => 'Invalid reservations booking modifier',
234
        '86' => 'Invalid compartment designator code',
235
        '87' => 'Invalid country code',
236
        '88' => 'Invalid source of business',
237
        '89' => 'Invalid agent\'s code',
238
        '9' => 'Flight is not open for through check-in',
239
        '90' => 'Requester identification required',
240
        '91' => 'Seat Map Display request is outside system date range',
241
        '92' => 'Flight does not operate due to weather, mechanical or other operational conditions',
242
        '93' => 'Flight does not operate on date requested',
243
        '94' => 'Flight does not operate between requested cities',
244
        '95' => 'Schedule change in progress',
245
        '96' => 'Repeat request updating in progress',
246
        '97' => 'Flight has departed',
247
        '98' => 'Seating closed due flight under departure control',
248
        '99' => 'Seat map not available for requested zone, seat may be requested',
249
    ];
250
}
251