1 | <?php |
||
21 | class JoinKeyword extends Component |
||
22 | { |
||
23 | /** |
||
24 | * Types of join. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | public static $JOINS = array( |
||
29 | 'CROSS JOIN' => 'CROSS', |
||
30 | 'FULL JOIN' => 'FULL', |
||
31 | 'FULL OUTER JOIN' => 'FULL', |
||
32 | 'INNER JOIN' => 'INNER', |
||
33 | 'JOIN' => 'JOIN', |
||
34 | 'LEFT JOIN' => 'LEFT', |
||
35 | 'LEFT OUTER JOIN' => 'LEFT', |
||
36 | 'RIGHT JOIN' => 'RIGHT', |
||
37 | 'RIGHT OUTER JOIN' => 'RIGHT', |
||
38 | 'NATURAL JOIN' => 'NATURAL', |
||
39 | 'NATURAL LEFT JOIN' => 'NATURAL LEFT', |
||
40 | 'NATURAL RIGHT JOIN' => 'NATURAL RIGHT', |
||
41 | 'NATURAL LEFT OUTER JOIN' => 'NATURAL LEFT OUTER', |
||
42 | 'NATURAL RIGHT OUTER JOIN' => 'NATURAL RIGHT OUTER', |
||
43 | 'STRAIGHT_JOIN' => 'STRAIGHT', |
||
44 | ); |
||
45 | |||
46 | /** |
||
47 | * Type of this join. |
||
48 | * |
||
49 | * @see static::$JOINS |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | public $type; |
||
54 | |||
55 | /** |
||
56 | * Join expression. |
||
57 | * |
||
58 | * @var Expression |
||
59 | */ |
||
60 | public $expr; |
||
61 | |||
62 | /** |
||
63 | * Join conditions. |
||
64 | * |
||
65 | * @var Condition[] |
||
66 | */ |
||
67 | public $on; |
||
68 | |||
69 | /** |
||
70 | * Columns in Using clause. |
||
71 | * |
||
72 | * @var ArrayObj |
||
73 | */ |
||
74 | public $using; |
||
75 | |||
76 | /** |
||
77 | * @param Parser $parser the parser that serves as context |
||
78 | * @param TokensList $list the list of tokens that are being parsed |
||
79 | * @param array $options parameters for parsing |
||
80 | * |
||
81 | * @return JoinKeyword[] |
||
82 | */ |
||
83 | 19 | public static function parse(Parser $parser, TokensList $list, array $options = array()) |
|
187 | |||
188 | /** |
||
189 | * @param JoinKeyword[] $component the component to be built |
||
190 | * @param array $options parameters for building |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | 3 | public static function build($component, array $options = array()) |
|
207 | } |
||
208 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.