1 | <?php |
||
35 | class Cabin |
||
36 | { |
||
37 | /** |
||
38 | * Search only in the original cabin (the one from the segment) |
||
39 | */ |
||
40 | const TYPE_DEFAULT = 'K'; |
||
41 | |||
42 | /** |
||
43 | * Search only in the cabin(s) provided as "first cabin". |
||
44 | */ |
||
45 | const TYPE_FIRST_CABIN = 'FC'; |
||
46 | |||
47 | /** |
||
48 | * Search first in the cabin(s) provided as "first cabin", then in the cabin(s) provided as "second cabin". |
||
49 | * |
||
50 | * Note: must be used together with the "first cabin". |
||
51 | */ |
||
52 | const TYPE_SECOND_CABIN = 'SC'; |
||
53 | |||
54 | /** |
||
55 | * Search first in the cabin(s) provided as "first cabin", then in the cabin(s) provided as "second cabin", |
||
56 | * and finally in the cabin(s) provided as "third cabin". |
||
57 | * |
||
58 | * Note: must be used together with the "first cabin" and "second cabin". |
||
59 | */ |
||
60 | const TYPE_THIRD_CABIN = 'TC'; |
||
61 | |||
62 | /** |
||
63 | * In case no fare is found in the cabin(s) provided with above option, defaults to any cabin. |
||
64 | */ |
||
65 | const TYPE_DEFAULT_CABIN = 'P'; |
||
66 | |||
67 | const CLASS_FIRST = 'F'; |
||
68 | const CLASS_BUSINESS = 'C'; |
||
69 | const CLASS_ECONOMY = 'Y'; |
||
70 | const CLASS_STANDARD_ECONOMY = 'M'; |
||
71 | const CLASS_PREMIUM_ECONOMY = 'W'; |
||
72 | |||
73 | /** |
||
74 | * @var string |
||
75 | */ |
||
76 | private $type; |
||
77 | |||
78 | /** |
||
79 | * @var string |
||
80 | */ |
||
81 | private $class; |
||
82 | |||
83 | /** |
||
84 | * Cabin constructor. |
||
85 | * |
||
86 | * @param string $type |
||
87 | * @param string $class |
||
|
|||
88 | */ |
||
89 | 4 | public function __construct($type, $class = null) |
|
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | 4 | public function getType() |
|
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | 4 | public function getClass() |
|
110 | } |
||
111 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.