| 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\Struct\Pnr; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | use Amadeus\Client\RequestOptions\PnrSplitOptions; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | use Amadeus\Client\Struct\BaseWsMessage; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | use Amadeus\Client\Struct\Pnr\Split\SplitDetails; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |  * Structure class for representing the PNR_Split request message | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |  * @package Amadeus\Client\Struct\Pnr | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |  * @author Mike Hernas <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | class Split extends BaseWsMessage | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |      * @var ReservationInfo | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     public $reservationInfo; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |      * @var SplitDetails | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |     public $splitDetails; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |      | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |      * Split constructor. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |      * @param PnrSplitOptions $params | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 51 |  |  |      */ | 
            
                                                        
            
                                    
            
            
                | 52 | 8 |  |     public function __construct(PnrSplitOptions $params) | 
            
                                                        
            
                                    
            
            
                | 53 |  |  |     { | 
            
                                                        
            
                                                                    
                                                                                                        
            
            
                | 54 | 8 | View Code Duplication |         if (is_string($params->recordLocator) && strlen($params->recordLocator) >= 6) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                        
            
                                    
            
            
                | 55 | 4 |  |             $this->reservationInfo = new ReservationInfo($params->recordLocator); | 
            
                                                        
            
                                    
            
            
                | 56 | 2 |  |         } | 
            
                                                        
            
                                    
            
            
                | 57 | 8 |  |         if ($params->passengerTattoos) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                        
            
                                    
            
            
                | 58 | 8 |  |             $this->splitDetails = new SplitDetails($params->passengerTattoos); | 
            
                                                        
            
                                    
            
            
                | 59 | 4 |  |         } | 
            
                                                        
            
                                    
            
            
                | 60 | 8 |  |     } | 
            
                                                        
            
                                    
            
            
                | 61 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 62 |  |  |  | 
            
                        
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.