1 | <?php |
||
21 | class IntoKeyword extends Component |
||
22 | { |
||
23 | /** |
||
24 | * FIELDS/COLUMNS Options for `SELECT...INTO` statements. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | public static $FIELDS_OPTIONS = array( |
||
29 | 'TERMINATED BY' => array(1, 'expr'), |
||
30 | 'OPTIONALLY' => 2, |
||
31 | 'ENCLOSED BY' => array(3, 'expr'), |
||
32 | 'ESCAPED BY' => array(4, 'expr'), |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * LINES Options for `SELECT...INTO` statements. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | public static $LINES_OPTIONS = array( |
||
41 | 'STARTING BY' => array(1, 'expr'), |
||
42 | 'TERMINATED BY' => array(2, 'expr'), |
||
43 | ); |
||
44 | |||
45 | /** |
||
46 | * Type of target (OUTFILE or SYMBOL). |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | public $type; |
||
51 | |||
52 | /** |
||
53 | * The destination, which can be a table or a file. |
||
54 | * |
||
55 | * @var string|Expression |
||
56 | */ |
||
57 | public $dest; |
||
58 | |||
59 | /** |
||
60 | * The name of the columns. |
||
61 | * |
||
62 | * @var array |
||
63 | */ |
||
64 | public $columns; |
||
65 | |||
66 | /** |
||
67 | * The values to be selected into (SELECT .. INTO @var1). |
||
68 | * |
||
69 | * @var Expression[] |
||
70 | */ |
||
71 | public $values; |
||
72 | |||
73 | /** |
||
74 | * Options for FIELDS/COLUMNS keyword. |
||
75 | * |
||
76 | * @var OptionsArray |
||
77 | * |
||
78 | * @see static::$FIELDS_OPTIONS |
||
79 | */ |
||
80 | public $fields_options; |
||
81 | |||
82 | /** |
||
83 | * Whether to use `FIELDS` or `COLUMNS` while building. |
||
84 | * |
||
85 | * @var bool |
||
86 | */ |
||
87 | public $fields_keyword; |
||
88 | |||
89 | /** |
||
90 | * Options for OPTIONS keyword. |
||
91 | * |
||
92 | * @var OptionsArray |
||
93 | * |
||
94 | * @see static::$LINES_OPTIONS |
||
95 | */ |
||
96 | public $lines_options; |
||
97 | |||
98 | /** |
||
99 | * Constructor. |
||
100 | * |
||
101 | * @param string $type Type of destination (may be OUTFILE). |
||
|
|||
102 | * @param string|Expression $dest Actual destination. |
||
103 | * @param array $columns Column list of destination. |
||
104 | * @param array $values Selected fields. |
||
105 | * @param OptionsArray $fields_options Options for FIELDS/COLUMNS keyword. |
||
106 | * @param OptionsArray $fields_keyword Options for OPTINOS keyword. |
||
107 | */ |
||
108 | 36 | public function __construct( |
|
123 | |||
124 | /** |
||
125 | * @param Parser $parser the parser that serves as context |
||
126 | * @param TokensList $list the list of tokens that are being parsed |
||
127 | * @param array $options parameters for parsing |
||
128 | * |
||
129 | * @return IntoKeyword |
||
130 | */ |
||
131 | 36 | public static function parse(Parser $parser, TokensList $list, array $options = array()) |
|
227 | |||
228 | 4 | public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS') |
|
254 | |||
255 | /** |
||
256 | * @param IntoKeyword $component the component to be built |
||
257 | * @param array $options parameters for building |
||
258 | * |
||
259 | * @return string |
||
260 | */ |
||
261 | 8 | public static function build($component, array $options = array()) |
|
286 | } |
||
287 |
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.